projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[medialaan] PEP 8 (closes #12774)
[youtube-dl]
/
youtube_dl
/
extractor
/
pladform.py
diff --git
a/youtube_dl/extractor/pladform.py
b/youtube_dl/extractor/pladform.py
index 926e368a27a60f6b9cbe93c8e49885ebf81d3d46..e38c7618e4d29177721f21a36479b7cbd3d0cf28 100644
(file)
--- a/
youtube_dl/extractor/pladform.py
+++ b/
youtube_dl/extractor/pladform.py
@@
-1,11
+1,14
@@
# coding: utf-8
from __future__ import unicode_literals
# coding: utf-8
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_text,
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_text,
+ qualities,
)
)
@@
-29,9
+32,9
@@
class PladformIE(InfoExtractor):
'info_dict': {
'id': '100183293',
'ext': 'mp4',
'info_dict': {
'id': '100183293',
'ext': 'mp4',
- 'title': 'Тайны перевала Дятлова •
Тайна перевала Дятлова
1 серия 2 часть',
+ 'title': 'Тайны перевала Дятлова • 1 серия 2 часть',
'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
- 'thumbnail': 're:^https?://.*\.jpg$',
+ 'thumbnail':
r
're:^https?://.*\.jpg$',
'duration': 694,
'age_limit': 0,
},
'duration': 694,
'age_limit': 0,
},
@@
-43,6
+46,13
@@
class PladformIE(InfoExtractor):
'only_matching': True,
}]
'only_matching': True,
}]
+ @staticmethod
+ def _extract_url(webpage):
+ mobj = re.search(
+ r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//out\.pladform\.ru/player\?.+?)\1', webpage)
+ if mobj:
+ return mobj.group('url')
+
def _real_extract(self, url):
video_id = self._match_id(url)
def _real_extract(self, url):
video_id = self._match_id(url)
@@
-55,9
+65,12
@@
class PladformIE(InfoExtractor):
'%s returned error: %s' % (self.IE_NAME, video.text),
expected=True)
'%s returned error: %s' % (self.IE_NAME, video.text),
expected=True)
+ quality = qualities(('ld', 'sd', 'hd'))
+
formats = [{
'url': src.text,
'format_id': src.get('quality'),
formats = [{
'url': src.text,
'format_id': src.get('quality'),
+ 'quality': quality(src.get('quality')),
} for src in video.findall('./src')]
self._sort_formats(formats)
} for src in video.findall('./src')]
self._sort_formats(formats)