aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/yapfiles.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/yapfiles.py')
-rw-r--r--hypervideo_dl/extractor/yapfiles.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/hypervideo_dl/extractor/yapfiles.py b/hypervideo_dl/extractor/yapfiles.py
index cfb368d..19812ba 100644
--- a/hypervideo_dl/extractor/yapfiles.py
+++ b/hypervideo_dl/extractor/yapfiles.py
@@ -1,14 +1,8 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
- unescapeHTML,
url_or_none,
)
@@ -16,6 +10,7 @@ from ..utils import (
class YapFilesIE(InfoExtractor):
_YAPFILES_URL = r'//(?:(?:www|api)\.)?yapfiles\.ru/get_player/*\?.*?\bv=(?P<id>\w+)'
_VALID_URL = r'https?:%s' % _YAPFILES_URL
+ _EMBED_REGEX = [rf'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?{_YAPFILES_URL}.*?)\1']
_TESTS = [{
# with hd
'url': 'http://www.yapfiles.ru/get_player/?v=vMDE1NjcyNDUt0413',
@@ -33,12 +28,6 @@ class YapFilesIE(InfoExtractor):
'only_matching': True,
}]
- @staticmethod
- def _extract_urls(webpage):
- return [unescapeHTML(mobj.group('url')) for mobj in re.finditer(
- r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?%s.*?)\1'
- % YapFilesIE._YAPFILES_URL, webpage)]
-
def _real_extract(self, url):
video_id = self._match_id(url)
@@ -90,7 +79,6 @@ class YapFilesIE(InfoExtractor):
'quality': quality_key(format_id),
'height': hd_height if is_hd else None,
})
- self._sort_formats(formats)
return {
'id': video_id,