1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[youtube] Make --write-annotations non fatal (closes #21452)

This commit is contained in:
Sergey M․ 2019-06-20 00:57:58 +07:00
parent 7c24a58bdb
commit c40714cdee
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -1581,8 +1581,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
return video_id
def _extract_annotations(self, video_id):
url = 'https://www.youtube.com/annotations_invideo?features=1&legacy=1&video_id=%s' % video_id
return self._download_webpage(url, video_id, note='Searching for annotations.', errnote='Unable to download video annotations.')
return self._download_webpage(
'https://www.youtube.com/annotations_invideo', video_id,
note='Downloading annotations',
errnote='Unable to download video annotations', fatal=False,
query={
'features': 1,
'legacy': 1,
'video_id': video_id,
})
@staticmethod
def _extract_chapters(description, duration):