Skip to content

Commit

Permalink
7.2: small improvements
Browse files Browse the repository at this point in the history
- increased video length to 5 hours from 3 hours.
- fixed clickable area for urgent notice.
- possibly fixed random 0kb files.
  • Loading branch information
wukko committed Aug 29, 2023
1 parent 8dcb6d8 commit 055eff9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cobalt",
"description": "save what you love",
"version": "7.1.3",
"version": "7.2",
"author": "wukko",
"exports": "./src/cobalt.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"streamLifespan": 20000,
"maxVideoDuration": 10800000,
"maxVideoDuration": 18000000,
"genericUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"authorInfo": {
"name": "wukko",
Expand Down
6 changes: 5 additions & 1 deletion src/front/cobalt.css
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,16 @@ button:active,
width: 100%;
text-align: center;
position: absolute;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
padding-top: calc(env(safe-area-inset-top) + 1rem);
}
.urgent-text {
display: flex;
align-items: center;
cursor: pointer;
}
.no-transparency .glass-bkg,
.no-transparency #popup-backdrop {
backdrop-filter: none;
Expand Down
4 changes: 3 additions & 1 deletion src/modules/pageRender/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ export function celebrationsEmoji() {
}
export function urgentNotice(obj) {
if (obj.visible) {
return `<div id="urgent-notice" class="urgent-notice explanation" onclick="${obj.action}">${emoji(obj.emoji, 18)} ${obj.text}</div>`
return `<div id="urgent-notice" class="urgent-notice explanation">` +
`<span class="urgent-text" onclick="${obj.action}">${emoji(obj.emoji, 18)} ${obj.text}</span>` +
`</div>`
}
return ``
}
Expand Down
7 changes: 5 additions & 2 deletions src/modules/stream/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export async function streamDefault(streamInfo, res) {
res.setHeader('Content-disposition', `attachment; filename="${streamInfo.isAudioOnly ? `${streamInfo.filename}.${streamInfo.audioFormat}` : regFilename}"`);

const { body: stream, headers } = await request(streamInfo.urls, {
headers: { 'user-agent': genericUserAgent }
headers: { 'user-agent': genericUserAgent },
maxRedirections: 16
});

res.setHeader('content-type', headers['content-type']);
Expand All @@ -33,7 +34,9 @@ export async function streamLiveRender(streamInfo, res) {
try {
if (streamInfo.urls.length !== 2) return fail(res);

let { body: audio } = await request(streamInfo.urls[1]);
let { body: audio } = await request(streamInfo.urls[1], {
maxRedirections: 16
});

let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1],
args = [
Expand Down

0 comments on commit 055eff9

Please sign in to comment.