[drtv] Check for unavailable videos
authorSergey M․ <dstftw@gmail.com>
Sat, 4 Apr 2015 17:17:09 +0000 (23:17 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 4 Apr 2015 17:17:09 +0000 (23:17 +0600)
youtube_dl/extractor/drtv.py

index 8257e35a437b075461114fbaf1b4dd2d578f56d8..bd1109549090c30fac218e046930e2f8938461ba 100644 (file)
@@ -26,6 +26,10 @@ class DRTVIE(InfoExtractor):
 
         webpage = self._download_webpage(url, video_id)
 
+        if '>Programmet er ikke længere tilgængeligt' in webpage:
+            raise ExtractorError(
+                'Video %s is not available' % video_id, expected=True)
+
         video_id = self._search_regex(
             r'data-(?:material-identifier|episode-slug)="([^"]+)"',
             webpage, 'video id')