Browse Source

[npo] Capture and output error message

Sergey M․ 7 năm trước cách đây
mục cha
commit
b8adcec4ea
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      youtube_dl/extractor/npo.py

+ 4 - 0
youtube_dl/extractor/npo.py

@@ -170,6 +170,10 @@ class NPOIE(NPOBaseIE):
             transform_source=strip_jsonp,
             transform_source=strip_jsonp,
         )
         )
 
 
+        error = metadata.get('error')
+        if error:
+            raise ExtractorError(error, expected=True)
+
         # For some videos actual video id (prid) is different (e.g. for
         # For some videos actual video id (prid) is different (e.g. for
         # http://www.omroepwnl.nl/video/fragment/vandaag-de-dag-verkiezingen__POMS_WNL_853698
         # http://www.omroepwnl.nl/video/fragment/vandaag-de-dag-verkiezingen__POMS_WNL_853698
         # video id is POMS_WNL_853698 but prid is POW_00996502)
         # video id is POMS_WNL_853698 but prid is POW_00996502)