2 from ..utils import unified_strdate
3 from .common import InfoExtractor
6 class JpopsukiIE(InfoExtractor):
7 IE_NAME = u'jpopsuki.tv'
8 _VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/video/(.*?)/(?P<id>\S+)'
11 u'url': u'http://www.jpopsuki.tv/video/ayumi-hamasaki---evolution/00be659d23b0b40508169cdee4545771',
12 u'md5': u'88018c0c1a9b1387940e90ec9e7e198e',
13 u'file': u'00be659d23b0b40508169cdee4545771.mp4',
15 u'id': u'00be659d23b0b40508169cdee4545771',
16 u'title': u'ayumi hamasaki - evolution',
17 'description': u'Release date: 2001.01.31\r 浜崎あゆみ - evolution',
18 'thumbnail': u'http://www.jpopsuki.tv/cache/89722c74d2a2ebe58bcac65321c115b2.jpg',
19 'uploader': u'plama_chan',
20 'uploader_id': u'404',
21 'upload_date': u'20121101'
25 def _real_extract(self, url):
26 mobj = re.match(self._VALID_URL, url)
27 video_id = mobj.group('id')
29 webpage = self._download_webpage(url, video_id)
31 video_url = 'http://www.jpopsuki.tv' + self._html_search_regex(
32 r'<source src="(.*?)" type', webpage, u'video url')
34 video_title = self._html_search_regex(
35 r'<meta name="og:title" content="(.*?)" />', webpage, u'video title')
36 description = self._html_search_regex(
37 r'<meta name="og:description" content="(.*?)" />', webpage, u'video description', flags=re.DOTALL)
38 thumbnail = self._html_search_regex(
39 r'<meta name="og:image" content="(.*?)" />', webpage, u'video thumbnail')
40 uploader = self._html_search_regex(
41 r'<li>from: <a href="/user/view/user/(.*?)/uid/', webpage, u'video uploader')
42 uploader_id = self._html_search_regex(
43 r'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)', webpage, u'video uploader_id')
44 upload_date = self._html_search_regex(
45 r'<li>uploaded: (.*?)</li>', webpage, u'video upload_date')
46 if upload_date is not None:
47 upload_date = unified_strdate(upload_date)
48 view_count = self._html_search_regex(
49 r'<li>Hits: (\d*?)</li>', webpage, u'video view_count')
50 comment_count = self._html_search_regex(
51 r'<h2>(\d*?) comments</h2>', webpage, u'video comment_count')
57 'description': description,
58 'thumbnail': thumbnail,
60 'uploader_id': uploader_id,
61 'upload_date': upload_date,
62 'view_count': view_count,
63 'comment_count': comment_count,