projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
71ebd35
)
[youtube] Fix channel id extraction (closes #20982) (#21003)
author
pypy
<afanimusic@gmail.com>
Wed, 8 May 2019 17:58:47 +0000
(
02:58
+0900)
committer
Sergey M
<dstftw@gmail.com>
Wed, 8 May 2019 17:58:47 +0000
(
00:58
+0700)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index 4002dcfdd79eda96562e186a43027877054c9bde..da202b9bce48449d0157ef6c90ed7b45d3bf3823 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-2100,8
+2100,13
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
else:
self._downloader.report_warning('unable to extract uploader nickname')
else:
self._downloader.report_warning('unable to extract uploader nickname')
- channel_id = self._html_search_meta(
- 'channelId', video_webpage, 'channel id')
+ channel_id = (
+ str_or_none(video_details.get('channelId')) or
+ self._html_search_meta(
+ 'channelId', video_webpage, 'channel id', default=None) or
+ self._search_regex(
+ r'data-channel-external-id=(["\'])(?P<id>(?:(?!\1).)+)\1',
+ video_webpage, 'channel id', default=None, group='id'))
channel_url = 'http://www.youtube.com/channel/%s' % channel_id if channel_id else None
# thumbnail image
channel_url = 'http://www.youtube.com/channel/%s' % channel_id if channel_id else None
# thumbnail image