Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drtv.py: Add VisuallyImpaired to non-preferred asset types #19079

Closed
pank opened this issue Jan 30, 2019 · 0 comments
Closed

drtv.py: Add VisuallyImpaired to non-preferred asset types #19079

pank opened this issue Jan 30, 2019 · 0 comments

Comments

@pank
Copy link

@pank pank commented Jan 30, 2019

Hi,

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -gv https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-gv', 'https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.01.30.1
[debug] Python version 3.7.2 (CPython) - Linux-4.20.3-arch1-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
https://drod08b-vh.akamaihd.net/i/all/clear/streaming/88/5c45e86c6187a51250a0de88/Kroeniken--2-22-_0590cce4971d48788014f12e63ac480c_,271,417,730,1497,2355,3983,.mp4.csmil/index_5_av.m3u8?null=0

drtv.py fetches wrong video when VisuallyImpaired videos are available

When a visually interpreted version of a dr.dk/tv/drtv.py video is available, it is selected by default by youtube-dl. I think the fix is as simple as adding VisuallyImpaired to non-preferred asset_targets (see below),

Example: https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22/
(It should work from non-danish IPs)

Try mpv https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22/, at 0:07 a narrator explains what is happening. The version that youtube-dl is playing back is https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22/VisuallyInterpreted

$ youtube-dl -g https://www.dr.dk/tv/se/kroeniken/kroeniken-dr1/kroeniken-2-22/
https://drod08b-vh.akamaihd.net/i/all/clear/streaming/88/5c45e86c6187a51250a0de88/Kroeniken--2-22-_0590cce4971d48788014f12e63ac480c_,271,417,730,1497,2355,3983,.mp4.csmil/index_5_av.m3u8?null=0

Using the Firefox Networks tab, the default version is something like this

 https://drod07h-vh.akamaihd.net/i/all/clear/streaming/e6/5c436122a11fa012182f4fe6/Kroeniken--2-22-_df45e944d2484704b843f11c5a23ccff_,271,417,730,1497,2355,3983,.mp4.csmil/index_5_av.m3u8?null=0

I think the following one-line patch is sufficient to prefer the default video over the VisuallyImpaired one (I can make a pull request if preferred, but it's just adding one word):

From c30ae9f443c346ef67ab65cda2140a20648db42a Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Wed, 30 Jan 2019 23:52:39 +0100
Subject: [PATCH] drtv.py: Add 'VisuallyInterpreted' to non-preferred
 asset_target

---
 youtube_dl/extractor/drtv.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/youtube_dl/extractor/drtv.py b/youtube_dl/extractor/drtv.py
index c5f211128..17f14c26f 100644
--- a/youtube_dl/extractor/drtv.py
+++ b/youtube_dl/extractor/drtv.py
@@ -172,7 +172,7 @@ class DRTVIE(InfoExtractor):
                     target = link.get('Target')
                     format_id = target or ''
                     preference = None
-                    if asset_target in ('SpokenSubtitles', 'SignLanguage'):
+                    if asset_target in ('SpokenSubtitles', 'SignLanguage', 'VisuallyInterpreted'):
                         preference = -1
                         format_id += '-%s' % asset_target
                     if target == 'HDS':
-- 
2.20.1

Thanks,
Rasmus

@dstftw dstftw closed this in 49fe417 Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.