spaam/svtplay-dl

svtplay crashes on a particular download

Closed this issue · 10 comments

svtplay-dl versions:

svtplay-dl 4.28.1

Operating system and Python version:

Linux Ubuntu kernel 6.2.0-34-generic
python --version
Python 3.10.12

What is the issue:

svtplay-dl -SMA https://www.svtplay.se/video/ep3Y76w/omen

This results in

INFO: Episode 1 of 1
INFO: Url: http://www.svtplay.se/video/ep3Y76w/omen
INFO: Outfile: omen-8e46f1a-svtplay.ts
INFO: Selected to download hls, bitrate: 3377 format: h264
[1735/1735][====================================================================================================================================================================] ETA: 0:00:00
[1735/1735][====================================================================================================================================================================] ETA: 0:00:00
INFO: Merge audio, video and subtitle into omen-8e46f1a-svtplay.mp4
INFO: Determining the language of the subtitle(s).
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/bin/svtplay-dl/main.py", line 15, in
File "/usr/local/bin/svtplay-dl/svtplay_dl/init.py", line 69, in main
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 61, in get_media
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 93, in get_all_episodes
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 222, in get_one_media
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 90, in merge
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 222, in _sublanguage
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 186, in query
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 182, in parse
FileNotFoundError: [Errno 2] No such file or directory: 'omen-8e46f1a-svtplay.srt'

I can't paste the result with --verbose since it will be many MB of text data...

The resulting files are:
162190896 bytes: omen-8e46f1a-svtplay.audio.ts
2650077744 bytes: omen-8e46f1a-svtplay.ts

Ok, here are the last lines of the --verbose output

[1735/1735][====================================================================================================================================================================] ETA: 0:00:00DEBUG [1700603673.1107893] /usr/local/bin/svtplay-dl/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-video-avc-1920x1080p25-3089/hls-video-avc-1920x1080p25-3089-1735.ts?aka_me_session_id=AAAAAAAAAACtd15lAAAAACOdOUIH2GSG4OhCDWlPGG8CusKO7HcyWf+WiYNMdURWwf6mgo2fxe50s2OBehYbrn432K6mrH3g&aka_msn=1734&aka_hls_version=4&aka_media_format_type=hls'
DEBUG [1700603673.1281836] /usr/lib/python3/dist-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-video-avc-1920x1080p25-3089/hls-video-avc-1920x1080p25-3089-1735.ts?aka_me_session_id=AAAAAAAAAACtd15lAAAAACOdOUIH2GSG4OhCDWlPGG8CusKO7HcyWf+WiYNMdURWwf6mgo2fxe50s2OBehYbrn432K6mrH3g&aka_msn=1734&aka_hls_version=4&aka_media_format_type=hls HTTP/1.1" 200 62240

INFO [1700603673.1979187] /usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py/merge: Merge audio, video and subtitle into omen-8e46f1a-svtplay.mp4
INFO [1700603673.1980462] /usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py/_sublanguage: Determining the language of the subtitle(s).
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/bin/svtplay-dl/main.py", line 15, in
File "/usr/local/bin/svtplay-dl/svtplay_dl/init.py", line 69, in main
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 61, in get_media
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 93, in get_all_episodes
File "/usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py", line 222, in get_one_media
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 90, in merge
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 222, in _sublanguage
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 186, in query
File "/usr/local/bin/svtplay-dl/svtplay_dl/postprocess/init.py", line 182, in parse
FileNotFoundError: [Errno 2] No such file or directory: 'omen-8e46f1a-svtplay.srt'

That must be easy to fix by excluding -SM 😊

But i agree that something is wrong. If no subtitle is present -M shouldn't assume there is an srt file to merge.

Interesting ... hmmm ...

Using:

dennis@gentoo ~ $ svtplay-dl --version
/usr/bin/svtplay-dl:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('svtplay-dl==4.28.1', 'svtplay-dl')
svtplay-dl 4.28.1
dennis@gentoo ~ $ python --version
Python 3.11.5
dennis@gentoo ~ $ uname -a
Linux gentoo 6.6.2-gentoo #1 SMP PREEMPT_DYNAMIC Mon Nov 20 16:53:44 CET 2023 x86_64 Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz GenuineIntel GNU/Linux
dennis@gentoo ~ $ 

I get a completely different error ...

