mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 12:40:11 +09:00
[telecinco] Add extractor (closes #4005)
It uses the same extraction process as mitele.es, but with a few small differences.
This commit is contained in:
parent
75da98e9e1
commit
ad5f53ac72
@ -367,6 +367,7 @@ from .teachingchannel import TeachingChannelIE
|
|||||||
from .teamcoco import TeamcocoIE
|
from .teamcoco import TeamcocoIE
|
||||||
from .techtalks import TechTalksIE
|
from .techtalks import TechTalksIE
|
||||||
from .ted import TEDIE
|
from .ted import TEDIE
|
||||||
|
from .telecinco import TelecincoIE
|
||||||
from .telemb import TeleMBIE
|
from .telemb import TeleMBIE
|
||||||
from .tenplay import TenPlayIE
|
from .tenplay import TenPlayIE
|
||||||
from .testurl import TestURLIE
|
from .testurl import TestURLIE
|
||||||
|
@ -39,13 +39,21 @@ class MiTeleIE(InfoExtractor):
|
|||||||
).replace('\'', '"')
|
).replace('\'', '"')
|
||||||
embed_data = json.loads(embed_data_json)
|
embed_data = json.loads(embed_data_json)
|
||||||
|
|
||||||
info_url = embed_data['flashvars']['host']
|
domain = embed_data['mediaUrl']
|
||||||
|
if not domain.startswith('http'):
|
||||||
|
# only happens in telecinco.es videos
|
||||||
|
domain = 'http://' + domain
|
||||||
|
info_url = compat_urllib_parse.urljoin(
|
||||||
|
domain,
|
||||||
|
compat_urllib_parse.unquote(embed_data['flashvars']['host'])
|
||||||
|
)
|
||||||
info_el = self._download_xml(info_url, episode).find('./video/info')
|
info_el = self._download_xml(info_url, episode).find('./video/info')
|
||||||
|
|
||||||
video_link = info_el.find('videoUrl/link').text
|
video_link = info_el.find('videoUrl/link').text
|
||||||
token_query = compat_urllib_parse.urlencode({'id': video_link})
|
token_query = compat_urllib_parse.urlencode({'id': video_link})
|
||||||
token_info = self._download_json(
|
token_info = self._download_json(
|
||||||
'http://token.mitele.es/?' + token_query, episode,
|
embed_data['flashvars']['ov_tk'] + '?' + token_query,
|
||||||
|
episode,
|
||||||
transform_source=strip_jsonp
|
transform_source=strip_jsonp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
18
youtube_dl/extractor/telecinco.py
Normal file
18
youtube_dl/extractor/telecinco.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .mitele import MiTeleIE
|
||||||
|
|
||||||
|
|
||||||
|
class TelecincoIE(MiTeleIE):
|
||||||
|
IE_NAME = 'telecinco.es'
|
||||||
|
_VALID_URL = r'https?://www\.telecinco\.es/[^/]+/[^/]+/[^/]+/(?P<episode>.*?)\.html'
|
||||||
|
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.telecinco.es/robinfood/temporada-01/t01xp14/Bacalao-cocochas-pil-pil_0_1876350223.html',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'MDSVID20141015_0058',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Con Martín Berasategui, hacer un bacalao al ...',
|
||||||
|
'duration': 662,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user