From: Yen Chi Hsuan Date: Thu, 14 May 2015 18:27:41 +0000 (+0800) Subject: [teamcoco] Detect expired videos (#5626) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=12675275a1d2158fbe409361888569e4cb52ef07;p=youtube-dl [teamcoco] Detect expired videos (#5626) --- diff --git a/youtube_dl/extractor/teamcoco.py b/youtube_dl/extractor/teamcoco.py index 410eb7d3a..56be52638 100644 --- a/youtube_dl/extractor/teamcoco.py +++ b/youtube_dl/extractor/teamcoco.py @@ -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: