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

Invalid conversation of DASH segment templates with format specifiers #9119

Closed
maxdavidson opened this issue Apr 8, 2016 · 0 comments
Closed

Comments

@maxdavidson
Copy link

@maxdavidson maxdavidson commented Apr 8, 2016

  • [x ] I've verified and I assure that I'm running youtube-dl 2016.04.06
  • [x ] Bug report (encountered problems with youtube-dl)
$ youtube-dl -v http://www.svtplay.se/video/7639352
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.svtplay.se/video/7639352']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.06
[debug] Python version 2.7.11 - Darwin-15.5.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[SVTPlay] 7639352: Downloading JSON metadata
[SVTPlay] 7639352: Downloading MPD manifest
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 419, in main
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 409, in _real_main
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1725, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 669, in extract_info
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 323, in extract
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/svt.py", line 124, in _real_extract
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/svt.py", line 37, in _extract_video
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1401, in _extract_mpd_formats
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1527, in _parse_mpd_formats
TypeError: %d format: a number is required, not dict

The change of regex in db8ee7e does not properly account for the case when the segment template contains a format specifier.

For example, the 'Number' block in this segment template is not picked up by the regex, and is left untouched:
'$RepresentationID$/$RepresentationID$_$Number%05d$.m4v'

The regex on this line should be changed into r'\$(Number|Bandwidth)%(\d+)d\$, to account for the 'd'.
https://github.com/rg3/youtube-dl/blob/2016.04.06/youtube_dl/extractor/common.py#L1519

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.