[ard] Detect unavailable videos (closes #11018)
This commit is contained in:
		@@ -174,11 +174,17 @@ class ARDMediathekIE(InfoExtractor):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        webpage = self._download_webpage(url, video_id)
 | 
					        webpage = self._download_webpage(url, video_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if '>Der gewünschte Beitrag ist nicht mehr verfügbar.<' in webpage:
 | 
					        ERRORS = (
 | 
				
			||||||
            raise ExtractorError('Video %s is no longer available' % video_id, expected=True)
 | 
					            ('>Leider liegt eine Störung vor.', 'Video %s is unavailable'),
 | 
				
			||||||
 | 
					            ('>Der gewünschte Beitrag ist nicht mehr verfügbar.<',
 | 
				
			||||||
 | 
					             'Video %s is no longer available'),
 | 
				
			||||||
 | 
					            ('Diese Sendung ist für Jugendliche unter 12 Jahren nicht geeignet. Der Clip ist deshalb nur von 20 bis 6 Uhr verfügbar.',
 | 
				
			||||||
 | 
					             'This program is only suitable for those aged 12 and older. Video %s is therefore only available between 20 pm and 6 am.'),
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        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:
 | 
					        for pattern, message in ERRORS:
 | 
				
			||||||
            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 pattern in webpage:
 | 
				
			||||||
 | 
					                raise ExtractorError(message % video_id, expected=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if re.search(r'[\?&]rss($|[=&])', url):
 | 
					        if re.search(r'[\?&]rss($|[=&])', url):
 | 
				
			||||||
            doc = compat_etree_fromstring(webpage.encode('utf-8'))
 | 
					            doc = compat_etree_fromstring(webpage.encode('utf-8'))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user