[EOnline] Improvements
This commit is contained in:
parent
d713c33c4a
commit
7faf6c258c
@ -2,20 +2,20 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from .common import InfoExtractor
|
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
smuggle_url,
|
smuggle_url,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
)
|
)
|
||||||
|
|
||||||
class EOnlineIE(InfoExtractor):
|
class EOnlineIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?eonline\.com/[a-z]{2}(?:/[a-z-]+){3}/[0-9]+/(?P<display_id>[a-z-]+)'
|
_VALID_URL = r'https?://(?:www\.)?eonline\.com/[a-z]{2}(?:/[a-z-]+){3}/(?P<id>[0-9]+)/(?P<display_id>[a-z-]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.eonline.com/uk/shows/botched/videos/249184/transgender-woman-takes-a-trip-to-her-past',
|
'url': 'http://www.eonline.com/uk/shows/botched/videos/249184/transgender-woman-takes-a-trip-to-her-past',
|
||||||
'md5': '1ca5b36c4337fde2b65207e0ad0c11c0',
|
'md5': '1ca5b36c4337fde2b65207e0ad0c11c0',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'C872_ktn4Rgc',
|
'id': '249184',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Transgender Woman Takes a Trip to Her Past',
|
'title': 'Transgender Woman Takes a Trip to Her Past',
|
||||||
'description': 'md5:621feda5e84d5d4a29f4cc26faa33d24',
|
'description': 'md5:621feda5e84d5d4a29f4cc26faa33d24',
|
||||||
@ -27,16 +27,21 @@ class EOnlineIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
display_id = mobj.group('display_id')
|
video_id, display_id = mobj.group('id', 'display_id')
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
release_url = self._search_regex(r'"videoSourceUrl"\s*:\s*"(.+)"',
|
data = self._parse_json(self._search_regex(
|
||||||
webpage, 'ThePlatform ID')
|
r'evideo.videos.detail\s*=\s*(\[\s*\{[^\]]+]);',
|
||||||
|
webpage, 'JSON data'), display_id)
|
||||||
|
|
||||||
|
for entry in data:
|
||||||
|
if entry['id'] == video_id:
|
||||||
|
release_url = entry['videoSourceUrl']
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'url_transparent',
|
'_type': 'url_transparent',
|
||||||
'ie_key': 'ThePlatform',
|
'ie_key': 'ThePlatform',
|
||||||
'url': smuggle_url(update_url_query(release_url, {'mbr': 'true', 'switch': 'http'}),
|
'url': smuggle_url(update_url_query(release_url, {'mbr': True, 'switch': 'http'}), {'force_smil_url': True}),
|
||||||
{'force_smil_url': True}),
|
'id': video_id,
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user