]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[teamcoco] Detect expired videos (#5626)
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 14 May 2015 18:27:41 +0000 (02:27 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 14 May 2015 18:28:41 +0000 (02:28 +0800)
youtube_dl/extractor/teamcoco.py

index 410eb7d3a1fa60acdc590066125a834b37f5c6e9..56be526383b590d9b00759400a269d5164beef2f 100644 (file)
@@ -62,7 +62,9 @@ class TeamcocoIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
 
         display_id = mobj.group('display_id')
-        webpage = self._download_webpage(url, display_id)
+        webpage, urlh = self._download_webpage_handle(url, display_id)
+        if 'src=expired' in urlh.geturl():
+            raise ExtractorError('This video is expired.', expected=True)
 
         video_id = mobj.group('video_id')
         if not video_id: