chore(extractor): add bytes detection to DoodStream

This commit is contained in:
WebStreamr 2025-06-08 19:08:38 +00:00
parent 0446d52e78
commit d1ff7cd732
No known key found for this signature in database
7 changed files with 13 additions and 1 deletions

View file

@ -38,14 +38,19 @@ export class DoodStream implements Extractor {
const $ = cheerio.load(html);
const title = $('title').text().trim().replace(/ - DoodStream$/, '').trim();
const mp4Url = new URL(`${baseUrl}${randomstring.generate(10)}?token=${token}&expiry=${Date.now()}`);
const mp4Head = await this.fetcher.head(ctx, mp4Url, { headers: { Referer: 'http://dood.to' } });
return [
{
url: new URL(`${baseUrl}${randomstring.generate(10)}?token=${token}&expiry=${Date.now()}`),
url: mp4Url,
label: this.label,
sourceId: `${this.id}_${meta.countryCode.toLowerCase()}`,
ttl: this.ttl,
meta: {
title,
...(mp4Head['content-length'] && { bytes: parseInt(mp4Head['content-length'] as string) }),
...meta,
},
requestHeaders: {

View file

@ -46,6 +46,7 @@ exports[`MeineCloud handle imdb the devil's bath 1`] = `
{
"label": "DoodStream",
"meta": {
"bytes": 791702409,
"countryCode": "de",
"title": "des-teufels-bad-2024",
},

View file

@ -0,0 +1 @@
{"server":"nginx","date":"Sun, 08 Jun 2025 19:20:59 GMT","content-type":"video/mp4","content-length":791702409,"last-modified":"Wed, 03 Apr 2024 09:53:31 GMT","connection":"keep-alive","etag":"660d271b-2f306b89","access-control-allow-origin":"*","accept-ranges":"bytes"}

View file

@ -216,9 +216,11 @@ exports[`resolve returns sorted results 1`] = `
"Referer": "http://dood.to/",
},
},
"videoSize": 791702409,
},
"name": "WebStreamr N/A",
"title": "📂 des-teufels-bad-2024
💾 755.03 MB
🌐 German 🇩🇪
🔗 DoodStream",
"url": "https://aa360cc.cloudatacdn.com/u5kjv4jxytd3sdgge5uogji5dg4huat2pxrm2qibdbm5rtpmbzgb5tornooa/k9wk0js17e~mocked-random-string?token=7uebebipnnhusa4xnyea1er4&expiry=639837296000",