diff options
| author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-01-25 18:56:04 +0100 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-01-25 18:56:04 +0100 | 
| commit | 6d2749aac407df1e039f5b61a294991c1e810cff (patch) | |
| tree | bf73bd4e4dd9a0933f25bef17b99ae54b5a56a02 | |
| parent | 3dee7826e7133fb4a73aa0aabaee78499e49264f (diff) | |
[drtv] Prefer the version without spoken subtitles (fixes #4779)
For example for http://www.dr.dk/tv/se/moderne-klassikere/moderne-klassikere-one-republic-apologize#!/, there's a version where everytime someone speaks in English a computer voice translates it.
| -rw-r--r-- | youtube_dl/extractor/drtv.py | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dl/extractor/drtv.py b/youtube_dl/extractor/drtv.py index c44adb109..510ef04b0 100644 --- a/youtube_dl/extractor/drtv.py +++ b/youtube_dl/extractor/drtv.py @@ -48,14 +48,20 @@ class DRTVIE(SubtitlesInfoExtractor):              elif asset['Kind'] == 'VideoResource':                  duration = asset['DurationInMilliseconds'] / 1000.0                  restricted_to_denmark = asset['RestrictedToDenmark'] +                spoken_subtitles = asset['Target'] == 'SpokenSubtitles'                  for link in asset['Links']:                      target = link['Target']                      uri = link['Uri'] +                    format_id = target +                    preference = -1 if target == 'HDS' else -2 +                    if spoken_subtitles: +                        preference -= 2 +                        format_id += '-spoken-subtitles'                      formats.append({                          'url': uri + '?hdcore=3.3.0&plugin=aasp-3.3.0.99.43' if target == 'HDS' else uri, -                        'format_id': target, +                        'format_id': format_id,                          'ext': link['FileFormat'], -                        'preference': -1 if target == 'HDS' else -2, +                        'preference': preference,                      })                  subtitles_list = asset.get('SubtitlesList')                  if isinstance(subtitles_list, list):  | 
