Explorar o código

[9gag] Relax optional fields

Sergey M․ %!s(int64=10) %!d(string=hai) anos
pai
achega
8ca2e93e1a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      youtube_dl/extractor/ninegag.py

+ 2 - 2
youtube_dl/extractor/ninegag.py

@@ -70,8 +70,8 @@ class NineGagIE(InfoExtractor):
             source_url = self._EXTERNAL_VIDEO_PROVIDER[external_video_provider]['url'] % external_video_id
             ie_key = self._EXTERNAL_VIDEO_PROVIDER[external_video_provider]['ie_key']
         title = post_view['title']
-        description = post_view['description']
-        view_count = str_to_int(post_view['externalView'])
+        description = post_view.get('description')
+        view_count = str_to_int(post_view.get('externalView'))
         thumbnail = post_view.get('thumbnail_700w') or post_view.get('ogImageUrl') or post_view.get('thumbnail_300w')
 
         return {