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

Download playlists doesn't work when a newline character is in the title #5161

Closed
rmkraus opened this issue Mar 8, 2015 · 3 comments
Closed

Download playlists doesn't work when a newline character is in the title #5161

rmkraus opened this issue Mar 8, 2015 · 3 comments

Comments

@rmkraus
Copy link

@rmkraus rmkraus commented Mar 8, 2015

If there is a new line in a playlist H1 tag, youtube-dl is currently unable to parse out the playlist title. An example of such a playlist is here:

https://www.youtube.com/playlist?list=PLIamkchgCKVuSMFn1m8Yj2d67TyGtQxxE

This can be fixed by allowing the . in the regular expression to accept new lines by using the re.S flag. I did this in my own copy by changing line 362 of common.py to have
flags=re.S
by default instead of
flags=0
I haven't found any negative results from this, but I am not familiar enough with the code to say that there aren't any.

At either rate, thanks for all your hard work, this application is great.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 8, 2015

Works perfectly for me. playlist regex already allows dot to match any character.
Post the full output you get when running with --verbose option.

@rmkraus
Copy link
Author

@rmkraus rmkraus commented Mar 13, 2015

Here is the output. Looks like I could use an update. In hindsight, that may be related.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['https://www.youtube.com/playlist?list=PLIamkchgCKVuSMFn1m8Yj2d67TyGtQxxE', '--verbose']
[debug] Encodings: locale 'UTF-8', fs 'UTF-8', out 'UTF-8', pref: 'UTF-8'
[debug] youtube-dl version 2014.02.17
[debug] Python version 2.7.6 - Linux-3.13.0-37-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[youtube:playlist] PLIamkchgCKVuSMFn1m8Yj2d67TyGtQxxE: Downloading page #1
WARNING: [youtube:playlist] PLIamkchgCKVuSMFn1m8Yj2d67TyGtQxxE: Playlist page is missing OpenGraph title, falling back ...
ERROR: Unable to extract title; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 1511, in _real_extract
    playlist_title = self._og_search_title(page)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 428, in _og_search_title
    return self._og_search_property('title', html, **kargs)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 416, in _og_search_property
    escaped = self._search_regex(self._og_regexes(prop), html, name, flags=re.DOTALL, **kargs)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 356, in _search_regex
    raise RegexNotFoundError(u'Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract OpenGraph title; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 493, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 158, in extract
    return self._real_extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 1517, in _real_extract
    r'<h1 class="pl-header-title">(.*?)</h1>', page, u'title')
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 366, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 356, in _search_regex
    raise RegexNotFoundError(u'Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract title; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 13, 2015

You are using an outdated version of youtube-dl. Refer to our FAQ if you have trouble updating.

@dstftw dstftw closed this Mar 13, 2015
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
2 participants
You can’t perform that action at this time.