1 from .common
import InfoExtractor
9 class PornoVoisinesIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?pornovoisines\.com/videos/show/(?P<id>\d+)/(?P<display_id>[^/.]+)'
14 'url': 'http://www.pornovoisines.com/videos/show/919/recherche-appartement.html',
15 'md5': '6f8aca6a058592ab49fe701c8ba8317b',
18 'display_id': 'recherche-appartement',
20 'title': 'Recherche appartement',
21 'description': 'md5:fe10cb92ae2dd3ed94bb4080d11ff493',
22 'thumbnail': r
're:^https?://.*\.jpg$',
23 'upload_date': '20140925',
26 'average_rating': float,
27 'categories': ['Débutante', 'Débutantes', 'Scénario', 'Sodomie'],
37 def _real_extract(self
, url
):
38 mobj
= self
._match
_valid
_url
(url
)
39 video_id
= mobj
.group('id')
40 display_id
= mobj
.group('display_id')
42 settings_url
= self
._download
_json
(
43 f
'http://www.pornovoisines.com/api/video/{video_id}/getsettingsurl/',
44 video_id
, note
='Getting settings URL')['video_settings_url']
45 settings
= self
._download
_json
(settings_url
, video_id
)['data']
48 for kind
, data
in settings
['variants'].items():
50 formats
.extend(self
._extract
_m
3u8_formats
(
51 data
, video_id
, ext
='mp4', entry_protocol
='m3u8_native', m3u8_id
='hls'))
56 'height': item
.get('height'),
57 'bitrate': item
.get('bitrate'),
60 webpage
= self
._download
_webpage
(url
, video_id
)
62 title
= self
._og
_search
_title
(webpage
)
63 description
= self
._og
_search
_description
(webpage
)
65 # The webpage has a bug - there's no space between "thumb" and src=
66 thumbnail
= self
._html
_search
_regex
(
67 r
'<img[^>]+class=([\'"])thumb\1[^>]*src=([\'"])(?P
<url
>[^
"]+)\2',
68 webpage, 'thumbnail', fatal=False, group='url')
70 upload_date = unified_strdate(self._search_regex(
71 r'Le\s*<b>([\d/]+)', webpage, 'upload date', fatal=False))
72 duration = settings.get('main', {}).get('duration')
73 view_count = int_or_none(self._search_regex(
74 r'(\d+) vues', webpage, 'view count', fatal=False))
75 average_rating = self._search_regex(
76 r'Note\s*:\s*(\d+(?:,\d+)?)', webpage, 'average rating', fatal=False)
78 average_rating = float_or_none(average_rating.replace(',', '.'))
80 categories = self._html_search_regex(
81 r'(?s)Catégories\s*:\s*<b>(.+?)</b>', webpage, 'categories', fatal=False)
83 categories = [category.strip() for category in categories.split(',')]
87 } for subtitle in settings.get('main', {}).get('vtt_tracks', {}).values()]}
91 'display_id': display_id,
94 'description': description,
95 'thumbnail': thumbnail,
96 'upload_date': upload_date,
98 'view_count': view_count,
99 'average_rating': average_rating,
100 'categories': categories,
102 'subtitles': subtitles,