From 7b708e23851ce191439cbfbe625db07f6554ac8f Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Sun, 18 Jan 2026 13:21:17 +0000 Subject: [PATCH] chore: add priority for sorting, move VixSrc up and RgShows down --- src/source/RgShows.ts | 2 + src/source/Source.ts | 2 + src/source/VixSrc.ts | 2 + src/types.ts | 11 +-- src/utils/StreamResolver.test.ts | 11 +++ src/utils/StreamResolver.ts | 7 +- .../https:api.rgshows.rumaintv2190262 | 1 + .../https:api.themoviedb.org3tv2190 | 1 + ...ster.1755845058.txtt121478a4ande1765241578 | 6 ++ ...6fa4dd3cdf5c45037andexpires1773926255andh1 | 12 ++++ .../StreamResolver/https:vixsrc.totv2190262 | 67 +++++++++++++++++++ .../__snapshots__/StreamResolver.test.ts.snap | 32 +++++++++ 12 files changed, 148 insertions(+), 6 deletions(-) create mode 100644 src/utils/__fixtures__/StreamResolver/https:api.rgshows.rumaintv2190262 create mode 100644 src/utils/__fixtures__/StreamResolver/https:api.themoviedb.org3tv2190 create mode 100644 src/utils/__fixtures__/StreamResolver/https:sad.moriartis.storev4pk8karuhcf-master.1755845058.txtt121478a4ande1765241578 create mode 100644 src/utils/__fixtures__/StreamResolver/https:vixsrc.toplaylist418073.m3u8token9d4070344ef84e26fa4dd3cdf5c45037andexpires1773926255andh1 create mode 100644 src/utils/__fixtures__/StreamResolver/https:vixsrc.totv2190262 diff --git a/src/source/RgShows.ts b/src/source/RgShows.ts index 51a70aa..6468efe 100644 --- a/src/source/RgShows.ts +++ b/src/source/RgShows.ts @@ -16,6 +16,8 @@ export class RgShows extends Source { public readonly baseUrl = 'https://rgshows.ru'; + public override readonly priority = -1; + private readonly fetcher: Fetcher; public constructor(fetcher: Fetcher) { diff --git a/src/source/Source.ts b/src/source/Source.ts index 207cafa..74ab486 100644 --- a/src/source/Source.ts +++ b/src/source/Source.ts @@ -35,6 +35,8 @@ export abstract class Source { public abstract readonly baseUrl: string; + public readonly priority: number = 0; + protected abstract handleInternal(ctx: Context, type: ContentType, id: Id): Promise<(SourceResult[])>; public static stats() { diff --git a/src/source/VixSrc.ts b/src/source/VixSrc.ts index fd2e550..d688ac9 100644 --- a/src/source/VixSrc.ts +++ b/src/source/VixSrc.ts @@ -14,6 +14,8 @@ export class VixSrc extends Source { public readonly baseUrl = 'https://vixsrc.to'; + public override readonly priority = 1; + private readonly fetcher: Fetcher; public constructor(fetcher: Fetcher) { diff --git a/src/types.ts b/src/types.ts index ca73182..828b354 100644 --- a/src/types.ts +++ b/src/types.ts @@ -78,12 +78,13 @@ export enum BlockedReason { export interface Meta { bytes?: number | undefined; countryCodes?: CountryCode[]; - height?: number | undefined; - referer?: string | undefined; - title?: string | undefined; - sourceLabel?: string | undefined; - sourceId?: string | undefined; extractorId?: string | undefined; + height?: number | undefined; + priority?: number | undefined; + referer?: string | undefined; + sourceId?: string | undefined; + sourceLabel?: string | undefined; + title?: string | undefined; } export enum Format { diff --git a/src/utils/StreamResolver.test.ts b/src/utils/StreamResolver.test.ts index 5985193..685f4d2 100644 --- a/src/utils/StreamResolver.test.ts +++ b/src/utils/StreamResolver.test.ts @@ -3,12 +3,16 @@ import winston from 'winston'; import { BlockedError, HttpError, NotFoundError, QueueIsFullError, TimeoutError, TooManyRequestsError, TooManyTimeoutsError } from '../error'; import { createExtractors, Extractor, ExtractorRegistry } from '../extractor'; import { HubCloud } from '../extractor/HubCloud'; +import { RgShows as RgShowsExtractor } from '../extractor/RgShows'; import { VidSrc as VidSrcExtractor } from '../extractor/VidSrc'; +import { VixSrc as VixSrcExtractor } from '../extractor/VixSrc'; import { Source, SourceResult } from '../source'; import { FourKHDHub } from '../source/FourKHDHub'; import { MeineCloud } from '../source/MeineCloud'; import { MostraGuarda } from '../source/MostraGuarda'; +import { RgShows } from '../source/RgShows'; import { VidSrc } from '../source/VidSrc'; +import { VixSrc } from '../source/VixSrc'; import { createTestContext } from '../test'; import { BlockedReason, CountryCode, Format, UrlResult } from '../types'; import { FetcherMock } from './FetcherMock'; @@ -88,6 +92,13 @@ describe('resolve', () => { expect(streams.streams).toMatchSnapshot(); }); + test('uses priority for sorting', async () => { + const streamResolver = new StreamResolver(logger, new ExtractorRegistry(logger, [new RgShowsExtractor(fetcher), new VixSrcExtractor(fetcher)])); + + const streams = await streamResolver.resolve(createTestContext(), [new RgShows(fetcher), new VixSrc(fetcher)], 'series', new TmdbId(2190, 26, 2)); + expect(streams.streams).toMatchSnapshot(); + }); + test('adds error info', async () => { class MockSource extends Source { public readonly id = 'mocksource'; diff --git a/src/utils/StreamResolver.ts b/src/utils/StreamResolver.ts index c386073..410ce07 100644 --- a/src/utils/StreamResolver.ts +++ b/src/utils/StreamResolver.ts @@ -54,7 +54,7 @@ export class StreamResolver { try { const sourceResults = await source.handle(ctx, type, id); const sourceUrlResults = await Promise.all( - sourceResults.map(({ url, meta }) => this.extractorRegistry.handle(ctx, url, { ...meta, sourceLabel: source.label, sourceId: source.id }, true)), + sourceResults.map(({ url, meta }) => this.extractorRegistry.handle(ctx, url, { ...meta, sourceLabel: source.label, sourceId: source.id, priority: source.priority }, true)), ); for (const urlResult of sourceUrlResults.flat()) { @@ -130,6 +130,11 @@ export class StreamResolver { return bytesComparison; } + const priorityComparison = (b.meta?.priority ?? 0) - (a.meta?.priority ?? 0); + if (priorityComparison !== 0) { + return priorityComparison; + } + return a.label.localeCompare(b.label); }); diff --git a/src/utils/__fixtures__/StreamResolver/https:api.rgshows.rumaintv2190262 b/src/utils/__fixtures__/StreamResolver/https:api.rgshows.rumaintv2190262 new file mode 100644 index 0000000..4baf1e2 --- /dev/null +++ b/src/utils/__fixtures__/StreamResolver/https:api.rgshows.rumaintv2190262 @@ -0,0 +1 @@ +{"stream":{"url":"https://sad.moriartis.store/v4/pk8/karuh/cf-master.1755845058.txt?t=121478a4&e=1765241578"}} \ No newline at end of file diff --git a/src/utils/__fixtures__/StreamResolver/https:api.themoviedb.org3tv2190 b/src/utils/__fixtures__/StreamResolver/https:api.themoviedb.org3tv2190 new file mode 100644 index 0000000..94644bc --- /dev/null +++ b/src/utils/__fixtures__/StreamResolver/https:api.themoviedb.org3tv2190 @@ -0,0 +1 @@ +{"adult":false,"backdrop_path":"/3UviYOlhn8EgXMBuiT6MnUuo1w9.jpg","created_by":[{"id":34518,"credit_id":"5257270e760ee3776a2786eb","name":"Matt Stone","original_name":"Matt Stone","gender":2,"profile_path":"/nS3BOaF0EHd7vyATV7WBnFEvTLr.jpg"},{"id":34517,"credit_id":"5257270e760ee3776a2786e5","name":"Trey Parker","original_name":"Trey Parker","gender":2,"profile_path":"/pVEfyxGOBoKoirRZtmSsJ7PX91V.jpg"}],"episode_run_time":[],"first_air_date":"1997-08-13","genres":[{"id":16,"name":"Animation"},{"id":35,"name":"Comedy"}],"homepage":"http://southpark.cc.com/","id":2190,"in_production":true,"languages":["en"],"last_air_date":"2025-12-10","last_episode_to_air":{"id":6606757,"name":"The Crap Out","overview":"Satan’s due, Stan’s praying, and only a Christmas miracle can deliver the Antichrist on time.","vote_average":5.733,"vote_count":15,"air_date":"2025-12-10","episode_number":5,"episode_type":"finale","production_code":"","runtime":26,"season_number":28,"show_id":2190,"still_path":"/6XUCxqs7eejaVz4zxJlJTIA9wy0.jpg"},"name":"South Park","next_episode_to_air":null,"networks":[{"id":47,"logo_path":"/6ooPjtXufjsoskdJqj6pxuvHEno.png","name":"Comedy Central","origin_country":"US"}],"number_of_episodes":331,"number_of_seasons":28,"origin_country":["US"],"original_language":"en","original_name":"South Park","overview":"Follow the misadventures of four irreverent grade-schoolers in the quiet, dysfunctional town of South Park, Colorado.","popularity":67.6377,"poster_path":"/1CGwZCFX2qerXaXQJJUB3qUvxq7.jpg","production_companies":[{"id":45850,"logo_path":"/73sPBDOuehu9IBVM9UpNCdjilJU.png","name":"South Park Studios","origin_country":"US"},{"id":1538,"logo_path":"/1y7qNFwczl2zZS62Hrlw6dsAwgR.png","name":"Comedy Central","origin_country":"US"},{"id":45851,"logo_path":null,"name":"Braniff Productions","origin_country":"US"},{"id":6329,"logo_path":"/4lZJiVHPClma8YB9hXodraFXSwi.png","name":"MTV Entertainment Studios","origin_country":"US"},{"id":270175,"logo_path":null,"name":"Parker-Stone Productions","origin_country":"US"}],"production_countries":[{"iso_3166_1":"US","name":"United States of America"}],"seasons":[{"air_date":"1992-12-08","episode_count":33,"id":6718,"name":"Specials","overview":"The specials cover a wide range of extras as well as one-off episodes released outside of the normal season.","poster_path":"/zDWaLg5X7mVfqsa5L4YmFmkDDqT.jpg","season_number":0,"vote_average":0.0},{"air_date":"1997-08-13","episode_count":13,"id":6705,"name":"Season 1","overview":"This is the season that started it all! Join Stan, Kyle Cartman and Kenny as these four animated tykes take on the supernatural, the extraordinary and the insane. For them, it’s all part of growing up in South Park.","poster_path":"/sxCj0Iun46sUUsF5I2NQY6rml4c.jpg","season_number":1,"vote_average":7.8},{"air_date":"1998-04-01","episode_count":18,"id":6706,"name":"Season 2","overview":"Join Stan, Kyle, Cartman and Kenny as they discover the identity of Cartman's father, learn about Conjoined Twin-Myslexia and thaw a prehistoric ice man. For them, it’s all part of growing up in South Park!","poster_path":"/fSlMHxDB6Ln9V1wwuI9M1ylcE68.jpg","season_number":2,"vote_average":7.6},{"air_date":"1999-04-07","episode_count":17,"id":6707,"name":"Season 3","overview":"Return to everyone’s favorite mountain town for seventeen outrageously bizarre episodes of South Park. Along the way, you’ll meet the Succubus, get caught up in the Chinpokomon frenzy and find out why citizens are spontaneously combusting.","poster_path":"/996EYWRu4zksbNodgs1Omri02Yi.jpg","season_number":3,"vote_average":7.8},{"air_date":"2000-04-05","episode_count":17,"id":6708,"name":"Season 4","overview":"Join Stan, Kyle, Cartman and Kenny as they graduate to 4th grade, join in the 2000 election recount, the controversy over Saddam Hussein, and the introduction of Timmy!!! For them, it’s all part of growing up in South Park!","poster_path":"/kqJ3yofZa2bVQNC3wl0CQV5EUmr.jpg","season_number":4,"vote_average":8.0},{"air_date":"2001-06-20","episode_count":14,"id":6709,"name":"Season 5","overview":"Join Stan, Kyle, Cartman and Kenny as they welcome Jimmy the new handi-capable kid in town & Towelie, Radiohead guest stars, Big Gay Al returns, and Terrance and Phillip break up. For them, it’s all part of growing up in South Park!","poster_path":"/mbNzB0ji7QpHAMNnf0xpAJYoQWJ.jpg","season_number":5,"vote_average":8.1},{"air_date":"2002-03-06","episode_count":17,"id":6710,"name":"Season 6","overview":"In this series Stan convinces the boys to kidnap all the calves from a local farm after a look at how veal is made turns him vegetarian; Professor Chaos struggles to find an evil scheme that hasn't already been done on 'The Simpsons'; and when Bebe's breasts begin to take shape, the boys can't understand why they're suddenly interested in her.","poster_path":"/7nKjCuBH0tGkLwBwxDgxbBrNj5F.jpg","season_number":6,"vote_average":8.2},{"air_date":"2003-03-19","episode_count":15,"id":6711,"name":"Season 7","overview":"Join Stan, Kyle, Cartman and Kenny as they go gaga for “Queer Eye,” start their own Christian Rock Band, and discover that Earth is an intergalactic reality show that's about to be cancelled. For them, it’s all part of growing up in South Park!","poster_path":"/zYHoEtNxkdAa4g8wPdBdGq8VOzC.jpg","season_number":7,"vote_average":8.2},{"air_date":"2004-03-17","episode_count":14,"id":6712,"name":"Season 8","overview":"Join Stan, Kyle, Cartman and Kenny as they witness the girls’ celebrity-worship of ditzy, rich, sex-tape-making socialites and take part in an awesome anime battle with Professor Chaos. For them, it’s all part of growing up in South Park!","poster_path":"/aTTmEQqmlVGNHNKJ8K4rFAnZrPo.jpg","season_number":8,"vote_average":8.3},{"air_date":"2005-03-09","episode_count":14,"id":6713,"name":"Season 9","overview":"Join Stan, Kyle, Cartman and Kenny as they deal with the perceived dangers of global warming, a certain actor's sexuality is questioned, and the Pope arrives to witness a religious miracle. For them, it’s all part of growing up in South Park!","poster_path":"/5cCxlgStfCVaaZtBuxmIVlHeoli.jpg","season_number":9,"vote_average":8.0},{"air_date":"2006-03-22","episode_count":14,"id":6714,"name":"Season 10","overview":"Join Stan, Kyle, Cartman and Kenny as they witness the death of Chef, defeat a virtual villain out to destroy the world, and suffer the consequences of Cartman’s video game console obsession. For them, it’s all part of growing up in South Park!","poster_path":"/brFCz0wW2bRyOyK81OqwDiJDmFA.jpg","season_number":10,"vote_average":8.0},{"air_date":"2007-03-07","episode_count":14,"id":6722,"name":"Season 11","overview":"It’s a season of diabolical secrets as Cartman covers up a salacious photo and the boys reveal a bizarre Easter society. An explosive visit from Hillary Clinton, a world-record crap and the Imaginationland trilogy only add to the awesomeness of Season 11.","poster_path":"/cVfhCT2wZq3hHCp8i2II8hHjOOg.jpg","season_number":11,"vote_average":8.0},{"air_date":"2008-03-12","episode_count":14,"id":6715,"name":"Season 12","overview":"Join Stan, Kyle, Cartman and Kenny as they help a pop-princess down on her luck, negotiate a truce for striking Canadians, fight the addiction of \"cheesing\" and battle startling rodents. For them, it's all part of growing up in South Park","poster_path":"/wVDJyjekgMXqkVAmvplwkVfL9qX.jpg","season_number":12,"vote_average":7.6},{"air_date":"2009-03-11","episode_count":14,"id":6716,"name":"Season 13","overview":"Join Cartman, Kenny, Stan and Kyle as they save the economy, the whales, and a bunch of dead celebrities all while discovering the joys of Fish Sticks. For them, it's all part of growing up in South Park","poster_path":"/15Lszg1L3w6vGGqFFoTN0asxj5C.jpg","season_number":13,"vote_average":7.6},{"air_date":"2010-03-17","episode_count":14,"id":6717,"name":"Season 14","overview":"This series finds Stan, Kyle, Cartman, Kenny, Butters and co getting into fixes through their usual blend of innocence and mischievousness. As well as coming to terms with the perils of social networking and being accused of sex addiction in the furore that sweeps the nation in the wake of the revelations surrounding Tiger Woods, the boys finally reveal the identity of the suitably mysterious Mysterion in a three-part special.","poster_path":"/6Xik83L9tCmLqh0cdxoopOsQm69.jpg","season_number":14,"vote_average":7.7},{"air_date":"2011-04-27","episode_count":14,"id":6719,"name":"Season 15","overview":"Join Stan, Kyle, Cartman and Kenny in the fifteenth season as they confront modern mad scientists, fundamentalist agnostics, and face their greatest challenge yet -- Stan growing a year older. For them, it's all part of growing up in South Park.","poster_path":"/6T31LPecW0wIB05VOExvaAssd4f.jpg","season_number":15,"vote_average":7.4},{"air_date":"2012-03-14","episode_count":14,"id":6720,"name":"Season 16","overview":"Join Cartman, Kenny, Stan and Kyle as they hunt down the mythical Jewpacabra, ‘sketti wrestle with reality stars, and go jackin’ it in San Diego. For them, it's all part of growing up in South Park.","poster_path":"/rYIXqHRPDKMhyx6fPi5DosDGniq.jpg","season_number":16,"vote_average":7.2},{"air_date":"2013-09-25","episode_count":10,"id":6721,"name":"Season 17","overview":"Join Stan, Kyle, Cartman and Princess Kenny as they infiltrate the NSA, thwart patient zero, tame some strange and fight in the greatest battle of their young, hot lives.","poster_path":"/spuqYJjCgZZyk0d9OTIRHAyeDaF.jpg","season_number":17,"vote_average":7.7},{"air_date":"2014-09-24","episode_count":10,"id":62784,"name":"Season 18","overview":"Join Cartman, Kenny, Stan and Kyle as they get lost in virtual reality, go underground with Cock Magic, and uncover the shocking truth about a music superstar. For them, it’s all part of growing up in South Park!","poster_path":"/5IMCLoCtNOyHHYS4dZqMNkwELhU.jpg","season_number":18,"vote_average":7.5},{"air_date":"2015-09-16","episode_count":10,"id":70512,"name":"Season 19","overview":"Join Cartman, Kenny, Stan and Kyle as Mr. Garrison makes a bid for the White House, Randy takes the lead in gentrifying the town, and everyone is looking for their safe space. For them, it’s all part of growing up in South Park!","poster_path":"/7iMBDcRWcCLjeDiZa6Dd3MGgSIm.jpg","season_number":19,"vote_average":7.5},{"air_date":"2016-09-14","episode_count":10,"id":78669,"name":"Season 20","overview":"Join Cartman, Kenny, Stan and Kyle as they confront online trolling, face the member berry epidemic, and come to terms with Cartman having a girlfriend. For them, it’s all part of growing up in South Park!","poster_path":"/tQvfdzJFMV70grQBB9ylv35ChGW.jpg","season_number":20,"vote_average":7.4},{"air_date":"2017-09-13","episode_count":10,"id":92690,"name":"Season 21","overview":"Join Cartman, Kenny, Stan, and Kyle as they take on the opioid epidemic, experiment with water bears, dig into the underbelly of social media and go to war with Canada. For them, it’s all part of growing up in South Park!","poster_path":"/jeNkiDr0f1RIBylZ27qHppqAAIW.jpg","season_number":21,"vote_average":7.1},{"air_date":"2018-09-26","episode_count":10,"id":109933,"name":"Season 22","overview":"Join Stan, Kyle, Cartman, Kenny as they deal the vaping epidemic, Cartman’s anxiety disorder, and the fact that they didn't take the threat of ManBearPig \"cereal\" enough the first time around. For them, it’s all part of growing up in South Park!","poster_path":"/4pRzNSVOnORKXdSrXk76SQi4Ghm.jpg","season_number":22,"vote_average":7.3},{"air_date":"2019-09-25","episode_count":10,"id":131142,"name":"Season 23","overview":"Join Stan, Kyle, Cartman, Kenny, and Randy as they explore the wonders of the human biome, tackle the consequences of immigration, and get banned in China. For them, it’s all part of growing up in South Park!","poster_path":"/nr5UwffUeD13OsaHhMiOWdlh6Nj.jpg","season_number":23,"vote_average":7.4},{"air_date":"2020-09-30","episode_count":2,"id":164444,"name":"Season 24","overview":"Join Stan, Kyle, Cartman, and Kenny as they navigate the COVID-19 pandemic. Will the broship survive as vaccines become available? For them, it’s all part of growing up in South Park!","poster_path":"/g22mpMV5LszB0ShKFW0CLxUDK3U.jpg","season_number":24,"vote_average":7.3},{"air_date":"2022-02-02","episode_count":6,"id":240087,"name":"Season 25","overview":"Join Stan, Kyle, Cartman, and Kenny as they correct a long-held misconception about one of their classmates, deal with moody teenagers, and celebrate Pajama Day at South Park Elementary. For them, it's all part of growing up in South Park!","poster_path":"/msrUAxoLgwnmFaPn5c1wtquvaje.jpg","season_number":25,"vote_average":7.0},{"air_date":"2023-02-08","episode_count":6,"id":324837,"name":"Season 26","overview":"Join Stan, Kyle, Cartman and Kenny as they learn the wonders of Japanese toilets, grapple with latest developments in A.l. technology, reopen an iconic Colorado restaurant, and meet a couple who feel the need to share the importance of their privacy with the world. For them, it's all part of growing up in South Park!","poster_path":"/eeMrOKmOm2V3VJW98P0b4cogDA5.jpg","season_number":26,"vote_average":7.4},{"air_date":"2025-07-23","episode_count":5,"id":449460,"name":"Season 27","overview":"","poster_path":"/9JYi3mM4Vd9YpvKPr13VmOb8aZ4.jpg","season_number":27,"vote_average":6.8},{"air_date":"2025-10-15","episode_count":5,"id":480193,"name":"Season 28","overview":"","poster_path":"/hSTQkvdWcCSx4xpaELUR44VbAX0.jpg","season_number":28,"vote_average":5.9}],"spoken_languages":[{"english_name":"English","iso_639_1":"en","name":"English"}],"status":"Returning Series","tagline":"Four boys. One f**ked-up town.","type":"Scripted","vote_average":8.337,"vote_count":4805} \ No newline at end of file diff --git a/src/utils/__fixtures__/StreamResolver/https:sad.moriartis.storev4pk8karuhcf-master.1755845058.txtt121478a4ande1765241578 b/src/utils/__fixtures__/StreamResolver/https:sad.moriartis.storev4pk8karuhcf-master.1755845058.txtt121478a4ande1765241578 new file mode 100644 index 0000000..7835ff7 --- /dev/null +++ b/src/utils/__fixtures__/StreamResolver/https:sad.moriartis.storev4pk8karuhcf-master.1755845058.txtt121478a4ande1765241578 @@ -0,0 +1,6 @@ +#EXTM3U +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=627686,RESOLUTION=1280x720,FRAME-RATE=24.000,CODECS="avc1.64001f,mp4a.40.2" +index-f1-v1-a1.txt +#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1173799,RESOLUTION=1920x1080,FRAME-RATE=24.000,CODECS="avc1.640028,mp4a.40.2" +index-f2-v1-a1.txt + diff --git a/src/utils/__fixtures__/StreamResolver/https:vixsrc.toplaylist418073.m3u8token9d4070344ef84e26fa4dd3cdf5c45037andexpires1773926255andh1 b/src/utils/__fixtures__/StreamResolver/https:vixsrc.toplaylist418073.m3u8token9d4070344ef84e26fa4dd3cdf5c45037andexpires1773926255andh1 new file mode 100644 index 0000000..903764f --- /dev/null +++ b/src/utils/__fixtures__/StreamResolver/https:vixsrc.toplaylist418073.m3u8token9d4070344ef84e26fa4dd3cdf5c45037andexpires1773926255andh1 @@ -0,0 +1,12 @@ +#EXTM3U +#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="Italian",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="ita",URI="https://vixsrc.to/playlist/418073?type=audio&rendition=ita&token=xvtDbh4q0VdzVFfIH5kfwg&expires=1773926255&edge=sc-u15-01" +#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="English",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="eng",URI="https://vixsrc.to/playlist/418073?type=audio&rendition=eng&token=xvtDbh4q0VdzVFfIH5kfwg&expires=1773926255&edge=sc-u15-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English [CC]",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="eng",URI="https://vixsrc.to/playlist/418073?type=subtitle&rendition=eng-3&token=xvtDbh4q0VdzVFfIH5kfwg&expires=1773926255&edge=sc-u15-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="eng",URI="https://vixsrc.to/playlist/418073?type=subtitle&rendition=eng-4&token=xvtDbh4q0VdzVFfIH5kfwg&expires=1773926255&edge=sc-u15-01" +#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Italian",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="ita",URI="https://vixsrc.to/playlist/418073?type=subtitle&rendition=ita-5&token=xvtDbh4q0VdzVFfIH5kfwg&expires=1773926255&edge=sc-u15-01" +#EXT-X-STREAM-INF:BANDWIDTH=4500000,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="audio",SUBTITLES="subs" +https://vixsrc.to/playlist/418073?type=video&rendition=1080p&token=F2MTLlphkA83s_cVhdhFBA&expires=1773926255&edge=sc-u15-01 +#EXT-X-STREAM-INF:BANDWIDTH=1800000,CODECS="avc1.64001f,mp4a.40.2",RESOLUTION=1280x720,AUDIO="audio",SUBTITLES="subs" +https://vixsrc.to/playlist/418073?type=video&rendition=720p&token=KoitnEkRaoatCgH9j3M7Ng&expires=1773926255&edge=sc-u15-01 +#EXT-X-STREAM-INF:BANDWIDTH=1080000,CODECS="avc1.64001f,mp4a.40.2",RESOLUTION=854x480,AUDIO="audio",SUBTITLES="subs" +https://vixsrc.to/playlist/418073?type=video&rendition=480p&token=kbo5ZqvHBboUrQ0DPeniGA&expires=1773926255&edge=sc-u15-01 \ No newline at end of file diff --git a/src/utils/__fixtures__/StreamResolver/https:vixsrc.totv2190262 b/src/utils/__fixtures__/StreamResolver/https:vixsrc.totv2190262 new file mode 100644 index 0000000..a1acc93 --- /dev/null +++ b/src/utils/__fixtures__/StreamResolver/https:vixsrc.totv2190262 @@ -0,0 +1,67 @@ + + + + + + 418073 + + + + + + + + + + + + +
+
+
+ + +
+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/utils/__snapshots__/StreamResolver.test.ts.snap b/src/utils/__snapshots__/StreamResolver.test.ts.snap index 157b9b7..01f4932 100644 --- a/src/utils/__snapshots__/StreamResolver.test.ts.snap +++ b/src/utils/__snapshots__/StreamResolver.test.ts.snap @@ -532,3 +532,35 @@ exports[`resolve skips fallback sources if possible 1`] = ` }, ] `; + +exports[`resolve uses priority for sorting 1`] = ` +[ + { + "behaviorHints": { + "bingeGroup": "webstreamr-vixsrc-vixsrc-multi_en_it", + "notWebReady": true, + }, + "name": "WebStreamr 🌐 🇺🇸 🇮🇹 1080p", + "title": "South Park S26E02 +🔗 VixSrc", + "url": "https://vixsrc.to/playlist/418073.m3u8?token=9d4070344ef84e26fa4dd3cdf5c45037&expires=1773926255&h=1", + }, + { + "behaviorHints": { + "bingeGroup": "webstreamr-rgshows-rgshows-multi", + "notWebReady": true, + "proxyHeaders": { + "request": { + "Origin": "https://rgshows.ru", + "Referer": "https://rgshows.ru/", + "User-Agent": "Mozilla", + }, + }, + }, + "name": "WebStreamr 🌐 1080p", + "title": "South Park S26E02 +🔗 RgShows", + "url": "https://sad.moriartis.store/v4/pk8/karuh/cf-master.1755845058.txt?t=121478a4&e=1765241578", + }, +] +`;