Skip to content

Commit

Permalink
[youtube] Make --write-annotations non fatal (closes #21452)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw authored and meunierd committed Feb 13, 2020
1 parent 0e09a92 commit 4b70364
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions youtube_dl/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,8 +1581,15 @@ def extract_id(cls, url):
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):
Expand Down

0 comments on commit 4b70364

Please sign in to comment.