[youtube] Make --write-annotations non fatal (closes #21452)
authorSergey M․ <dstftw@gmail.com>
Wed, 19 Jun 2019 17:57:58 +0000 (00:57 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 19 Jun 2019 17:57:58 +0000 (00:57 +0700)
youtube_dl/extractor/youtube.py

index 7b630b191f628998811f9664cdc3cbaced519d7b..1010c8616c83f5cabb06c5a18d7c7578d9af1354 100644 (file)
@@ -1581,8 +1581,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         return video_id
 
     def _extract_annotations(self, video_id):
         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):
 
     @staticmethod
     def _extract_chapters(description, duration):