]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/jpopsukitv.py
4b5f346d1ef909e286b5c0555ab07a6e20bc11d4
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
11 class JpopsukiIE(InfoExtractor
):
12 IE_NAME
= 'jpopsuki.tv'
13 _VALID_URL
= r
'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)'
16 'url': 'http://www.jpopsuki.tv/video/ayumi-hamasaki---evolution/00be659d23b0b40508169cdee4545771',
17 'md5': '88018c0c1a9b1387940e90ec9e7e198e',
19 'id': '00be659d23b0b40508169cdee4545771',
21 'title': 'ayumi hamasaki - evolution',
22 'description': 'Release date: 2001.01.31\r\n浜崎あゆみ - evolution',
23 'thumbnail': 'http://www.jpopsuki.tv/cache/89722c74d2a2ebe58bcac65321c115b2.jpg',
24 'uploader': 'plama_chan',
26 'upload_date': '20121101'
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
33 webpage
= self
._download
_webpage
(url
, video_id
)
35 video_url
= 'http://www.jpopsuki.tv' + self
._html
_search
_regex
(
36 r
'<source src="(.*?)" type', webpage
, 'video url')
38 video_title
= self
._og
_search
_title
(webpage
)
39 description
= self
._og
_search
_description
(webpage
)
40 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
41 uploader
= self
._html
_search
_regex
(
42 r
'<li>from: <a href="/user/view/user/(.*?)/uid/',
43 webpage
, 'video uploader', fatal
=False)
44 uploader_id
= self
._html
_search
_regex
(
45 r
'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
46 webpage
, 'video uploader_id', fatal
=False)
47 upload_date
= unified_strdate(self
._html
_search
_regex
(
48 r
'<li>uploaded: (.*?)</li>', webpage
, 'video upload_date',
50 view_count_str
= self
._html
_search
_regex
(
51 r
'<li>Hits: ([0-9]+?)</li>', webpage
, 'video view_count',
53 comment_count_str
= self
._html
_search
_regex
(
54 r
'<h2>([0-9]+?) comments</h2>', webpage
, 'video comment_count',
61 'description': description
,
62 'thumbnail': thumbnail
,
64 'uploader_id': uploader_id
,
65 'upload_date': upload_date
,
66 'view_count': int_or_none(view_count_str
),
67 'comment_count': int_or_none(comment_count_str
),