spaam / svtplay-dl

Small command-line program to download videos from some streaming sites.
https://svtplay-dl.se
MIT License
716 stars 119 forks source link

TV4play: -A argument does no longer work #1646

Open bartdedecker opened 1 week ago

bartdedecker commented 1 week ago

svtplay-dl versions:

Run svtplay-dl --version svtplay-dl 4.97.1

Operating system and Python version:

Windows 10 python 3.8.0

What is the issue:

TV4play has changed the json structure. Key "data" no longer exists. svtplay-dl -A --get-only-episode-url URL cannot find the urls

Always include the URL you want to download and all switches you are using. You should also add --verbose because it makes it much easier for use to find the issue :)

svtplay-dl --verbose -A --get-only-episode-url https://www.tv4play.se/program/93d53c04f07d1b98c8e5/hela-sverige-bakar DEBUG [1728205880.8231518] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py/get_media: version: 4.97.1 DEBUG [1728205880.8301475] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\service__init.py/init: service: tv4play DEBUG [1728205880.8301475] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://avod-auth-alb.a2d.tv/oauth/refresh' DEBUG [1728205880.8321464] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): avod-auth-alb.a2d.tv:443 DEBUG [1728205881.1169822] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://avod-auth-alb.a2d.tv:443 "POST /oauth/refresh HTTP/11" 200 624 DEBUG [1728205881.1189816] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://www.tv4play.se/program/93d53c04f07d1b98c8e5/hela-sverige-bakar' DEBUG [1728205881.1219792] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): www.tv4play.se:443 DEBUG [1728205881.6146958] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://www.tv4play.se:443 "GET /program/93d53c04f07d1b98c8e5/hela-sverige-bakar HTTP/11" 200 None DEBUG [1728205881.7086415] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://client-gateway.tv4.a2d.tv/graphql' DEBUG [1728205881.711639] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): client-gateway.tv4.a2d.tv:443 DEBUG [1728205882.0114667] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://client-gateway.tv4.a2d.tv:443 "POST /graphql HTTP/11" 403 70 Traceback (most recent call last): File "C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\cx_Freeze\initscripts\startup.py", line 141, in run File "C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\cx_Freeze\initscripts\console.py", line 25, in run File "bin\svtplay-dl", line 7, in File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\init__.py", line 69, in main File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py", line 61, in get_media File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py", line 79, in get_all_episodes File "C:\Program Files\Svtplay-dl\lib\svtplay_dl\service\tv4play.py", line 157, in find_all_episodes for season in jansson["data"]["media"]["allSeasonLinks"]: KeyError: 'data'

bartdedecker commented 1 week ago

Thanks for the prompt update of the code in service/tv4play.py; the client version number needed to be changed to a higher version number (5.2.0) for the graphql server since the old one (4.0.0) is no longer supported.

spaam commented 1 week ago

yeah there is a snapshot with the fix. but it should be in a official version in an hour or two.

MacValley commented 1 week ago

I guess the Docker container is not updated yet? When I run: docker run -it --rm -u $(id -u):$(id -g) -v "$(pwd):/data" spaam/svtplay-dl --verbose -A -S --token "My.Token.Is.Correctly.Inserted.Here..." https://www.tv4play.se/program/476364080b7f3e3922ca/badhotellet I get the following: DEBUG [1728320678.714152] /usr/lib/python3.12/site-packages/svtplay_dl/utils/getmedia.py/get_media: version: 4.97.1 DEBUG [1728320678.7148707] /usr/lib/python3.12/site-packages/svtplay_dl/service/init.py/init: service: tv4play DEBUG [1728320678.7151005] /usr/lib/python3.12/site-packages/svtplay_dl/utils/http.py/request: HTTP getting 'https://avod-auth-alb.a2d.tv/oauth/refresh' DEBUG [1728320678.716118] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): avod-auth-alb.a2d.tv:443 DEBUG [1728320678.8744416] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_make_request: https://avod-auth-alb.a2d.tv:443 "POST /oauth/refresh HTTP/11" 200 623 DEBUG [1728320678.8750436] /usr/lib/python3.12/site-packages/svtplay_dl/utils/http.py/request: HTTP getting 'https://www.tv4play.se/program/476364080b7f3e3922ca/badhotellet' DEBUG [1728320678.8755856] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): www.tv4play.se:443 DEBUG [1728320678.955211] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_make_request: https://www.tv4play.se:443 "GET /program/476364080b7f3e3922ca/badhotellet HTTP/11" 200 None DEBUG [1728320678.9676654] /usr/lib/python3.12/site-packages/svtplay_dl/utils/http.py/request: HTTP getting 'https://client-gateway.tv4.a2d.tv/graphql' DEBUG [1728320678.9684474] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): client-gateway.tv4.a2d.tv:443 DEBUG [1728320679.1412961] /usr/lib/python3.12/site-packages/urllib3/connectionpool.py/_make_request: https://client-gateway.tv4.a2d.tv:443 "POST /graphql HTTP/11" 403 70 Traceback (most recent call last): File "/usr/bin/svtplay-dl", line 8, in sys.exit(main()) ^^^^^^ File "/usr/lib/python3.12/site-packages/svtplay_dl/init.py", line 69, in main get_media(urls[0], config, version) File "/usr/lib/python3.12/site-packages/svtplay_dl/utils/getmedia.py", line 61, in get_media get_all_episodes(stream, url, options) File "/usr/lib/python3.12/site-packages/svtplay_dl/utils/getmedia.py", line 79, in get_all_episodes episodes = stream.find_all_episodes(stream.config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/svtplay_dl/service/tv4play.py", line 143, in find_all_episodes for season in jansson["data"]["media"]["allSeasonLinks"]:


KeyError: 'data'

Any chance of a fix?
sebbe34-svt commented 3 days ago

great that there is a fix but will there a new version to download any time soon? the issue says -A argument does not work, that means no pages with series work, since -A is mandatory. :(