dennis@gentoo ~ $ svtplay-dl -SMA https://www.svtplay.se/video/ep3Y76w/omen -v
/usr/bin/svtplay-dl:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('svtplay-dl==4.28.1', 'svtplay-dl')
DEBUG [1700667167.833054] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/getmedia.py/get_media: version: 4.28.1
DEBUG [1700667167.8376162] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/service/__init__.py/__init__: service: svtplay
DEBUG [1700667167.838852] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://www.svtplay.se/video/ep3Y76w/omen'
DEBUG [1700667167.842464] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): www.svtplay.se:443
DEBUG [1700667168.1662748] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://www.svtplay.se:443 "GET /video/ep3Y76w/omen HTTP/1.1" 200 29417
DEBUG [1700667168.2026327] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/service/__init__.py/__init__: service: svtplay
INFO [1700667168.202813] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/getmedia.py/get_all_episodes: Episode 1 of 1
INFO [1700667168.2029064] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/getmedia.py/get_all_episodes: Url: http://www.svtplay.se/video/ep3Y76w/omen
DEBUG [1700667168.2030067] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'http://www.svtplay.se/video/ep3Y76w/omen'
DEBUG [1700667168.2049983] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTP connection (1): www.svtplay.se:80
DEBUG [1700667168.418042] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: http://www.svtplay.se:80 "GET /video/ep3Y76w/omen HTTP/1.1" 307 0
DEBUG [1700667168.4209127] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): www.svtplay.se:443
DEBUG [1700667168.7147272] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://www.svtplay.se:443 "GET /video/ep3Y76w/omen HTTP/1.1" 200 29417
DEBUG [1700667168.747488] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://api.svt.se/video/Kq13vQL'
DEBUG [1700667168.7529595] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): api.svt.se:443
DEBUG [1700667169.2993178] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://api.svt.se:443 "GET /video/Kq13vQL HTTP/1.1" 200 950
DEBUG [1700667169.3026748] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/text/text-open.vtt'
DEBUG [1700667169.3104815] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): svt-vod-secure-2a.akamaized.net:443
DEBUG [1700667169.5375628] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/text/text-open.vtt HTTP/1.1" 403 410
DEBUG [1700667169.5396292] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-avc.m3u8'
DEBUG [1700667169.544879] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): svt-vod-secure-2a.akamaized.net:443
DEBUG [1700667169.7764719] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-avc.m3u8 HTTP/1.1" 403 176
DEBUG [1700667169.7770674] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-lb-full.m3u8'
DEBUG [1700667169.8097703] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-lb-full.m3u8 HTTP/1.1" 403 176
DEBUG [1700667169.8102934] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-avc.m3u8'
DEBUG [1700667169.8437402] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-ts-avc.m3u8 HTTP/1.1" 403 176
DEBUG [1700667169.84434] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/http.py/request: HTTP getting 'https://svt-vod-secure-2a.akamaized.net/d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-cmaf-lb-full.m3u8'
DEBUG [1700667169.878973] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://svt-vod-secure-2a.akamaized.net:443 "GET /d0/secure/20231018/9eef1938-7dae-4992-a5f4-517e81c4abe4/hls-cmaf-lb-full.m3u8 HTTP/1.1" 403 176
ERROR [1700667169.8797104] /usr/lib/python3.11/site-packages/svtplay_dl-4.28.1-py3.11.egg/svtplay_dl/utils/getmedia.py/get_one_media: No videos found.

Watching the movie at https://www.svtplay.se/video/ep3Y76w/omen using Firefox I have swedish subtitles available but when using svtplay-dl -S https://www.svtplay.se/video/ep3Y76w/omen the download don't include an .SRT-file.
svtplay-dl 4.28.1 fails to retrieve subtitles with this specific link.

Suspect this is the same as #1571

When playing the mp4 file (downloaded without -SM) I also find that there is something wrong with the audo. After about 5 minutes it's quiet, no more sound.

yeah. its a known issue. maybe one day someone will make a pull request to fix the issue.

yeah. its a known issue. maybe one day someone will make a pull request to fix the issue.

What is the issue? "SOME downloads looses audio after a while, but many works" Sounds a bit random. (Sorry for beeing off-topic)

the technical thing about the issue is that for some reason i do something wrong with encrypted fragmented mp4 (fmp4) files. it works fine with the non-encrypted ones :)

this should work better now in 4.69 🤔 if not. open a new issue :)