Browse Source

[ard] Capture and output time restricted videos (Closes #5213)

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

+ 3 - 0
youtube_dl/extractor/ard.py

@@ -50,6 +50,9 @@ class ARDMediathekIE(InfoExtractor):
         if '>Der gewünschte Beitrag ist nicht mehr verfügbar.<' in webpage:
         if '>Der gewünschte Beitrag ist nicht mehr verfügbar.<' in webpage:
             raise ExtractorError('Video %s is no longer available' % video_id, expected=True)
             raise ExtractorError('Video %s is no longer available' % video_id, expected=True)
 
 
+        if 'Diese Sendung ist für Jugendliche unter 12 Jahren nicht geeignet. Der Clip ist deshalb nur von 20 bis 6 Uhr verfügbar.' in webpage:
+            raise ExtractorError('This program is only suitable for those aged 12 and older. Video %s is therefore only available between 20 pm and 6 am.' % video_id, expected=True)
+
         if re.search(r'[\?&]rss($|[=&])', url):
         if re.search(r'[\?&]rss($|[=&])', url):
             doc = parse_xml(webpage)
             doc = parse_xml(webpage)
             if doc.tag == 'rss':
             if doc.tag == 'rss':