1 from __future__ import unicode_literals
3 from .common import InfoExtractor
11 class AdobeTVIE(InfoExtractor):
12 _VALID_URL = r'https?://tv\.adobe\.com/watch/[^/]+/(?P<id>[^/]+)'
15 'url': 'http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/quick-tip-how-to-draw-a-circle-around-an-object-in-photoshop/',
16 'md5': '9bc5727bcdd55251f35ad311ca74fa1e',
18 'id': 'quick-tip-how-to-draw-a-circle-around-an-object-in-photoshop',
20 'title': 'Quick Tip - How to Draw a Circle Around an Object in Photoshop',
21 'description': 'md5:99ec318dc909d7ba2a1f2b038f7d2311',
22 'thumbnail': 're:https?://.*\.jpg$',
23 'upload_date': '20110914',
29 def _real_extract(self, url):
30 video_id = self._match_id(url)
31 webpage = self._download_webpage(url, video_id)
33 player = self._parse_json(
34 self._search_regex(r'html5player:\s*({.+?})\s*\n', webpage, 'player'),
37 title = player.get('title') or self._search_regex(
38 r'data-title="([^"]+)"', webpage, 'title')
39 description = self._og_search_description(webpage)
40 thumbnail = self._og_search_thumbnail(webpage)
42 upload_date = unified_strdate(
43 self._html_search_meta('datepublished', webpage, 'upload date'))
45 duration = parse_duration(
46 self._html_search_meta('duration', webpage, 'duration') or
48 r'Runtime:\s*(\d{2}:\d{2}:\d{2})',
49 webpage, 'duration', fatal=False))
51 view_count = str_to_int(self._search_regex(
52 r'<div class="views">\s*Views?:\s*([\d,.]+)\s*</div>',
53 webpage, 'view count'))
57 'format_id': source.get('quality') or source['src'].split('-')[-1].split('.')[0] or None,
58 'tbr': source.get('bitrate'),
59 } for source in player['sources']]
60 self._sort_formats(formats)
65 'description': description,
66 'thumbnail': thumbnail,
67 'upload_date': upload_date,
69 'view_count': view_count,