]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/cbslocal.py
1 from . anvato
import AnvatoIE
2 from . sendtonews
import SendtoNewsIE
3 from .. compat
import compat_urlparse
10 class CBSLocalIE ( AnvatoIE
):
11 _VALID_URL_BASE
= r
'https?://[a-z]+\.cbslocal\.com/'
12 _VALID_URL
= _VALID_URL_BASE
+ r
'video/(?P<id>\d+)'
15 'url' : 'http://newyork.cbslocal.com/video/3580809-a-very-blue-anniversary/' ,
19 'title' : 'A Very Blue Anniversary' ,
20 'description' : 'CBS2’s Cindy Hsu has more.' ,
21 'thumbnail' : 're:^https?://.*' ,
23 'upload_date' : r
're:^\d {8} $' ,
29 'Stations \\ Spoken Word \\ WCBSTV' ,
35 'Content \\ News \\ Local News' ,
37 'tags' : [ 'CBS 2 News Weekends' , 'Cindy Hsu' , 'Blue Man Group' ],
40 'skip_download' : True ,
44 def _real_extract ( self
, url
):
45 mcp_id
= self
._ match
_ id
( url
)
46 return self
. url_result (
47 'anvato:anvato_cbslocal_app_web_prod_547f3e49241ef0e5d30c79b2efbca5d92c698f67:' + mcp_id
, 'Anvato' , mcp_id
)
50 class CBSLocalArticleIE ( AnvatoIE
):
51 _VALID_URL
= CBSLocalIE
._ VALID
_U RL
_ BASE
+ r
'\d+/\d+/\d+/(?P<id>[0-9a-z-]+)'
55 'url' : 'http://losangeles.cbslocal.com/2016/05/16/safety-advocates-say-fatal-car-seat-failures-are-public-health-crisis' ,
56 'md5' : 'f0ee3081e3843f575fccef901199b212' ,
60 'title' : 'Safety Advocates Say Fatal Car Seat Failures Are \' Public Health Crisis \' ' ,
61 '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.' ,
62 'thumbnail' : 're:^https?://.*' ,
63 'timestamp' : 1463440500 ,
64 'upload_date' : '20160516' ,
70 'Stations \\ Spoken Word \\ KCBSTV' ,
75 'Syndication \\ Tribune' ,
76 'Syndication \\ Curb.tv' ,
79 'tags' : [ 'CBS 2 News Evening' ],
83 'url' : 'http://cleveland.cbslocal.com/2016/05/16/indians-score-season-high-15-runs-in-blowout-win-over-reds-rapid-reaction/' ,
85 'id' : 'GxfCe0Zo7D-175909-5588' ,
90 'skip_download' : True ,
94 def _real_extract ( self
, url
):
95 display_id
= self
._ match
_ id
( url
)
96 webpage
= self
._ download
_ webpage
( url
, display_id
)
98 sendtonews_url
= SendtoNewsIE
._ extract
_u rl
( webpage
)
100 return self
. url_result (
101 compat_urlparse
. urljoin ( url
, sendtonews_url
),
102 ie
= SendtoNewsIE
. ie_key ())
104 info_dict
= self
._ extract
_ anvato
_ videos
( webpage
, display_id
)
106 timestamp
= unified_timestamp ( self
._ html
_ search
_ regex
(
107 r
'class="(?:entry|post)-date"[^>]*>([^<]+)' , webpage
,
108 'released date' , default
= None )) or parse_iso8601 (
109 self
._ html
_ search
_ meta
( 'uploadDate' , webpage
))
112 'display_id' : display_id
,
113 'timestamp' : timestamp
,