mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-10 07:18:30 +00:00
api/bilibili: don't return isHLS
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
videos are no longer HLS i guess
This commit is contained in:
parent
43f4793448
commit
2e86a6ca70
@ -18,7 +18,7 @@ function extractBestQuality(dashData) {
|
||||
}
|
||||
|
||||
async function com_download(id) {
|
||||
let html = await fetch(`https://bilibili.com/video/${id}`, {
|
||||
const html = await fetch(`https://bilibili.com/video/${id}`, {
|
||||
headers: {
|
||||
"user-agent": genericUserAgent
|
||||
}
|
||||
@ -34,7 +34,10 @@ async function com_download(id) {
|
||||
return { error: "fetch.empty" };
|
||||
}
|
||||
|
||||
let streamData = JSON.parse(html.split('<script>window.__playinfo__=')[1].split('</script>')[0]);
|
||||
const streamData = JSON.parse(
|
||||
html.split('<script>window.__playinfo__=')[1].split('</script>')[0]
|
||||
);
|
||||
|
||||
if (streamData.data.timelength > env.durationLimit * 1000) {
|
||||
return { error: "content.too_long" };
|
||||
}
|
||||
@ -48,7 +51,6 @@ async function com_download(id) {
|
||||
urls: [video.baseUrl, audio.baseUrl],
|
||||
audioFilename: `bilibili_${id}_audio`,
|
||||
filename: `bilibili_${id}_${video.width}x${video.height}.mp4`,
|
||||
isHLS: true
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user