]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/cbslocal.py
2 from __future__
import unicode_literals
4 from . anvato
import AnvatoIE
5 from . sendtonews
import SendtoNewsIE
6 from .. compat
import compat_urlparse
13 class CBSLocalIE ( AnvatoIE
):
14 _VALID_URL_BASE
= r
'https?://[a-z]+\.cbslocal\.com/'
15 _VALID_URL
= _VALID_URL_BASE
+ r
'video/(?P<id>\d+)'
18 'url' : 'http://newyork.cbslocal.com/video/3580809-a-very-blue-anniversary/' ,
22 'title' : 'A Very Blue Anniversary' ,
23 'description' : 'CBS2’s Cindy Hsu has more.' ,
24 'thumbnail' : 're:^https?://.*' ,
26 'upload_date' : r
're:^\d {8} $' ,
32 'Stations \\ Spoken Word \\ WCBSTV' ,
38 'Content \\ News \\ Local News' ,
40 'tags' : [ 'CBS 2 News Weekends' , 'Cindy Hsu' , 'Blue Man Group' ],
43 'skip_download' : True ,
47 def _real_extract ( self
, url
):
48 mcp_id
= self
._ match
_ id
( url
)
49 return self
. url_result (
50 'anvato:anvato_cbslocal_app_web_prod_547f3e49241ef0e5d30c79b2efbca5d92c698f67:' + mcp_id
, 'Anvato' , mcp_id
)
53 class CBSLocalArticleIE ( AnvatoIE
):
54 _VALID_URL
= CBSLocalIE
._ VALID
_U RL
_ BASE
+ r
'\d+/\d+/\d+/(?P<id>[0-9a-z-]+)'
58 'url' : 'http://losangeles.cbslocal.com/2016/05/16/safety-advocates-say-fatal-car-seat-failures-are-public-health-crisis' ,
59 'md5' : 'f0ee3081e3843f575fccef901199b212' ,
63 'title' : 'Safety Advocates Say Fatal Car Seat Failures Are \' Public Health Crisis \' ' ,
64 'description' : 'Collapsing seats have been the focus of scrutiny for decades, though experts say remarkably little has been done to address the issue. Randy Paige reports.' ,
65 'thumbnail' : 're:^https?://.*' ,
66 'timestamp' : 1463440500 ,
67 'upload_date' : '20160516' ,
73 'Stations \\ Spoken Word \\ KCBSTV' ,
78 'Syndication \\ Tribune' ,
79 'Syndication \\ Curb.tv' ,
82 'tags' : [ 'CBS 2 News Evening' ],
86 'url' : 'http://cleveland.cbslocal.com/2016/05/16/indians-score-season-high-15-runs-in-blowout-win-over-reds-rapid-reaction/' ,
88 'id' : 'GxfCe0Zo7D-175909-5588' ,
93 'skip_download' : True ,
97 def _real_extract ( self
, url
):
98 display_id
= self
._ match
_ id
( url
)
99 webpage
= self
._ download
_ webpage
( url
, display_id
)
101 sendtonews_url
= SendtoNewsIE
._ extract
_u rl
( webpage
)
103 return self
. url_result (
104 compat_urlparse
. urljoin ( url
, sendtonews_url
),
105 ie
= SendtoNewsIE
. ie_key ())
107 info_dict
= self
._ extract
_ anvato
_ videos
( webpage
, display_id
)
109 timestamp
= unified_timestamp ( self
._ html
_ search
_ regex
(
110 r
'class="(?:entry|post)-date"[^>]*>([^<]+)' , webpage
,
111 'released date' , default
= None )) or parse_iso8601 (
112 self
._ html
_ search
_ meta
( 'uploadDate' , webpage
))
115 'display_id' : display_id
,
116 'timestamp' : timestamp
,