Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Allow extra playlist format #482
Comments
|
…not only at youTube can be placed a playlist. youtube-dl is a В Sat, 20 Oct 2012 18:08:54 -0700
|
|
After a bit thinking. |
|
I mean, whenever you actually need this, you may use: #!/bin/bash
plprefix='http://www.youtube.com/playlist?list='
[[ -z $1 ]] && echo 'Usage:' $0 'PLAYLIST-ID' && exit 1;
youtube-dl "$plprefix$1";
exitOne may save this in a file and name like |
|
Of course, this is just the way of bash-wrappings around things you don't need to overcomplicate but want to adapt. |
|
The bash script wrapper is an interesting wordaround, as I always have to look up what I have to prefix the playlist ID with. I suppose that the regex would be |
|
How and where do you intend to use this regex, dear? And, by the way, doesn't the workaround work for you? |
|
To replace the regex that searches for Yes, the workaround worked, but I can't be the only one that have this problem, so it would be a great feature to have. |
|
You may be not the one who ran into the problem. In my very childhood I Many people (as I can see) are troubled with youtube-dl and Python 2.5 |
|
There are two sides to this:
and depending on who you are, you will prioritize them different. User / developer. If the purpose of the program is to make the users lifes easier, then adding |
|
I am an occasional user and kinda youtube-dl project fan. ;D But if you want me to implement the functional you ask for, I could try to. |
|
One question more: if youtube.com/playlist?list= works, what else would you like to regex-ly detect? |
|
Can you reformulate that? I don't understand. |
Which two cases? The one where it detects that there is a playlist is already implemented. Smoking a long pipe, looking at _VALID_URL = r'(?:https?://)?(?:\w+\.)?youtube\.com/(?:(?:course|view_play_list|my_playlists|artist|playlist)\?.*?(p|a|list)=|user/.*?/user/|p/|user/.*?#[pg]/c/)(?:PL|EC)?([0-9A-Za-z-_]+)(?:/.*?/([0-9A-Za-z_-]+))?.*'It's in InfoExtractors.py:YoutubePlaylistIE. The best way I could provide is not harming the original YoutubePlaylistIE but deriving a wrapper class. But this is quite less worhy than simply having a bash wrapper shown above. |
|
And I doubt the authors will support this step. Guessing what happens when youTube change their PL ID format that it will be confused with other content providers easily. |
|
Nice to see so much discussion around a feature (keep the tones nice! :) )
I would +1 on this, and here is a patch (ok, not pretty, as it repeats itself, but by far the easiest and most understandable) diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 88973cc..80d7339 100644
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -1508,7 +1508,7 @@ class YahooSearchIE(InfoExtractor):
class YoutubePlaylistIE(InfoExtractor):
"""Information Extractor for YouTube playlists."""
- _VALID_URL = r'(?:https?://)?(?:\w+\.)?youtube\.com/(?:(?:course|view_play_list|my_playlists|artist|playlist)\?.*?(p|a|list)=|user/.*?/user/|p/|user/.*?#[pg]/c/)(?:PL|EC)?([0-9A-Za-z-_]+)(?:/.*?/([0-9A-Za-z_-]+))?.*'
+ _VALID_URL = r'(?:(?:https?://)?(?:\w+\.)?youtube\.com/(?:(?:course|view_play_list|my_playlists|artist|playlist)\?.*?(p|a|list)=|user/.*?/user/|p/|user/.*?#[pg]/c/)(?:PL|EC)?|PL|EC)([0-9A-Za-z-_]+)(?:/.*?/([0-9A-Za-z_-]+))?.*'
_TEMPLATE_URL = 'http://www.youtube.com/%s?%s=%s&page=%s&gl=US&hl=en'
_VIDEO_INDICATOR_TEMPLATE = r'/watch\?v=(.+?)&([^&"]+&)*list=.*?%s'
_MORE_PAGES_INDICATOR = r'yt-uix-pager-next'But, obviously, I will leave to @phihag the decision. |
|
I knew there'll be someone who knows these py/regex-es from the |
|
I have yet to see an argument against supporting raw playlist IDs, so they're in the current dev build. We'll release soon, but you can already download the git version and either execute |
When browsing playlists from a user, the links looks like
http://www.youtube.com/watch?v=sao5-VCcRkQ&list=PLB34CE9AD7450F3A3
It would be great if I just could do
youtube-dl PLB34CE9AD7450F3A3
just like it can be done for videos.
Playlists always starts with PL and then 16 chars of [A-Z][0-9]