]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/comcarcoff.py
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
7 from .. utils
import parse_iso8601
10 class ComCarCoffIE ( InfoExtractor
):
11 _VALID_URL
= r
'http://(?:www\.)?comediansincarsgettingcoffee\.com/(?P<id>[a-z0-9\-]*)'
13 'url' : 'http://comediansincarsgettingcoffee.com/miranda-sings-happy-thanksgiving-miranda/' ,
15 'id' : 'miranda-sings-happy-thanksgiving-miranda' ,
17 'upload_date' : '20141127' ,
18 'timestamp' : 1417107600 ,
19 'title' : 'Happy Thanksgiving Miranda' ,
20 'description' : 'Jerry Seinfeld and his special guest Miranda Sings cruise around town in search of coffee, complaining and apologizing along the way.' ,
21 'thumbnail' : 'http://ccc.crackle.com/images/s5e4_thumb.jpg' ,
24 'skip_download' : 'requires ffmpeg' ,
28 def _real_extract ( self
, url
):
29 display_id
= self
._ match
_ id
( url
)
31 display_id
= 'comediansincarsgettingcoffee.com'
32 webpage
= self
._ download
_ webpage
( url
, display_id
)
34 full_data
= json
. loads ( self
._ search
_ regex
(
35 r
'<script type="application/json" id="videoData">(?P<json>.+?)</script>' ,
36 webpage
, 'full data json' ))
38 video_id
= full_data
[ 'activeVideo' ][ 'video' ]
39 video_data
= full_data
. get ( 'videos' , {}). get ( video_id
) or full_data
[ 'singleshots' ][ video_id
]
41 'url' : video_data
[ 'images' ][ 'thumb' ],
43 'url' : video_data
[ 'images' ][ 'poster' ],
45 formats
= self
._ extract
_ m
3u8_ formats
(
46 video_data
[ 'mediaUrl' ], video_id
, ext
= 'mp4' )
50 'display_id' : display_id
,
51 'title' : video_data
[ 'title' ],
52 'description' : video_data
. get ( 'description' ),
53 'timestamp' : parse_iso8601 ( video_data
. get ( 'pubDate' )),
54 'thumbnails' : thumbnails
,
56 'webpage_url' : 'http://comediansincarsgettingcoffee.com/ %s ' % ( video_data
. get ( 'urlSlug' , video_data
. get ( 'slug' ))),