projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c76aa0
)
[youtube] Make uploader extraction non fatal (#16444)
author
Sergey M․
<dstftw@gmail.com>
Sun, 13 May 2018 15:49:01 +0000
(22:49 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 13 May 2018 15:49:01 +0000
(22:49 +0700)
youtube_dl/extractor/youtube.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youtube.py
b/youtube_dl/extractor/youtube.py
index 1f29e8a4ea940418ad335d27459c07082161a9d7..897398d2086aee820966134f29b04c2fcca17596 100644
(file)
--- a/
youtube_dl/extractor/youtube.py
+++ b/
youtube_dl/extractor/youtube.py
@@
-1697,9
+1697,11
@@
class YoutubeIE(YoutubeBaseInfoExtractor):
self.report_information_extraction(video_id)
# uploader
self.report_information_extraction(video_id)
# uploader
- if 'author' not in video_info:
- raise ExtractorError('Unable to extract uploader name')
- video_uploader = compat_urllib_parse_unquote_plus(video_info['author'][0])
+ video_uploader = try_get(video_info, lambda x: x['author'][0], compat_str)
+ if video_uploader:
+ video_uploader = compat_urllib_parse_unquote_plus(video_uploader)
+ else:
+ self._downloader.report_warning('unable to extract uploader name')
# uploader_id
video_uploader_id = None
# uploader_id
video_uploader_id = None