]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/pornovoisines.py
1 from .common
import InfoExtractor
9 class PornoVoisinesIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?pornovoisines\.com/videos/show/(?P<id>\d+)/(?P<display_id>[^/.]+)'
13 'url': 'http://www.pornovoisines.com/videos/show/919/recherche-appartement.html',
14 'md5': '6f8aca6a058592ab49fe701c8ba8317b',
17 'display_id': 'recherche-appartement',
19 'title': 'Recherche appartement',
20 'description': 'md5:fe10cb92ae2dd3ed94bb4080d11ff493',
21 'thumbnail': r
're:^https?://.*\.jpg$',
22 'upload_date': '20140925',
25 'average_rating': float,
26 'categories': ['Débutante', 'Débutantes', 'Scénario', 'Sodomie'],
36 def _real_extract(self
, url
):
37 mobj
= self
._match
_valid
_url
(url
)
38 video_id
= mobj
.group('id')
39 display_id
= mobj
.group('display_id')
41 settings_url
= self
._download
_json
(
42 'http://www.pornovoisines.com/api/video/%s/getsettingsurl/' % video_id
,
43 video_id
, note
='Getting settings URL')['video_settings_url']
44 settings
= self
._download
_json
(settings_url
, video_id
)['data']
47 for kind
, data
in settings
['variants'].items():
49 formats
.extend(self
._extract
_m
3u8_formats
(
50 data
, video_id
, ext
='mp4', entry_protocol
='m3u8_native', m3u8_id
='hls'))
55 'height': item
.get('height'),
56 'bitrate': item
.get('bitrate'),
59 webpage
= self
._download
_webpage
(url
, video_id
)
61 title
= self
._og
_search
_title
(webpage
)
62 description
= self
._og
_search
_description
(webpage
)
64 # The webpage has a bug - there's no space between "thumb" and src=
65 thumbnail
= self
._html
_search
_regex
(
66 r
'<img[^>]+class=([\'"])thumb\1[^>]*src=([\'"])(?P
<url
>[^
"]+)\2',
67 webpage, 'thumbnail', fatal=False, group='url')
69 upload_date = unified_strdate(self._search_regex(
70 r'Le\s*<b>([\d/]+)', webpage, 'upload date', fatal=False))
71 duration = settings.get('main', {}).get('duration')
72 view_count = int_or_none(self._search_regex(
73 r'(\d+) vues', webpage, 'view count', fatal=False))
74 average_rating = self._search_regex(
75 r'Note\s*:\s*(\d+(?:,\d+)?)', webpage, 'average rating', fatal=False)
77 average_rating = float_or_none(average_rating.replace(',', '.'))
79 categories = self._html_search_regex(
80 r'(?s)Catégories\s*:\s*<b>(.+?)</b>', webpage, 'categories', fatal=False)
82 categories = [category.strip() for category in categories.split(',')]
86 } for subtitle in settings.get('main', {}).get('vtt_tracks', {}).values()]}
90 'display_id': display_id,
93 'description': description,
94 'thumbnail': thumbnail,
95 'upload_date': upload_date,
97 'view_count': view_count,
98 'average_rating': average_rating,
99 'categories': categories,
101 'subtitles': subtitles,