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)
32 webpage = self._download_webpage(url, video_id)
34 player = self._parse_json(
35 self._search_regex(r'html5player:\s*({.+?})\s*\n', webpage, 'player'),
38 title = player.get('title') or self._search_regex(
39 r'data-title="([^"]+)"', webpage, 'title')
40 description = self._og_search_description(webpage)
41 thumbnail = self._og_search_thumbnail(webpage)
43 upload_date = unified_strdate(
44 self._html_search_meta('datepublished', webpage, 'upload date'))
46 duration = parse_duration(
47 self._html_search_meta('duration', webpage, 'duration')
48 or self._search_regex(r'Runtime:\s*(\d{2}:\d{2}:\d{2})', webpage, 'duration'))
50 view_count = str_to_int(self._search_regex(
51 r'<div class="views">\s*Views?:\s*([\d,.]+)\s*</div>',
52 webpage, 'view count'))
56 'format_id': source.get('quality') or source['src'].split('-')[-1].split('.')[0] or None,
57 'tbr': source.get('bitrate'),
58 } for source in player['sources']]
59 self._sort_formats(formats)
64 'description': description,
65 'thumbnail': thumbnail,
66 'upload_date': upload_date,
68 'view_count': view_count,