mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 19:36:45 +00:00
[afreecatv] Detect deleted videos
This commit is contained in:
parent
f241a97312
commit
f9f10268c1
|
@ -177,6 +177,10 @@ def _real_extract(self, url):
|
||||||
|
|
||||||
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(
|
station_id = self._search_regex(
|
||||||
r'nStationNo\s*=\s*(\d+)', webpage, 'station')
|
r'nStationNo\s*=\s*(\d+)', webpage, 'station')
|
||||||
bbs_id = self._search_regex(
|
bbs_id = self._search_regex(
|
||||||
|
@ -202,8 +206,8 @@ def _real_extract(self, url):
|
||||||
|
|
||||||
video_element = video_xml.findall(compat_xpath('./track/video'))[-1]
|
video_element = video_xml.findall(compat_xpath('./track/video'))[-1]
|
||||||
if video_element is None or video_element.text is None:
|
if video_element is None or video_element.text is None:
|
||||||
raise ExtractorError('Specified AfreecaTV video does not exist',
|
raise ExtractorError(
|
||||||
expected=True)
|
'Video %s video does not exist' % video_id, expected=True)
|
||||||
|
|
||||||
video_url = video_element.text.strip()
|
video_url = video_element.text.strip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue