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

When query youtube playlist, no title is returned #16284

Open
quekky opened this issue Apr 26, 2018 · 2 comments
Open

When query youtube playlist, no title is returned #16284

quekky opened this issue Apr 26, 2018 · 2 comments

Comments

@quekky
Copy link

@quekky quekky commented Apr 26, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.04.25. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.04.25

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


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.exe -v -j --flat-playlist https://www.youtube.com/user/CNETTV/playlists
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-j', '--flat-playlist', 'https://www.youtube.com/user/CNETTV/playlists']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.04.25
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.16299
[debug] exe versions: none
[debug] Proxy map: {}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=LLOmcA3f_RrH6b9NmcNa4tdg", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2uEJBT-g9ZQ_FaHlqZ31km", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3GTTtuDv65IgCTaMRRGAJy", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2QGpN0f8rHN0IarEoSScoj", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3htKwUwGGC5I_npw1IHh5K", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3vtryjYuuGNFAk0A8IuWO6", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2WMwsuJOmW0rrNqtj7_ipK", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3wnjBRP3nXj05uTgeD5OXD", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv1ErwrGUZpHKCY-RM25yLqz", "_type": "url"}
{"ie_key": "YoutubePlaylist", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2BWtTpy-hLZn4Pd3IPjGPI", "_type": "url"}

<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Run the youtube-dl on a playlists to get a list of playlist (eg https://www.youtube.com/user/CNETTV/playlists ) it returns a list of playlist but there is no title returned on the playlist.

Expected result is to also print the titles of the playlist

Changing the following code will allow it to return the title

class YoutubePlaylistsBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
    def _process_page(self, content):
        for playlist_id, video_title in orderedSet(re.findall(
                r'<h3[^>]+class="[^"]*yt-lockup-title[^"]*"[^>]*><a[^>]+href="/?playlist\?list=([0-9A-Za-z-_]{10,})"(?:[^>]+>(?P<title>[^<]+))?',
                content)):
            video_title = unescapeHTML(video_title)
            if video_title:
                video_title = video_title.strip()
            yield self.url_result(
                'https://www.youtube.com/playlist?list=%s' % playlist_id, 'YoutubePlaylist', video_title=video_title)

Expected result:

youtube-dl.exe -j --flat-playlist https://www.youtube.com/user/CNETTV/playlists
{"_type": "url", "url": "https://www.youtube.com/playlist?list=LLOmcA3f_RrH6b9NmcNa4tdg", "ie_key": "YoutubePlaylist", "title": "Liked videos"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2uEJBT-g9ZQ_FaHlqZ31km", "ie_key": "YoutubePlaylist", "title": "So Retro"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3GTTtuDv65IgCTaMRRGAJy", "ie_key": "YoutubePlaylist", "title": "Most popular videos this week"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2QGpN0f8rHN0IarEoSScoj", "ie_key": "YoutubePlaylist", "title": "Quick Questions with Jeff Bakalar"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3htKwUwGGC5I_npw1IHh5K", "ie_key": "YoutubePlaylist", "title": "CNET Book Club"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3vtryjYuuGNFAk0A8IuWO6", "ie_key": "YoutubePlaylist", "title": "CNET Versus"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2WMwsuJOmW0rrNqtj7_ipK", "ie_key": "YoutubePlaylist", "title": "Jeff Bakalar videos"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv3wnjBRP3nXj05uTgeD5OXD", "ie_key": "YoutubePlaylist", "title": "The Tesla Track"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv1ErwrGUZpHKCY-RM25yLqz", "ie_key": "YoutubePlaylist", "title": "CNET Torture Tests"}
{"_type": "url", "url": "https://www.youtube.com/playlist?list=PLAl4aZK3mRv2BWtTpy-hLZn4Pd3IPjGPI", "ie_key": "YoutubePlaylist", "title": "CNET Live Events 2018"}
@joe-bruno
Copy link

@joe-bruno joe-bruno commented May 2, 2018

@motiv8d
Copy link

@motiv8d motiv8d commented May 2, 2020

Thankyou @quekky - I have just tried making the suggested patch and it works.
For others, the file change is to "/usr/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py" (path may vary dependent on your system and python revisions).

As this seems like trivial issue fix and it was made over 2 years ago now, I do not understand why this is not implemented in the official versions.

The only problem I still have with this function is it is limited to returning 14 entries. That is a separate issue of course.

Can someone advise why this patch has not been implemented please?

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
3 participants
You can’t perform that action at this time.