X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsockshare.py;h=7d3c0e93783afeac3d8e939e0cf317177df4ca9f;hb=d4f64cabf4ede444b390bb71b90ad4103ce572c0;hp=cbf2d7abefad8d6d594a33c6dcaa214031cd8d3e;hpb=66aa382eae9342506db64ce3328a009fd3f06d5c;p=youtube-dl diff --git a/youtube_dl/extractor/sockshare.py b/youtube_dl/extractor/sockshare.py index cbf2d7abe..7d3c0e937 100644 --- a/youtube_dl/extractor/sockshare.py +++ b/youtube_dl/extractor/sockshare.py @@ -1,13 +1,16 @@ # coding: utf-8 from __future__ import unicode_literals -from ..utils import ( - ExtractorError, +import re + +from ..compat import ( compat_urllib_parse, compat_urllib_request, +) +from ..utils import ( determine_ext, + ExtractorError, ) -import re from .common import InfoExtractor @@ -27,14 +30,12 @@ class SockshareIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - + video_id = self._match_id(url) url = 'http://sockshare.com/file/%s' % video_id webpage = self._download_webpage(url, video_id) if re.search(self._FILE_DELETED_REGEX, webpage) is not None: - raise ExtractorError(u'Video %s does not exist' % video_id, + raise ExtractorError('Video %s does not exist' % video_id, expected=True) confirm_hash = self._html_search_regex(r'''(?x)(.+)', webpage, 'title') - thumbnail = self._html_search_regex(r'(.+)', + r'var name = "([^"]+)";'), + webpage, 'title', default=None) + thumbnail = self._html_search_regex( + r'