2 from __future__ import unicode_literals
4 from .common import InfoExtractor
9 class TwitcastingIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:(?:www|ssl|en|pt|es|ja|ko)\.)?twitcasting\.tv/(?P<uploader_id>[^\/]+)/movie/(?P<video_id>[0-9]+)'
12 'url': 'https://twitcasting.tv/ivetesangalo/movie/2357609',
13 'md5': '745243cad58c4681dc752490f7540d7f',
17 'title': 'Recorded Live #2357609',
18 'uploader_id': 'ivetesangalo',
19 'description': "Moi! I'm live on TwitCasting from my iPhone.",
20 'thumbnail': r're:^https?://.*\.jpg$',
24 def _real_extract(self, url):
25 mobj = re.match(self._VALID_URL, url)
26 video_id = mobj.group('video_id')
27 uploader_id = mobj.group('uploader_id')
29 webpage = self._download_webpage(url, video_id)
31 playlist_url = self._html_search_regex(r'(["\'])(?P<url>http.+?\.m3u8.*?)\1', webpage, name='playlist url', group='url')
32 formats = self._extract_m3u8_formats(playlist_url, video_id, ext='mp4')
33 thumbnail = self._og_search_thumbnail(webpage)
34 title = self._html_search_meta('twitter:title', webpage)
35 description = self._og_search_description(webpage) or self._html_search_meta('twitter:description', webpage)
40 'description': description,
41 'thumbnail': thumbnail,
42 'uploader_id': uploader_id,