spaam / svtplay-dl

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

--merge-subtitle on ts sources fails #1293

Open StaffanBetner opened 3 years ago

StaffanBetner commented 3 years ago

svtplay-dl versions:

svtplay-dl 2.8

Operating system and Python version:

Windows 10, Python 3.7.3.

What is the issue:

This is a problem with e.g. TV4 Play. When I use the --merge-subtitle flag the script fails. The ts file that is created does contain a subtitle, so I guess that the error is in the remuxing to mp4. Maybe the merging of the subtitle should be postponed until after the remuxing.

svtplay-dl.exe --merge-subtitle https://www.tv4play.se/program/112-poliser/1461344
INFO: Outfile: 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.srt
INFO: Selected to download hls, bitrate: 1721 format: h264
INFO: Outfile: 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.audio.ts
[657/657][================================================================================] ETA: 0:00:00
INFO: Outfile: 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.ts
[657/657][================================================================================] ETA: 0:00:00
INFO: Merge audio, video and subtitle into 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.ts
INFO: Determining the language of the subtitle.
INFO: Language code: swe
INFO: Merging done, removing old files.
INFO: Muxing 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.ts and merging its subtitle into 112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.mp4
INFO: Determining the language of the subtitle.
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.8.6\x64\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
  File "C:\hostedtoolcache\windows\Python\3.8.6\x64\lib\site-packages\cx_Freeze\initscripts\Console.py", line 33, in run
  File "bin/svtplay-dl", line 7, in <module>
  File "D:\a\svtplay-dl\svtplay-dl\lib/svtplay_dl\__init__.py", line 66, 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 230, in get_one_media
  File "D:\a\svtplay-dl\svtplay-dl\lib/svtplay_dl\postprocess\__init__.py", line 61, in remux
  File "D:\a\svtplay-dl\svtplay-dl\lib/svtplay_dl\postprocess\__init__.py", line 254, in _sublanguage
  File "D:\a\svtplay-dl\svtplay-dl\lib/svtplay_dl\postprocess\__init__.py", line 212, in query
  File "D:\a\svtplay-dl\svtplay-dl\lib/svtplay_dl\postprocess\__init__.py", line 206, in parse
FileNotFoundError: [Errno 2] No such file or directory: '112-poliser.s01e01.112-poliser.del.1-1461344-tv4play.srt'
spaam commented 3 years ago

🤔 interesting. i can reproduce this which is nice, it will be easier to fix it

spaam commented 3 years ago

workaround until the fix you need to specify -S or --subtitle

yiveynod commented 3 years ago

Yes, I get this exact same issue. Only difference I run svtplay-dl on macOS with Homebrew. Even though I get the error it still seems like it's all (audio, video, srt) merged into the .ts file. So I run ffmpeg to remux into .mkv as a workaround.