projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d0630d
)
[spankbang] Detect unavailable videos (closes #14644)
author
Sergey M․
<dstftw@gmail.com>
Tue, 31 Oct 2017 16:05:25 +0000
(23:05 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Tue, 31 Oct 2017 16:05:25 +0000
(23:05 +0700)
youtube_dl/extractor/spankbang.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/spankbang.py
b/youtube_dl/extractor/spankbang.py
index 3394c7e6ba4713ad0c63e2579d611a0319c45add..2863e53b5a47be353ae18df446c3ffd8a95d0913 100644
(file)
--- a/
youtube_dl/extractor/spankbang.py
+++ b/
youtube_dl/extractor/spankbang.py
@@
-3,6
+3,7
@@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
+from ..utils import ExtractorError
class SpankBangIE(InfoExtractor):
@@
-33,6
+34,10
@@
class SpankBangIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
+ if re.search(r'<[^>]+\bid=["\']video_removed', webpage):
+ raise ExtractorError(
+ 'Video %s is not available' % video_id, expected=True)
+
stream_key = self._html_search_regex(
r'''var\s+stream_key\s*=\s*['"](.+?)['"]''',
webpage, 'stream key')