2 from __future__ import unicode_literals
4 from .common import InfoExtractor
12 class ComCarCoffIE(InfoExtractor):
13 _VALID_URL = r'http://(?:www\.)?comediansincarsgettingcoffee\.com/(?P<id>[a-z0-9\-]*)'
15 'url': 'http://comediansincarsgettingcoffee.com/miranda-sings-happy-thanksgiving-miranda/',
17 'id': 'miranda-sings-happy-thanksgiving-miranda',
19 'upload_date': '20141127',
20 'timestamp': 1417107600,
22 'title': 'Happy Thanksgiving Miranda',
23 'description': 'Jerry Seinfeld and his special guest Miranda Sings cruise around town in search of coffee, complaining and apologizing along the way.',
24 'thumbnail': 'http://ccc.crackle.com/images/s5e4_thumb.jpg',
27 'skip_download': 'requires ffmpeg',
31 def _real_extract(self, url):
32 display_id = self._match_id(url)
34 display_id = 'comediansincarsgettingcoffee.com'
35 webpage = self._download_webpage(url, display_id)
37 full_data = self._parse_json(
39 r'window\.app\s*=\s*({.+?});\n', webpage, 'full data json'),
40 display_id)['videoData']
42 video_id = full_data['activeVideo']['video']
43 video_data = full_data.get('videos', {}).get(video_id) or full_data['singleshots'][video_id]
45 'url': video_data['images']['thumb'],
47 'url': video_data['images']['poster'],
49 formats = self._extract_m3u8_formats(
50 video_data['mediaUrl'], video_id, ext='mp4')
52 timestamp = int_or_none(video_data.get('pubDateTime')) or parse_iso8601(
53 video_data.get('pubDate'))
54 duration = int_or_none(video_data.get('durationSeconds')) or parse_duration(
55 video_data.get('duration'))
59 'display_id': display_id,
60 'title': video_data['title'],
61 'description': video_data.get('description'),
62 'timestamp': timestamp,
64 'thumbnails': thumbnails,
66 'webpage_url': 'http://comediansincarsgettingcoffee.com/%s' % (video_data.get('urlSlug', video_data.get('slug'))),