spaam / svtplay-dl

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

DR.DK subtitles , what if more then one ?? #997

Open rensgr opened 5 years ago

rensgr commented 5 years ago

Hello, dr.dk has two sets of subtitles: one full text, what ever language is spoken. ( for folks with hearing problems, I guess ) and another set, where only foreign (non danish) language is subtitled. problem is that it always picks the small one, non danish subtitles only. I need the full subtitles. my danish isnt good enough :-) by the way, until a year ago it didnt have this problem. always took the full text one.

currently, via the firefox debug console I grab the vtt file with the full set, and fix it up to become a srt file. however, thats tedious, and (I think ? ) not necessary.

--all-subtitles option does not work:


svtplay-dl -P hls -S --all-subtitles https://www.dr.dk/tv/se/herrens-veje-tv/herrens-veje-ii/herrens-veje-ii-4-10 INFO: Starting new HTTPS connection (1): www.dr.dk INFO: Starting new HTTP connection (1): drod07l-vh.akamaihd.net INFO: Starting new HTTPS connection (1): drod07l-vh.akamaihd.net INFO: Starting new HTTPS connection (1): www.dr.dk INFO: Outfile: herrens.veje.ii.410.drtv-dr.srt Traceback (most recent call last): File "/usr/bin/svtplay-dl", line 7, in svtplay_dl.main() File "/usr/lib/python3.4/site-packages/svtplay_dl/init.py", line 63, in main get_media(urls[0], config, version) File "/usr/lib/python3.4/site-packages/svtplay_dl/utils/getmedia.py", line 56, in get_media get_one_media(stream) File "/usr/lib/python3.4/site-packages/svtplay_dl/utils/getmedia.py", line 157, in get_one_media options_subs_dl(subfixes) File "/usr/lib/python3.4/site-packages/svtplay_dl/utils/getmedia.py", line 145, in options_subs_dl sub.download() File "/usr/lib/python3.4/site-packages/svtplay_dl/subtitle/init.py", line 73, in download self.save_file(data, "srt") File "/usr/lib/python3.4/site-packages/svtplay_dl/subtitle/init.py", line 79, in save_file file_d = output(self.output, self.config, subtype, mode="wt") File "/usr/lib/python3.4/site-packages/svtplay_dl/utils/output.py", line 183, in output if findexpisode(output, os.path.dirname(os.path.realpath(name)), os.path.basename(name)): File "/usr/lib/python3.4/site-packages/svtplay_dl/utils/output.py", line 209, in findexpisode name.find(output["id"]) > 0 and lsname.find(output["id"]) > 0 and \ TypeError: Can't convert 'NoneType' object to str implicitly

spaam commented 5 years ago

🤔 i guess i can fix so when there are more than one, it will choose the one that is not hearing as default. if you want all subs it will download both.

rensgr commented 5 years ago

Johan Andersson schreef op 2018-11-12 18:41:

🤔 i guess i can fix so when there are more than one, it will choose the one that is not hearing as default. if you want all subs it will download both.

-- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

Links:

[1] https://github.com/spaam/svtplay-dl/issues/997#issuecomment-437968581 [2] https://github.com/notifications/unsubscribe-auth/AEAIYU1JKVmgji-kqKQLnfl4VNCo42Jqks5uubLBgaJpZM4YPDqh

Hi Johan,

det vil vara jättebra !

tack :-)

mvh, Rens

(no, I am not swedish, but i know a little :-) )

mastrup commented 1 year ago

This still seems to be an issue. For example the episode:https://www.dr.dk/drtv/se/forsvundne-arvinger_-den-blinde-passager_377528 the following .m3u8 is returned:

#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_low",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="1",URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_audio_64kbps.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_medium",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2",URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_audio_128kbps.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_high",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2",URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_audio_192kbps.m3u8"

#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Fremmedsprogstekster",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="da",URI="../subtitles/Foreign-21017472-a28937b1-dddf-4bc1-b688-e18d639aaed6/playlist.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Dansk",DEFAULT=NO,AUTOSELECT=NO,FORCED=NO,LANGUAGE="da",URI="../subtitles/Foreign_HardOfHearing-21017472-a28937b1-dddf-4bc1-b688-e18d639aaed6/playlist.m3u8"

#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=17852,BANDWIDTH=36847,VIDEO-RANGE=SDR,CODECS="avc1.42C01E",RESOLUTION=640x360,URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_500_iframe.m3u8"
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=41688,BANDWIDTH=88332,VIDEO-RANGE=SDR,CODECS="avc1.64001F",RESOLUTION=852x480,URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_1100_iframe.m3u8"
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=60761,BANDWIDTH=145035,VIDEO-RANGE=SDR,CODECS="avc1.640028",RESOLUTION=960x540,URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_2000_iframe.m3u8"
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=96468,BANDWIDTH=229223,VIDEO-RANGE=SDR,CODECS="avc1.640029",RESOLUTION=1280x720,URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_3500_iframe.m3u8"
#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=143848,BANDWIDTH=409656,VIDEO-RANGE=SDR,CODECS="avc1.640029",RESOLUTION=1920x1080,URI="Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_5500_iframe.m3u8"

#EXT-X-STREAM-INF:BANDWIDTH=650598,AVERAGE-BANDWIDTH=564456,FRAME-RATE=25.000,CODECS="avc1.42C01E,mp4a.40.2",RESOLUTION=640x360,VIDEO-RANGE="SDR",AUDIO="audio_low",SUBTITLES="subs"
Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_500.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1418617,AVERAGE-BANDWIDTH=1224943,FRAME-RATE=25.000,CODECS="avc1.64001F,mp4a.40.2",RESOLUTION=852x480,VIDEO-RANGE="SDR",AUDIO="audio_medium",SUBTITLES="subs"
Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_1100.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2490254,AVERAGE-BANDWIDTH=2185606,FRAME-RATE=25.000,CODECS="avc1.640028,mp4a.40.2",RESOLUTION=960x540,VIDEO-RANGE="SDR",AUDIO="audio_high",SUBTITLES="subs"
Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_2000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=4216183,AVERAGE-BANDWIDTH=3677217,FRAME-RATE=25.000,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=1280x720,VIDEO-RANGE="SDR",AUDIO="audio_high",SUBTITLES="subs"
Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_3500.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=6529539,AVERAGE-BANDWIDTH=5663611,FRAME-RATE=25.000,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=1920x1080,VIDEO-RANGE="SDR",AUDIO="audio_high",SUBTITLES="subs"
Forsvundne-arvi_DRTV2022Jan_FullHD_16x9_VideoMain_video_5500.m3u8

The two subtitles both have the language code da and the first named Fremmedsprogstekster contains what I would call forced subtitles even though it isn't marked as such in the .m3u8. The other one named Dansk contains the full texted version of the episode.

When using the command the following command, only the first subtitle is downloaded (the one named Fremmedsprogstekster):

svtplay-dl https://www.dr.dk/drtv/se/forsvundne-arvinger_-den-blinde-passager_377528 --all-subtitles

Edit This issue might also link to #699 and #741