From 00000d91868eb337ca710824c3f565c7e33d91c5 Mon Sep 17 00:00:00 2001 From: doms9 <96013514+doms9@users.noreply.github.com> Date: Mon, 15 Sep 2025 09:26:20 -0400 Subject: [PATCH] e --- M3U8/scrapers/caches/fstv.json | 94 +------- M3U8/scrapers/caches/livetvsx.json | 333 +---------------------------- M3U8/scrapers/fstv.py | 14 +- M3U8/scrapers/livetvsx.py | 10 +- M3U8/scrapers/ppv.py | 4 +- M3U8/scrapers/streambtw.py | 5 +- M3U8/scrapers/streameast.py | 5 +- M3U8/scrapers/tvpass.py | 5 +- M3U8/scrapers/utils/__init__.py | 2 + M3U8/scrapers/utils/config.py | 4 + 10 files changed, 36 insertions(+), 440 deletions(-) diff --git a/M3U8/scrapers/caches/fstv.json b/M3U8/scrapers/caches/fstv.json index f34410e..9e26dfe 100644 --- a/M3U8/scrapers/caches/fstv.json +++ b/M3U8/scrapers/caches/fstv.json @@ -1,93 +1 @@ -{ - "[NFL] NFL NetWork 24/7 (FSTV)": { - "url": "https://o2.sundaytueday.online/us-nfl.m3u8?auth_key=1757894708-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-831154319a0ecbca4396886f9ba88d9e&type=hls&isLive=true", - "logo": "https://i.gyazo.com/fb4956d7a2fe54a1bac54cd81e1b3f11.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/nfl-network-247-nfl-978688" - }, - "[NFL] NFL RedZone (FSTV)": { - "url": "https://o2.sundaytueday.online/us-redzone.m3u8?auth_key=1757894708-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-00dc4468d9a8222f1d2ae45db28876bf&type=hls&isLive=true", - "logo": "https://i.gyazo.com/fb4956d7a2fe54a1bac54cd81e1b3f11.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/nfl-redzone-nflredzone" - }, - "[NFL] Minnesota Vikings vs Atlanta Falcons (FSTV)": { - "url": "https://o2.sundaytueday.online/us-nbc.m3u8?auth_key=1757894709-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-0a444814a46724b39568e45607cd3180&type=hls&isLive=true", - "logo": "https://i.gyazo.com/fb4956d7a2fe54a1bac54cd81e1b3f11.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/minnesota-vikings-vs-atlanta-falcons-american-football-17343" - }, - "[Pay-Per-View] 77th Emmy Awards Live (FSTV)": { - "url": "https://o3.sundaytueday.online/pre11.m3u8?auth_key=1757894710-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-93367d54337e83e7cc29e0607a2d9765&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/77th-emmy-awards-live-emmy-8657" - }, - "[MLB] Boston Red Sox vs New York Yankees (FSTV)": { - "url": "https://o5.sundaytueday.online/mlb-bostonredsox.m3u8?auth_key=1757894710-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-3228b9249305b0d90a4df5a5043db347&type=hls&isLive=true", - "logo": "https://i.gyazo.com/0fe7865ef2f06c9507791b24f04dbca8.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/boston-red-sox-vs-new-york-yankees-baseball-173251" - }, - "[Primera A] Deportivo Pereira vs Llaneros (FSTV)": { - "url": "https://o3.sundaytueday.online/dmtn31.m3u8?auth_key=1757894711-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-b8cf0d969a8936dee6b5bff28c6be1c6&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/deportivo-pereira-vs-llaneros-football-1392454" - }, - "[Serie A] Vasco DA Gama vs Ceara (FSTV)": { - "url": "https://o4.sundaytueday.online/br-premier1.m3u8?auth_key=1757894712-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-faca3f7035895bf2ea7ed8db2aa05c0b&type=hls&isLive=true", - "logo": "https://i.gyazo.com/38fd8ea613b0f02780d2314fd49f7595.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/vasco-da-gama-vs-ceara-football-1351264" - }, - "[NWSL Women] Seattle Reign FC vs Racing Louisville W (FSTV)": { - "url": "https://o3.sundaytueday.online/pre22.m3u8?auth_key=1757894712-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-579d9cc8cf7559333b70afe13d8326f8&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757894705.493397, - "href": "/match/seattle-reign-fc-vs-racing-louisville-w-football-1339385" - }, - "[Liga MX] Atletico San Luis vs Club Tijuana (FSTV)": { - "url": "https://o4.sundaytueday.online/usa-tudn.m3u8?auth_key=1757898307-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-1ad2f620af635a320d3aa6a53ca2bccc&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757898304.613369, - "href": "/match/atletico-san-luis-vs-club-tijuana-football-1379551" - }, - "[Pacific Nations Cup] Fiji vs Canada (FSTV)": { - "url": "https://o3.sundaytueday.online/pre41.m3u8?auth_key=1757898308-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-cbcf47b27664b37e50f260996297efdd&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757898304.613369, - "href": "/match/fiji-vs-canada-rugby-51779" - }, - "[Primera A] Deportes Tolima vs Chico (FSTV)": { - "url": "https://o3.sundaytueday.online/dmtn31.m3u8?auth_key=1757901907-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-2b2569587950427b68cc99fb71b80393&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757901904.415953, - "href": "/match/deportes-tolima-vs-chico-football-1392455" - }, - "[NBA W] Las Vegas Aces W vs Seattle Storm W (FSTV)": { - "url": "https://o2.sundaytueday.online/us-espn.m3u8?auth_key=1757901907-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-ee2639411350615d4e284bee2ac8d4ba&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757901904.415953, - "href": "/match/las-vegas-aces-w-vs-seattle-storm-w-basketball-466366" - }, - "[Tennis] WTA 250 Sao Paulo & WTA 500 Guadalajara\t \ud83c\udfbe (FSTV)": { - "url": "https://o4.sundaytueday.online/uk-skysporttenis.m3u8?auth_key=1757905507-34409705c1375ef60a7e6a038961482d-00000000000000000000000000000000-fc94b78d13afaaa9518232bdbf1dc7e8&type=hls&isLive=true", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://fstv.zip", - "timestamp": 1757905505.061788, - "href": "/match/wta-250-sao-paulo-wta-500-guadalajara-atp-2025" - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/M3U8/scrapers/caches/livetvsx.json b/M3U8/scrapers/caches/livetvsx.json index 3406272..9e26dfe 100644 --- a/M3U8/scrapers/caches/livetvsx.json +++ b/M3U8/scrapers/caches/livetvsx.json @@ -1,332 +1 @@ -{ - "[Ice Hockey: Sweden U20 Nationell] HV 71 U20 - Sodertalje U-20 (LTVSX)": { - "url": "https://www.hlsplayer.org/play?url=https%3A%2F%2Flasvideoblobs0prod-standard.b-cdn.net%2Fvods%2Fblobs0%2F68bd29ee5addedaac41c38e0%2Findex.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: Finland Veikkausliiga] Mariehamn - Jaca (LTVSX)": { - "url": "https://mdt1.dbcast.live/sA6WUKyi45hI62fg3BX6zw/1757794171/3230392e362e3137392e313937/ff943/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Tennis: Davis Cup Doubles Qualification] Verbeek / Arends - Zeballos / Molteni (LTVSX)": { - "url": "https://mdt1.dbcast.live/LjKonJf5sww-Al2W0lTw5g/1757794202/3230392e362e3137392e313937/ff973/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: France Ligue 2] Grenoble - Dunkerque (LTVSX)": { - "url": "https://a109.azplay12.me/hls/streama233753/index.m3u8?cst=258a2731a144be938470cbd3969dc1f5", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: France Ligue 2] Annecy - Reims (LTVSX)": { - "url": "https://a110.azplay12.me/hls/streama241983/index.m3u8?cst=9fefb1d6f3d1e9c8369522a57a538105", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: Denmark 1 Division] Kolding - Hvidovre (LTVSX)": { - "url": "https://mdt1.dbcast.live/dRnKt2GJ452XAIcmcCXhFA/1757794322/3230392e362e3137392e313937/ff942/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Tennis: ATP Challenger Szczecin] Geoffrey Blancaneaux - Thiago Tirante (LTVSX)": { - "url": "https://spottatpch.akamaized.net/hls/live/2112713/5645605_888928/master.m3u8?cid=39144&mid=63472501&ecid=7110815&pid=5&dtid=1&sid=138528252871&gc=bgo&gsd=dhg&grm=1&hdnea=exp=1757765617~acl=*/hls/live/2112713*/5645605_888928/*~data=country=US~hmac=98ff3dfff9b1597c2fafc182d9baa9052e0550976badb3f71a973add4efd42c0&content=1985878", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Rugby Union: Women World Cup] New Zealand (W) - South Africa (W) (LTVSX)": { - "url": "https://a108.azplay12.me/hls/streama242470/index.m3u8?cst=05eeb8316fa6fd940f35ff0351458baf", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: Germany 3 Bundesliga] Simulcast (LTVSX)": { - "url": "https://broadcasthub.click/hls/8wKflSlF5IZX/index.m3u8?st=RkQUTrIWgNgJZEk463m4JA&e=1757776389", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Cycling: Mountain Biking] World Championships (LTVSX)": { - "url": "https://beautifulpeople.lovecdn.ru/Eurosport2UK/index.fmp4.m3u8?token=333d966f99394161300c11180e08285f6108885f-189057f5c5b15611802a35108e5b8fb4-1757776127-1757765327", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Tennis: Davis Cup] Filip Jeff Planinsek - Joaquin Aguilar Cardozo (LTVSX)": { - "url": "https://mdt2.dbcast.live/1KG4ZCqY81zb_h-giQ16ew/1757794535/3230392e362e3137392e313937/ff972/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: Austria 2 Liga] Admira - Bregenz (LTVSX)": { - "url": "https://sbqqhg.5606087801.art:8443/hls/1ie3oisvy8bsx.m3u8?s=aKlg6s5V7oTDE7sCa0b3lA&e=1757787353", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757765103.684203 - }, - "[Football: Czech Republic 3 Liga] Hodonin - Hranice (LTVSX)": { - "url": "https://tvcom-cz-fotbal-live.ssl.cdn.cra.cz/tvcom/fotbal-msfl23/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League Two] Tranmere Rovers - Newport County (LTVSX)": { - "url": "https://mdt2.dbcast.live/cV7KpIslDv5lfGQwWXDKIw/1757801306/3230392e362e3137392e313937/ff672/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League Two] Shrewsbury Town - Salford City (LTVSX)": { - "url": "https://mdt2.dbcast.live/Gb78RGfBXB6tk5xlPkxOdQ/1757801322/3230392e362e3137392e313937/ff670/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League Two] Grimsby Town - Cambridge Utd (LTVSX)": { - "url": "https://mdt2.dbcast.live/SyRRzDgn1lLHgvaIeCa3NQ/1757801381/3230392e362e3137392e313937/ff668/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Ice Hockey: Finland Liiga] Kiekko-Espoo - Assat (LTVSX)": { - "url": "https://mdt2.dbcast.live/4xc5Syu3_4DlQ3oMx0OtSg/1757801392/3230392e362e3137392e313937/ff707/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Ice Hockey: Finland Liiga] KooKoo - Saipa (LTVSX)": { - "url": "https://mdt2.dbcast.live/UTdWexBBwtpj_OKnjhgMZg/1757801439/3230392e362e3137392e313937/ff708/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Ice Hockey: Finland Liiga] TPS - Lukko (LTVSX)": { - "url": "https://mdt2.dbcast.live/ZqNdu07r9Aij_ttQfrcyNw/1757801519/3230392e362e3137392e313937/ff710/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Ice Hockey: Finland Mestis] RoKi - Hermes (LTVSX)": { - "url": "https://mdt2.dbcast.live/5Yqv8lVfxmC5f0Wrbumjpw/1757801578/3230392e362e3137392e313937/ff715/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Ice Hockey: Finland Mestis] Jokerit - TuTo (LTVSX)": { - "url": "https://mdt1.dbcast.live/OuW6EdDbmb1o4mDT0gCIYw/1757801610/3230392e362e3137392e313937/ff712/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Egypt Premier League] Ghazl El Mehalla - Al Mokawloon (LTVSX)": { - "url": "https://mdt1.dbcast.live/M0bH7qEXA8wy9H5cHq2GgA/1757801649/3230392e362e3137392e313937/ff645/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Handball: Women Champions League] Schaeffler (W) - Gloria Bistrita (W) (LTVSX)": { - "url": "https://mdt2.dbcast.live/8rrzg1sEiTWQ5uFmPly-Zg/1757801673/3230392e362e3137392e313937/ff720/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Czech Republic 3 Liga] TJ Unie Hlubina - Hlucin (LTVSX)": { - "url": "https://tvcom-cz-fotbal-live.ssl.cdn.cra.cz/tvcom/fotbal-msk203/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Premier League] Fulham - Leeds Utd (LTVSX)": { - "url": "https://a108.azplay12.me/hls/streama242482/index.m3u8?cst=add832aa0d575cc1bbc513f5101b641a", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Premier League] Everton - Aston Villa (LTVSX)": { - "url": "https://sbqqhg.5606087801.art:8443/hls/eqg0c5zxox.m3u8?s=bzXKcms5o93ym7XBYKEPLw&e=1757794551", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Premier League] Crystal Palace - Sunderland (LTVSX)": { - "url": "https://a108.azplay12.me/hls/streama242479/index.m3u8?cst=8a5ae8ca9862d08eecea081760db334f", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Premier League] Bournemouth - Brighton (LTVSX)": { - "url": "https://a109.azplay12.me/hls/streama242483/index.m3u8?cst=1dc35a217ebd792abfbcd6c082c1c826", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Turkey Super League] Samsunspor - Antalyaspor (LTVSX)": { - "url": "https://broadcasthub.click/hls/DcTxPWHOB5aM/index.m3u8?st=QLH5J2QMGgKdyEzHNjINLw&e=1757783922", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Turkey Super League] Fatih Karagumruk - Kasimpasa (LTVSX)": { - "url": "https://broadcasthub.click/hls/SoaJ1GdNv8qL/index.m3u8?st=PVEBbBvwn6IvbJFPsITZkA&e=1757783934", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Finland Veikkausliiga] VPS - KTP (LTVSX)": { - "url": "https://mdt1.dbcast.live/Al7ymLHLqIEwN9oHDhDSlg/1757802028/3230392e362e3137392e313937/ff682/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Championship] Wrexham - Queens Park Rangers (LTVSX)": { - "url": "https://mdt1.dbcast.live/Lx2eE6ZLxUJNOuIpNhYUEw/1757802059/3230392e362e3137392e313937/ff654/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Belgium Pro League] Zulte Waregem - Oud-Heverlee (LTVSX)": { - "url": "https://broadcasthub.click/hls/bV0f1SLNSVTD/index.m3u8?st=VbiHcX3BlIPZIJrmRmagWg&e=1757784071", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England Championship] Watford - Blackburn (LTVSX)": { - "url": "https://mdt1.dbcast.live/gbfW9nX9sOf34-DAkkHO_A/1757802102/3230392e362e3137392e313937/ff652/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Scotland Premiership] Rangers - Hearts (LTVSX)": { - "url": "https://mdt1.dbcast.live/ykwfXFyRg2zUk9ByTfxCig/1757802218/3230392e362e3137392e313937/ff702/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Scotland Premiership] Dundee - Motherwell (LTVSX)": { - "url": "https://mdt2.dbcast.live/P00BENZWz1xRM86Yp1qWCg/1757802298/3230392e362e3137392e313937/ff694/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Scotland Championship] Ayr United - Ross County (LTVSX)": { - "url": "https://mdt1.dbcast.live/U8bjoe0if6G-myj0QEFOrQ/1757802371/3230392e362e3137392e313937/ff693/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Czech Republic 4 Liga] Humpolec - Pelhrimov (LTVSX)": { - "url": "https://tvcom-cz-fotbal-live.ssl.cdn.cra.cz/tvcom/fotbal-msfl230/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Czech Republic 3 Liga] Vitkovice - SFK Vrchovina (LTVSX)": { - "url": "https://tvcom-cz-fotbal-live.ssl.cdn.cra.cz/tvcom/fotbal-msfl46/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Handball: Women MOL Liga] Hodonin (W) - Dunajska Streda (W) (LTVSX)": { - "url": "https://tvcom-cz-hazena-live.ssl.cdn.cra.cz/tipsport/ff1/playlist.m3u8?DVR", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Handball: Denmark Handball League] Aalborg - GOG (LTVSX)": { - "url": "https://mdt2.dbcast.live/GevW0rZJHi9qnGNCabU2UQ/1757802632/3230392e362e3137392e313937/ff722/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Norway 1 Divisjon] Start - Kongsvinger (LTVSX)": { - "url": "https://mdt2.dbcast.live/_pdziBt7iTZfqVEBYRu3Cw/1757802712/3230392e362e3137392e313937/ff690/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League One] Stockport - Cardiff City (LTVSX)": { - "url": "https://mdt1.dbcast.live/AxJGB1hWVNNWhhaYSSPXjA/1757802723/3230392e362e3137392e313937/ff663/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Norway 1 Divisjon] Sogndal - Lillestroem (LTVSX)": { - "url": "https://mdt1.dbcast.live/Fu7nXSP4SuJNrjU5XFqNGw/1757802735/3230392e362e3137392e313937/ff689/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Norway 1 Divisjon] Raufoss - Aalesund (LTVSX)": { - "url": "https://mdt2.dbcast.live/XRooPZ0PURIZQGAxy5q1qQ/1757802766/3230392e362e3137392e313937/ff688/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League One] Mansfield Town - Stevenage (LTVSX)": { - "url": "https://mdt1.dbcast.live/P_JelkWHmFoh4hkJ3px0Tg/1757802777/3230392e362e3137392e313937/ff661/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Norway 1 Divisjon] Odd - Hoedd (LTVSX)": { - "url": "https://mdt2.dbcast.live/TUkgc1nF8CSOC3NXjXQ-YA/1757802830/3230392e362e3137392e313937/ff686/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League One] Leyton Orient - Bolton Wanderers (LTVSX)": { - "url": "https://mdt2.dbcast.live/o_j-JSPSb-e81ToiZ6oZCQ/1757802841/3230392e362e3137392e313937/ff659/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: England League One] Exeter City - Port Vale (LTVSX)": { - "url": "https://mdt1.dbcast.live/ZD6CBOBXueaKt9qNTRsw4Q/1757802872/3230392e362e3137392e313937/ff658/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Netherlands Eerste Divisie] VVV-Venlo - Helmond Sport (LTVSX)": { - "url": "https://broadcasthub.click/hls/DzazxOvS3QE1/index.m3u8?st=4leijuWG64KNBM4hvI1pmw&e=1757785108", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Portugal Primeira Liga] Estoril Praia - AVS (LTVSX)": { - "url": "https://a109.azplay12.me/hls/streama242478/index.m3u8?cst=8564d44e39aa57acccd1449aff06ea99", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Football: Portugal Primeira Liga] Moreirense - Rio Ave (LTVSX)": { - "url": "https://a108.azplay12.me/hls/streama241990/index.m3u8?cst=894aa6ac3d4b19d9b22b70ced17877ce", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Rugby Union: France Top 14] Toulouse - Perpignan (LTVSX)": { - "url": "https://mdt1.dbcast.live/4UQ3TS819YmE8GJGrSf-CQ/1757803383/3230392e362e3137392e313937/ff737/playlist.m3u8", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Rugby Union: France Top 14] La Rochelle - Clermont (LTVSX)": { - "url": "https://broadcasthub.click/hls/4VrctMT0fxYg/index.m3u8?st=z-IlWJPADAabEt1M7zgIxA&e=1757785397", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - }, - "[Rugby Union: France Top 14] Aviron Bayonnais - Montpellier (LTVSX)": { - "url": "https://broadcasthub.click/hls/jzlrWk8wDLpk/index.m3u8?st=00gPFleot9Phvp_lpqN_Uw&e=1757785431", - "logo": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png", - "base": "https://livetv.sx/enx/", - "timestamp": 1757772303.447304 - } -} \ No newline at end of file +{} \ No newline at end of file diff --git a/M3U8/scrapers/fstv.py b/M3U8/scrapers/fstv.py index 3374034..b699a49 100644 --- a/M3U8/scrapers/fstv.py +++ b/M3U8/scrapers/fstv.py @@ -1,11 +1,18 @@ -import json from pathlib import Path from urllib.parse import unquote, urljoin import httpx from selectolax.parser import HTMLParser -from .utils import LOGOS, get_base, get_logger, load_cache, now, safe_process_event +from .utils import ( + LOGOS, + get_base, + get_logger, + load_cache, + now, + safe_process_event, + write_cache, +) log = get_logger(__name__) @@ -122,6 +129,7 @@ async def main(client: httpx.AsyncClient) -> None: if not (base_url := await get_base(client, MIRRORS)): log.warning("No working FSTV mirrors") + write_cache(CACHE_FILE, cached_urls) return events = await get_events( @@ -165,4 +173,4 @@ async def main(client: httpx.AsyncClient) -> None: else: log.info("No new events found") - CACHE_FILE.write_text(json.dumps(cached_urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, cached_urls) diff --git a/M3U8/scrapers/livetvsx.py b/M3U8/scrapers/livetvsx.py index bb1302a..53eeef4 100644 --- a/M3U8/scrapers/livetvsx.py +++ b/M3U8/scrapers/livetvsx.py @@ -1,6 +1,5 @@ import asyncio import io -import json import ssl import xml.etree.ElementTree as ET from datetime import datetime, timedelta @@ -19,6 +18,7 @@ from .utils import ( load_cache, now, safe_process_event, + write_cache, ) log = get_logger(__name__) @@ -82,7 +82,11 @@ async def fetch_xml_stream(url: str, ssl_ctx: ssl.SSLContext) -> io.BytesIO | No buffer = io.BytesIO() try: - async with httpx.AsyncClient(timeout=10, verify=ssl_ctx) as client: + async with httpx.AsyncClient( + timeout=10, + verify=ssl_ctx, + follow_redirects=True, + ) as client: async with client.stream("GET", url) as r: r.raise_for_status() @@ -322,4 +326,4 @@ async def main(client: httpx.AsyncClient) -> None: else: log.info("No new events found") - CACHE_FILE.write_text(json.dumps(cached_urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, cached_urls) diff --git a/M3U8/scrapers/ppv.py b/M3U8/scrapers/ppv.py index 1a9e3be..66199cc 100644 --- a/M3U8/scrapers/ppv.py +++ b/M3U8/scrapers/ppv.py @@ -21,6 +21,7 @@ from .utils import ( load_cache, now, safe_process_event, + write_cache, ) log = get_logger(__name__) @@ -176,6 +177,7 @@ async def main(client: httpx.AsyncClient) -> None: if not (base_url := await get_base(client, MIRRORS)): log.warning("No working PPV mirrors") + write_cache(CACHE_FILE, cached_urls) return log.info(f'Scraping from "{base_url}"') @@ -212,7 +214,7 @@ async def main(client: httpx.AsyncClient) -> None: else: log.info("No new events found") - CACHE_FILE.write_text(json.dumps(cached_urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, cached_urls) # works if no cloudflare bot detection diff --git a/M3U8/scrapers/streambtw.py b/M3U8/scrapers/streambtw.py index cd3b75a..33367c5 100644 --- a/M3U8/scrapers/streambtw.py +++ b/M3U8/scrapers/streambtw.py @@ -1,4 +1,3 @@ -import json import re from pathlib import Path from urllib.parse import urljoin @@ -6,7 +5,7 @@ from urllib.parse import urljoin import httpx from selectolax.parser import HTMLParser -from .utils import get_logger, load_cache, now, safe_process_event +from .utils import get_logger, load_cache, now, safe_process_event, write_cache log = get_logger(__name__) @@ -111,4 +110,4 @@ async def main(client: httpx.AsyncClient) -> None: log.info(f"Collected {len(urls)} event(s)") - CACHE_FILE.write_text(json.dumps(urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, urls) diff --git a/M3U8/scrapers/streameast.py b/M3U8/scrapers/streameast.py index a2474cd..16031df 100644 --- a/M3U8/scrapers/streameast.py +++ b/M3U8/scrapers/streameast.py @@ -1,5 +1,4 @@ import asyncio -import json from datetime import datetime, timedelta from functools import partial from pathlib import Path @@ -19,6 +18,7 @@ from .utils import ( load_cache, now, safe_process_event, + write_cache, ) log = get_logger(__name__) @@ -162,6 +162,7 @@ async def main(client: httpx.AsyncClient) -> None: if not (base_url := await get_base(client, MIRRORS)): log.warning("No working StreamEast mirrors") + write_cache(CACHE_FILE, cached_urls) return log.info(f'Scraping from "{base_url}"') @@ -198,4 +199,4 @@ async def main(client: httpx.AsyncClient) -> None: else: log.info("No new events found") - CACHE_FILE.write_text(json.dumps(cached_urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, cached_urls) diff --git a/M3U8/scrapers/tvpass.py b/M3U8/scrapers/tvpass.py index 87f5bd5..f9bc2e1 100644 --- a/M3U8/scrapers/tvpass.py +++ b/M3U8/scrapers/tvpass.py @@ -1,10 +1,9 @@ -import json import re from pathlib import Path import httpx -from .utils import LOGOS, get_logger, load_cache, now +from .utils import LOGOS, get_logger, load_cache, now, write_cache log = get_logger(__name__) @@ -62,6 +61,6 @@ async def main(client: httpx.AsyncClient) -> None: urls[key] = entry - CACHE_FILE.write_text(json.dumps(urls, indent=2), encoding="utf-8") + write_cache(CACHE_FILE, urls) log.info(f"Cached {len(urls)} event(s)") diff --git a/M3U8/scrapers/utils/__init__.py b/M3U8/scrapers/utils/__init__.py index 855bdb0..e8308dc 100644 --- a/M3U8/scrapers/utils/__init__.py +++ b/M3U8/scrapers/utils/__init__.py @@ -9,6 +9,7 @@ from .config import ( load_cache, now, safe_process_event, + write_cache, ) __all__ = [ @@ -22,4 +23,5 @@ __all__ = [ "load_cache", "now", "safe_process_event", + "write_cache", ] diff --git a/M3U8/scrapers/utils/config.py b/M3U8/scrapers/utils/config.py index 76ceb1c..abae9d5 100644 --- a/M3U8/scrapers/utils/config.py +++ b/M3U8/scrapers/utils/config.py @@ -130,6 +130,10 @@ def load_cache( return data if now.timestamp() - ts < exp else {} +def write_cache(file: Path, data: dict) -> None: + file.write_text(json.dumps(data, indent=2), encoding="utf-8") + + async def safe_process_event( fn: Callable, url_num: int,