-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Can't download youtube playlists or channels #14083
Comments
I can confirm the same behaviour with git version 7998520. |
The YouTube revised today, you can modify this files:
OK |
I experienced this issue as well, awei78 's suggested changes to extractor/youtube.py fixed the error for me; thanks! |
Can somebody do a new version with the updates to youtube.py as shared above, pretty please. Also @awei78 could you please list the lines from which the modifications need to take place. The various code seems to starts from the following - line 258 1st one.
instead of
spelling error perhaps ? Don't know where 3rd one is from :( |
Yeah. Simple .patch file would be nice for example. |
This should have a new update to fix this ; youtu.be download is the main feature for this script. |
@awei78 Why don't you create a pr for your patch? |
just saw youtube.com has changed quite a bit - https://home.bt.com/tech-gadgets/tech-news/youtube-new-logo-redesign-new-features-11364208101487 don't like the new minimalistic look, more importantly they have made it harder to find playlists :( |
Here is a patch using @awei78 's fix until official fix: https://github.com/GTechAlpha/youtube-dl/commit/0ae0db13d1cecefde301bf5ba6770f409b3bb6bf.patch Full credit and thanks to @awei78 . |
I confirm. The patch does work. |
I haven't checked it, but can someone push @awei78 patch to the master branch ? |
Applying the patch, when I download the last 5 videos of a channel, it does not download the right videos... |
if i try download some channels - i see this |
Patch tested on a user and a channel, don't blame if it breaks something else... From 953ca568dcde08fc55a0c245036e390c2e8061bc Mon Sep 17 00:00:00 2001
From: Ivan Kozik <[email protected]>
Date: Fri, 1 Sep 2017 02:26:41 +0000
Subject: [PATCH] Get non-Polymer YouTube pages because channel/playlist
download is broken for Polymer pages
---
youtube_dl/extractor/youtube.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index ea6f12f8e..d892db943 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -267,7 +267,7 @@ class YoutubeEntryListBaseInfoExtractor(YoutubeBaseInfoExtractor):
break
more = self._download_json(
- 'https://youtube.com/%s' % mobj.group('more'), playlist_id,
+ 'https://www.youtube.com/%s&disable_polymer=true' % mobj.group('more'), playlist_id,
'Downloading page #%s' % page_num,
transform_source=uppercase_escape)
content_html = more['content_html']
@@ -310,7 +310,7 @@ class YoutubePlaylistsBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
r'<h3[^>]+class="[^"]*yt-lockup-title[^"]*"[^>]*><a[^>]+href="/?playlist\?list=([0-9A-Za-z-_]{10,})"',
content)):
yield self.url_result(
- 'https://www.youtube.com/playlist?list=%s' % playlist_id, 'YoutubePlaylist')
+ 'https://www.youtube.com/playlist?list=%s&disable_polymer=true' % playlist_id, 'YoutubePlaylist')
def _real_extract(self, url):
playlist_id = self._match_id(url)
@@ -2325,7 +2325,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
IE_DESC = 'YouTube.com channels'
_VALID_URL = r'https?://(?:youtu\.be|(?:\w+\.)?youtube(?:-nocookie)?\.com)/channel/(?P<id>[0-9A-Za-z_-]+)'
- _TEMPLATE_URL = 'https://www.youtube.com/channel/%s/videos'
+ _TEMPLATE_URL = 'https://www.youtube.com/channel/%s/videos?disable_polymer=true'
_VIDEO_RE = r'(?:title="(?P<title>[^"]+)"[^>]+)?href="/watch\?v=(?P<id>[0-9A-Za-z_-]+)&?'
IE_NAME = 'youtube:channel'
_TESTS = [{
@@ -2382,7 +2382,7 @@ class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
if channel_playlist_id and channel_playlist_id.startswith('UC'):
playlist_id = 'UU' + channel_playlist_id[2:]
return self.url_result(
- compat_urlparse.urljoin(url, '/playlist?list=%s' % playlist_id), 'YoutubePlaylist')
+ compat_urlparse.urljoin(url, '/playlist?list=%s&disable_polymer=true' % playlist_id), 'YoutubePlaylist')
channel_page = self._download_webpage(url, channel_id, 'Downloading page #1')
autogenerated = re.search(r'''(?x)
@@ -2416,7 +2416,7 @@ class YoutubeChannelIE(YoutubePlaylistBaseInfoExtractor):
class YoutubeUserIE(YoutubeChannelIE):
IE_DESC = 'YouTube.com user videos (URL or "ytuser" keyword)'
_VALID_URL = r'(?:(?:https?://(?:\w+\.)?youtube\.com/(?:(?P<user>user|c)/)?(?!(?:attribution_link|watch|results)(?:$|[^a-z_A-Z0-9-])))|ytuser:)(?!feed/)(?P<id>[A-Za-z0-9_-]+)'
- _TEMPLATE_URL = 'https://www.youtube.com/%s/%s/videos'
+ _TEMPLATE_URL = 'https://www.youtube.com/%s/%s/videos?disable_polymer=true'
IE_NAME = 'youtube:user'
_TESTS = [{
--
2.14.1
|
I can confirm that only the patch from @ivan is working very nice. |
Patch from @ivan works here as well. |
I would consider @ivan patch a temporary backward compatibility from YouTube & they may disable this option at any time. |
I am new, how can I easily apply this Patch? |
The patch can be applied simply by locating the extractor/youtube.py first. You need the patch utility of course. If you happen to be running youtube-dl on Windows, I'd guess the Linux environment that's included in some windows could contan the patch utility. Otherwise I cannot help much more. It's been more than 10 years since I has windows. On MacOS I assume that there's already the patch utility in default install. |
@youtubeuser2017, That's propably the most simple solution. |
@ivan Thanks. Patch works 100% on playlist |
Patch does not work for me: [youtube:subscriptions] playlist Youtube Subscriptions: Collected 0 video ids (downloading 0 of them) |
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (like this:[x]
)Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2017.08.27.1. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
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 ```):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
Can't download (some) playlists or channels
youtube-dl 'https://www.youtube.com/playlist?list=UUXDTqHPpvXuBewj_zFhAyxg' -v
gives the error above
The text was updated successfully, but these errors were encountered: