aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-10-31 23:05:25 +0700
committerSergey M․ <dstftw@gmail.com>2017-10-31 23:05:25 +0700
commit8fe767e07261abb8013b18ca2ed31ebb8d95c7d1 (patch)
treed13b05b53e88217e08c8c5d127a6b5e274bd70de /youtube_dl
parent6d0630d8801fd3278a05fa7e55a73bd454403e5a (diff)
[spankbang] Detect unavailable videos (closes #14644)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/spankbang.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/spankbang.py b/youtube_dl/extractor/spankbang.py
index 3394c7e6b..2863e53b5 100644
--- 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')