Browse Source

[spankbang] Detect unavailable videos (closes #14644)

master-ytdl-org
Sergey M․ 7 years ago
parent
commit
8fe767e072
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      youtube_dl/extractor/spankbang.py

+ 5
- 0
youtube_dl/extractor/spankbang.py View File

@ -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')


Loading…
Cancel
Save