Skip to content

Commit

Permalink
[streamcloud] Detect removed videos (Closes #3768)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Jun 12, 2016
1 parent 971e3b7 commit 84dcd1c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions youtube_dl/extractor/streamcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
)
Expand All @@ -14,7 +15,7 @@ class StreamcloudIE(InfoExtractor):
IE_NAME = 'streamcloud.eu'
_VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[^#?]*)\.html)?'

_TEST = {
_TESTS = [{
'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html',
'md5': '6bea4c7fa5daaacc2a946b7146286686',
'info_dict': {
Expand All @@ -23,14 +24,21 @@ class StreamcloudIE(InfoExtractor):
'title': 'youtube-dl test video \'/\\ ä ↭',
},
'skip': 'Only available from the EU'
}
}, {
'url': 'http://streamcloud.eu/ua8cmfh1nbe6/NSHIP-148--KUC-NG--H264-.mp4.html',
'only_matching': True,
}]

def _real_extract(self, url):
video_id = self._match_id(url)
url = 'http://streamcloud.eu/%s' % video_id

orig_webpage = self._download_webpage(url, video_id)

if '>File Not Found<' in orig_webpage:
raise ExtractorError(
'Video %s does not exist' % video_id, expected=True)

fields = re.findall(r'''(?x)<input\s+
type="(?:hidden|submit)"\s+
name="([^"]+)"\s+
Expand Down

0 comments on commit 84dcd1c

Please sign in to comment.