]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/manyvids.py
1 from .common
import InfoExtractor
10 class ManyVidsIE(InfoExtractor
):
11 _VALID_URL
= r
'(?i)https?://(?:www\.)?manyvids\.com/video/(?P<id>\d+)'
14 'url': 'https://www.manyvids.com/Video/133957/everthing-about-me/',
15 'md5': '03f11bb21c52dd12a05be21a5c7dcc97',
19 'title': 'everthing about me (Preview)',
25 'url': 'https://www.manyvids.com/Video/935718/MY-FACE-REVEAL/',
26 'md5': 'f3e8f7086409e9b470e2643edb96bdcc',
30 'title': 'MY FACE REVEAL',
36 def _real_extract(self
, url
):
37 video_id
= self
._match
_id
(url
)
39 webpage
= self
._download
_webpage
(url
, video_id
)
41 video_url
= self
._search
_regex
(
42 r
'data-(?:video-filepath|meta-video)\s*=s*(["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1',
43 webpage, 'video URL
', group='url
')
45 title = self._html_search_regex(
46 (r'<span
[^
>]+class=["\']item-title[^>]+>([^<]+)',
47 r'<h2[^>]+class=["\']h2 m
-0["\'][^>]*>([^<]+)'),
48 webpage, 'title', default=None) or self._html_search_meta(
49 'twitter:title', webpage, 'title', fatal=True)
51 if any(p in webpage for p in ('preview_videos', '_preview.mp4')):
54 mv_token = self._search_regex(
55 r'data-mvtoken=(["\'])(?P
<value
>(?
:(?
!\
1).)+)\
1', webpage,
56 'mv token
', default=None, group='value
')
60 self._download_webpage(
61 'https
://www
.manyvids
.com
/includes
/ajax_repository
/you_had_me_at_hello
.php
',
62 video_id, fatal=False, data=urlencode_postdata({
67 'X
-Requested
-With
': 'XMLHttpRequest
'
70 if determine_ext(video_url) == 'm3u8
':
71 formats = self._extract_m3u8_formats(
72 video_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
75 formats = [{'url': video_url}]
77 like_count = int_or_none(self._search_regex(
78 r'data
-likes
=["\'](\d+)', webpage, 'like count', default=None))
79 view_count = str_to_int(self._html_search_regex(
80 r'(?s)<span[^>]+class="views
-wrapper
"[^>]*>(.+?)</span', webpage,
81 'view count', default=None))
86 'view_count': view_count,
87 'like_count': like_count,
89 'uploader': self._html_search_regex(r'<meta[^>]+name="author
"[^>]*>([^<]+)', webpage, 'uploader'),