projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6391cd
)
[bilibili] Capture the video-not-exist message
author
Yen Chi Hsuan
<yan12125@gmail.com>
Mon, 20 Apr 2015 18:32:10 +0000
(
02:32
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Mon, 20 Apr 2015 18:32:10 +0000
(
02:32
+0800)
youtube_dl/extractor/bilibili.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/bilibili.py
b/youtube_dl/extractor/bilibili.py
index 75d744852edc382721cee8556067f89ccb0092df..904d9a8b4e3c71c23e1112c2fc69e6004aedb09d 100644
(file)
--- a/
youtube_dl/extractor/bilibili.py
+++ b/
youtube_dl/extractor/bilibili.py
@@
-7,6
+7,7
@@
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
+ ExtractorError,
)
@@
-30,6
+31,8
@@
class BiliBiliIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
+ if self._search_regex(r'(此视频不存在或被删除)', webpage, 'error message', default=None):
+ raise ExtractorError('The video does not exist or was deleted', expected=True)
video_code = self._search_regex(
r'(?s)<div itemprop="video".*?>(.*?)</div>', webpage, 'video code')