aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/vshare.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/vshare.py')
-rw-r--r--hypervideo_dl/extractor/vshare.py22
1 files changed, 3 insertions, 19 deletions
diff --git a/hypervideo_dl/extractor/vshare.py b/hypervideo_dl/extractor/vshare.py
index b4874ac..1bc7ae4 100644
--- a/hypervideo_dl/extractor/vshare.py
+++ b/hypervideo_dl/extractor/vshare.py
@@ -1,18 +1,10 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
from .common import InfoExtractor
-from ..compat import compat_chr
-from ..utils import (
- decode_packed_codes,
- ExtractorError,
-)
+from ..utils import ExtractorError, decode_packed_codes
class VShareIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vshare\.io/[dv]/(?P<id>[^/?#&]+)'
+ _EMBED_REGEX = [r'<iframe[^>]+?src=["\'](?P<url>(?:https?:)?//(?:www\.)?vshare\.io/v/[^/?#&]+)']
_TESTS = [{
'url': 'https://vshare.io/d/0f64ce6',
'md5': '17b39f55b5497ae8b59f5fbce8e35886',
@@ -26,12 +18,6 @@ class VShareIE(InfoExtractor):
'only_matching': True,
}]
- @staticmethod
- def _extract_urls(webpage):
- return re.findall(
- r'<iframe[^>]+?src=["\'](?P<url>(?:https?:)?//(?:www\.)?vshare\.io/v/[^/?#&]+)',
- webpage)
-
def _extract_packed(self, webpage):
packed = self._search_regex(
r'(eval\(function.+)', webpage, 'packed code')
@@ -40,7 +26,7 @@ class VShareIE(InfoExtractor):
digits = [int(digit) for digit in digits.split(',')]
key_digit = self._search_regex(
r'fromCharCode\(.+?(\d+)\)}', unpacked, 'key digit')
- chars = [compat_chr(d - int(key_digit)) for d in digits]
+ chars = [chr(d - int(key_digit)) for d in digits]
return ''.join(chars)
def _real_extract(self, url):
@@ -63,8 +49,6 @@ class VShareIE(InfoExtractor):
url, '<video>%s</video>' % self._extract_packed(webpage),
video_id)[0]
- self._sort_formats(info['formats'])
-
info.update({
'id': video_id,
'title': title,