mirror of https://github.com/yt-dlp/yt-dlp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.4 KiB
Python
77 lines
2.4 KiB
Python
11 years ago
|
from .common import InfoExtractor
|
||
6 years ago
|
from ..utils import (
|
||
|
int_or_none,
|
||
|
url_or_none,
|
||
|
)
|
||
10 years ago
|
|
||
|
|
||
11 years ago
|
class CliphunterIE(InfoExtractor):
|
||
11 years ago
|
IE_NAME = 'cliphunter'
|
||
11 years ago
|
|
||
9 years ago
|
_VALID_URL = r'''(?x)https?://(?:www\.)?cliphunter\.com/w/
|
||
11 years ago
|
(?P<id>[0-9]+)/
|
||
|
(?P<seo>.+?)(?:$|[#\?])
|
||
|
'''
|
||
8 years ago
|
_TESTS = [{
|
||
11 years ago
|
'url': 'http://www.cliphunter.com/w/1012420/Fun_Jynx_Maze_solo',
|
||
10 years ago
|
'md5': 'b7c9bbd4eb3a226ab91093714dcaa480',
|
||
11 years ago
|
'info_dict': {
|
||
10 years ago
|
'id': '1012420',
|
||
10 years ago
|
'ext': 'flv',
|
||
11 years ago
|
'title': 'Fun Jynx Maze solo',
|
||
8 years ago
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||
10 years ago
|
'age_limit': 18,
|
||
8 years ago
|
},
|
||
|
'skip': 'Video gone',
|
||
|
}, {
|
||
|
'url': 'http://www.cliphunter.com/w/2019449/ShesNew__My_booty_girlfriend_Victoria_Paradices_pussy_filled_with_jizz',
|
||
|
'md5': '55a723c67bfc6da6b0cfa00d55da8a27',
|
||
|
'info_dict': {
|
||
|
'id': '2019449',
|
||
|
'ext': 'mp4',
|
||
|
'title': 'ShesNew - My booty girlfriend, Victoria Paradice\'s pussy filled with jizz',
|
||
8 years ago
|
'thumbnail': r're:^https?://.*\.jpg$',
|
||
8 years ago
|
'age_limit': 18,
|
||
|
},
|
||
|
}]
|
||
11 years ago
|
|
||
|
def _real_extract(self, url):
|
||
10 years ago
|
video_id = self._match_id(url)
|
||
11 years ago
|
webpage = self._download_webpage(url, video_id)
|
||
|
|
||
10 years ago
|
video_title = self._search_regex(
|
||
|
r'mediaTitle = "([^"]+)"', webpage, 'title')
|
||
|
|
||
9 years ago
|
gexo_files = self._parse_json(
|
||
|
self._search_regex(
|
||
|
r'var\s+gexoFiles\s*=\s*({.+?});', webpage, 'gexo files'),
|
||
|
video_id)
|
||
10 years ago
|
|
||
|
formats = []
|
||
9 years ago
|
for format_id, f in gexo_files.items():
|
||
6 years ago
|
video_url = url_or_none(f.get('url'))
|
||
9 years ago
|
if not video_url:
|
||
|
continue
|
||
|
fmt = f.get('fmt')
|
||
|
height = f.get('h')
|
||
|
format_id = '%s_%sp' % (fmt, height) if fmt and height else format_id
|
||
|
formats.append({
|
||
6 years ago
|
'url': video_url,
|
||
9 years ago
|
'format_id': format_id,
|
||
|
'width': int_or_none(f.get('w')),
|
||
|
'height': int_or_none(height),
|
||
|
'tbr': int_or_none(f.get('br')),
|
||
|
})
|
||
10 years ago
|
|
||
|
thumbnail = self._search_regex(
|
||
|
r"var\s+mov_thumb\s*=\s*'([^']+)';",
|
||
|
webpage, 'thumbnail', fatal=False)
|
||
|
|
||
11 years ago
|
return {
|
||
|
'id': video_id,
|
||
|
'title': video_title,
|
||
|
'formats': formats,
|
||
10 years ago
|
'age_limit': self._rta_search(webpage),
|
||
|
'thumbnail': thumbnail,
|
||
11 years ago
|
}
|