X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fsockshare.py;h=7d3c0e93783afeac3d8e939e0cf317177df4ca9f;hb=240b9b7a5cd5f19f50ae28fb3ef991fede216ef6;hp=cbf2d7abefad8d6d594a33c6dcaa214031cd8d3e;hpb=7dabd2ac45a53bc608390a72c2d43044aaf6efb8;p=youtube-dl.git
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'