]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/morningstar.py
2 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class MorningstarIE(InfoExtractor
):
9 IE_DESC
= 'morningstar.com'
10 _VALID_URL
= r
'https?://(?:(?:www|news)\.)morningstar\.com/[cC]over/video[cC]enter\.aspx\?id=(?P<id>[0-9]+)'
12 'url': 'http://www.morningstar.com/cover/videocenter.aspx?id=615869',
13 'md5': '6c0acface7a787aadc8391e4bbf7b0f5',
17 'title': 'Get Ahead of the Curve on 2013 Taxes',
18 'description': "Vanguard's Joel Dickson on managing higher tax rates for high-income earners and fund capital-gain distributions in 2013.",
19 'thumbnail': r
're:^https?://.*m(?:orning)?star\.com/.+thumb\.jpg$'
22 'url': 'http://news.morningstar.com/cover/videocenter.aspx?id=825556',
23 'only_matching': True,
26 def _real_extract(self
, url
):
27 mobj
= self
._match
_valid
_url
(url
)
28 video_id
= mobj
.group('id')
30 webpage
= self
._download
_webpage
(url
, video_id
)
31 title
= self
._html
_search
_regex
(
32 r
'<h1 id="titleLink">(.*?)</h1>', webpage
, 'title')
33 video_url
= self
._html
_search
_regex
(
34 r
'<input type="hidden" id="hidVideoUrl" value="([^"]+)"',
36 thumbnail
= self
._html
_search
_regex
(
37 r
'<input type="hidden" id="hidSnapshot" value="([^"]+)"',
38 webpage
, 'thumbnail', fatal
=False)
39 description
= self
._html
_search
_regex
(
40 r
'<div id="mstarDeck".*?>(.*?)</div>',
41 webpage
, 'description', fatal
=False)
47 'thumbnail': thumbnail
,
48 'description': description
,