2014-07-22 09:34:34 -06:00
from __future__ import unicode_literals
2013-12-15 19:53:43 -07:00
from . common import InfoExtractor
class CBSIE ( InfoExtractor ) :
2014-07-22 09:34:34 -06:00
_VALID_URL = r ' https?://(?:www \ .)?cbs \ .com/shows/[^/]+/(?:video|artist)/(?P<id>[^/]+)/.* '
2013-12-15 19:53:43 -07:00
2014-07-22 08:56:42 -06:00
_TESTS = [ {
2014-07-22 09:34:34 -06:00
' url ' : ' http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/ ' ,
' info_dict ' : {
' id ' : ' 4JUVEwq3wUT7 ' ,
' ext ' : ' flv ' ,
' title ' : ' Connect Chat feat. Garth Brooks ' ,
' description ' : ' Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS! ' ,
' duration ' : 1495 ,
2013-12-15 19:53:43 -07:00
} ,
2014-07-22 09:34:34 -06:00
' params ' : {
2013-12-15 19:53:43 -07:00
# rtmp download
2014-07-22 09:34:34 -06:00
' skip_download ' : True ,
2013-12-15 19:53:43 -07:00
} ,
2014-07-22 09:34:34 -06:00
' _skip ' : ' Blocked outside the US ' ,
2014-07-22 08:56:42 -06:00
} , {
2014-07-22 09:34:34 -06:00
' url ' : ' http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/ ' ,
' info_dict ' : {
2014-08-27 05:41:24 -06:00
' id ' : ' WWF_5KqY3PK1 ' ,
2014-07-22 09:34:34 -06:00
' ext ' : ' flv ' ,
' title ' : ' Live on Letterman - St. Vincent ' ,
' description ' : ' Live On Letterman: St. Vincent in concert from New York \' s Ed Sullivan Theater on Tuesday, July 16, 2014. ' ,
' duration ' : 3221 ,
2014-07-22 08:56:42 -06:00
} ,
2014-07-22 09:34:34 -06:00
' params ' : {
2014-07-22 08:56:42 -06:00
# rtmp download
2014-07-22 09:34:34 -06:00
' skip_download ' : True ,
2014-07-22 08:56:42 -06:00
} ,
2014-07-22 09:34:34 -06:00
' _skip ' : ' Blocked outside the US ' ,
2014-07-22 08:56:42 -06:00
} ]
2013-12-15 19:53:43 -07:00
def _real_extract ( self , url ) :
2015-02-18 17:22:50 -07:00
video_id = self . _match_id ( url )
2013-12-15 19:53:43 -07:00
webpage = self . _download_webpage ( url , video_id )
real_id = self . _search_regex (
r " video \ .settings \ .pid \ s*= \ s* ' ([^ ' ]+) ' ; " ,
2014-07-22 09:34:34 -06:00
webpage , ' real video ID ' )
2014-11-26 05:06:02 -07:00
return self . url_result ( ' theplatform: %s ' % real_id )