diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-03-04 03:12:24 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-03-04 03:13:45 +0700 |
commit | f9f10268c1816dcf1fc0db9d8128008f73a154c7 (patch) | |
tree | 4cc921300049d0770647cc237c84d00b93b6b9ce | |
parent | f241a97312238a790f7eed927fd3934c491a8fec (diff) |
[afreecatv] Detect deleted videos
-rw-r--r-- | youtube_dl/extractor/afreecatv.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py index fe499a35a..df2a3fc4a 100644 --- a/youtube_dl/extractor/afreecatv.py +++ b/youtube_dl/extractor/afreecatv.py @@ -177,6 +177,10 @@ class AfreecaTVIE(InfoExtractor): webpage = self._download_webpage(url, video_id) + if re.search(r'alert\(["\']This video has been deleted', webpage): + raise ExtractorError( + 'Video %s has been deleted' % video_id, expected=True) + station_id = self._search_regex( r'nStationNo\s*=\s*(\d+)', webpage, 'station') bbs_id = self._search_regex( @@ -202,8 +206,8 @@ class AfreecaTVIE(InfoExtractor): video_element = video_xml.findall(compat_xpath('./track/video'))[-1] if video_element is None or video_element.text is None: - raise ExtractorError('Specified AfreecaTV video does not exist', - expected=True) + raise ExtractorError( + 'Video %s video does not exist' % video_id, expected=True) video_url = video_element.text.strip() |