projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f241a97
)
[afreecatv] Detect deleted videos
author
Sergey M․
<dstftw@gmail.com>
Sat, 3 Mar 2018 20:12:24 +0000
(
03:12
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 3 Mar 2018 20:13:45 +0000
(
03:13
+0700)
youtube_dl/extractor/afreecatv.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/afreecatv.py
b/youtube_dl/extractor/afreecatv.py
index fe499a35a5a2376adec605e19a73e7d072d15510..df2a3fc4a2a24d2feeb81083d2414d8dc09b682b 100644
(file)
--- 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)
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(
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:
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()
video_url = video_element.text.strip()