fix: add language to sourceId for better grouping / binge watching

This commit is contained in:
WebStreamr 2025-05-12 15:14:43 +00:00
parent 8ba6fdb5df
commit 3d4129fbd9
No known key found for this signature in database
6 changed files with 10 additions and 10 deletions

View file

@ -29,7 +29,7 @@ export class Dropload implements EmbedExtractor {
return {
url: extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]),
label: this.label,
sourceId: this.id,
sourceId: `${this.id}_${countryCode.toLowerCase()}`,
height: parseInt(heightMatch[1] as string) as number,
bytes: bytes.parse(sizeMatch[1] as string) as number,
countryCode,

View file

@ -27,7 +27,7 @@ export class SuperVideo implements EmbedExtractor {
return {
url: extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]),
label: this.label,
sourceId: this.id,
sourceId: `${this.id}_${countryCode.toLowerCase()}`,
height: parseInt(heightAndSizeMatch[1] as string) as number,
bytes: bytes.parse(heightAndSizeMatch[2] as string) as number,
countryCode,

View file

@ -29,7 +29,7 @@ describe('FrenchCloud', () => {
expect(streams[0]).toStrictEqual({
url: expect.any(URL),
label: 'SuperVideo',
sourceId: 'supervideo',
sourceId: 'supervideo_fr',
height: 720,
bytes: 966682214,
countryCode: 'fr',
@ -38,7 +38,7 @@ describe('FrenchCloud', () => {
expect(streams[1]).toStrictEqual({
url: expect.any(URL),
label: 'Dropload',
sourceId: 'dropload',
sourceId: 'dropload_fr',
height: 720,
bytes: 966682214,
countryCode: 'fr',

View file

@ -29,7 +29,7 @@ describe('KinoKiste', () => {
expect(streams[0]).toStrictEqual({
url: expect.any(URL),
label: 'SuperVideo',
sourceId: 'supervideo',
sourceId: 'supervideo_de',
height: 720,
bytes: 733793484,
countryCode: 'de',
@ -38,7 +38,7 @@ describe('KinoKiste', () => {
expect(streams[1]).toStrictEqual({
url: expect.any(URL),
label: 'Dropload',
sourceId: 'dropload',
sourceId: 'dropload_de',
height: 720,
bytes: 733793484,
countryCode: 'de',

View file

@ -29,7 +29,7 @@ describe('MeineCloud', () => {
expect(streams[0]).toStrictEqual({
url: expect.any(URL),
label: 'SuperVideo',
sourceId: 'supervideo',
sourceId: 'supervideo_de',
height: 720,
bytes: 1073741824,
countryCode: 'de',
@ -38,7 +38,7 @@ describe('MeineCloud', () => {
expect(streams[1]).toStrictEqual({
url: expect.any(URL),
label: 'Dropload',
sourceId: 'dropload',
sourceId: 'dropload_de',
height: 1080,
bytes: 1395864371,
countryCode: 'de',

View file

@ -29,7 +29,7 @@ describe('MostraGuarda', () => {
expect(streams[0]).toStrictEqual({
url: expect.any(URL),
label: 'SuperVideo',
sourceId: 'supervideo',
sourceId: 'supervideo_it',
height: 720,
bytes: 1181116006,
countryCode: 'it',
@ -38,7 +38,7 @@ describe('MostraGuarda', () => {
expect(streams[1]).toStrictEqual({
url: expect.any(URL),
label: 'Dropload',
sourceId: 'dropload',
sourceId: 'dropload_it',
height: 720,
bytes: 1181116006,
countryCode: 'it',