2014-01-27 01:55:30 -05:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2014-01-24 19:46:52 -05:00
|
|
|
from .common import InfoExtractor
|
2015-12-08 10:56:00 -05:00
|
|
|
from ..utils import int_or_none
|
2014-02-02 06:03:36 -05:00
|
|
|
|
2014-01-24 19:46:52 -05:00
|
|
|
|
2014-09-04 00:40:15 -04:00
|
|
|
_translation_table = {
|
2014-01-27 06:39:39 -05:00
|
|
|
'a': 'h', 'd': 'e', 'e': 'v', 'f': 'o', 'g': 'f', 'i': 'd', 'l': 'n',
|
|
|
|
'm': 'a', 'n': 'm', 'p': 'u', 'q': 't', 'r': 's', 'v': 'p', 'x': 'r',
|
|
|
|
'y': 'l', 'z': 'i',
|
|
|
|
'$': ':', '&': '.', '(': '=', '^': '&', '=': '/',
|
|
|
|
}
|
2014-01-24 19:46:52 -05:00
|
|
|
|
|
|
|
|
2014-09-04 00:40:15 -04:00
|
|
|
def _decode(s):
|
|
|
|
return ''.join(_translation_table.get(c, c) for c in s)
|
|
|
|
|
|
|
|
|
2014-01-24 19:46:52 -05:00
|
|
|
class CliphunterIE(InfoExtractor):
|
2014-01-27 01:55:30 -05:00
|
|
|
IE_NAME = 'cliphunter'
|
2014-01-24 19:46:52 -05:00
|
|
|
|
2016-03-21 11:36:32 -04:00
|
|
|
_VALID_URL = r'''(?x)https?://(?:www\.)?cliphunter\.com/w/
|
2014-01-27 06:39:39 -05:00
|
|
|
(?P<id>[0-9]+)/
|
|
|
|
(?P<seo>.+?)(?:$|[#\?])
|
|
|
|
'''
|
2016-07-15 12:04:30 -04:00
|
|
|
_TESTS = [{
|
2014-01-27 01:55:30 -05:00
|
|
|
'url': 'http://www.cliphunter.com/w/1012420/Fun_Jynx_Maze_solo',
|
2015-01-23 14:22:49 -05:00
|
|
|
'md5': 'b7c9bbd4eb3a226ab91093714dcaa480',
|
2014-01-27 01:55:30 -05:00
|
|
|
'info_dict': {
|
2014-09-04 00:40:15 -04:00
|
|
|
'id': '1012420',
|
2015-01-23 14:22:49 -05:00
|
|
|
'ext': 'flv',
|
2014-01-27 01:55:30 -05:00
|
|
|
'title': 'Fun Jynx Maze solo',
|
2017-01-02 07:08:07 -05:00
|
|
|
'thumbnail': r're:^https?://.*\.jpg$',
|
2014-09-04 00:40:15 -04:00
|
|
|
'age_limit': 18,
|
2016-07-15 12:04:30 -04:00
|
|
|
},
|
|
|
|
'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',
|
2017-01-02 07:08:07 -05:00
|
|
|
'thumbnail': r're:^https?://.*\.jpg$',
|
2016-07-15 12:04:30 -04:00
|
|
|
'age_limit': 18,
|
|
|
|
},
|
|
|
|
}]
|
2014-01-24 19:46:52 -05:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2014-10-26 18:13:42 -04:00
|
|
|
video_id = self._match_id(url)
|
2014-01-24 19:46:52 -05:00
|
|
|
webpage = self._download_webpage(url, video_id)
|
|
|
|
|
2014-09-04 00:40:15 -04:00
|
|
|
video_title = self._search_regex(
|
|
|
|
r'mediaTitle = "([^"]+)"', webpage, 'title')
|
|
|
|
|
2015-12-08 10:56:00 -05:00
|
|
|
gexo_files = self._parse_json(
|
|
|
|
self._search_regex(
|
|
|
|
r'var\s+gexoFiles\s*=\s*({.+?});', webpage, 'gexo files'),
|
|
|
|
video_id)
|
2015-01-23 14:22:49 -05:00
|
|
|
|
|
|
|
formats = []
|
2015-12-08 10:56:00 -05:00
|
|
|
for format_id, f in gexo_files.items():
|
|
|
|
video_url = f.get('url')
|
|
|
|
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({
|
|
|
|
'url': _decode(video_url),
|
|
|
|
'format_id': format_id,
|
|
|
|
'width': int_or_none(f.get('w')),
|
|
|
|
'height': int_or_none(height),
|
|
|
|
'tbr': int_or_none(f.get('br')),
|
|
|
|
})
|
2014-09-04 00:40:15 -04:00
|
|
|
self._sort_formats(formats)
|
|
|
|
|
|
|
|
thumbnail = self._search_regex(
|
|
|
|
r"var\s+mov_thumb\s*=\s*'([^']+)';",
|
|
|
|
webpage, 'thumbnail', fatal=False)
|
|
|
|
|
2014-01-24 19:46:52 -05:00
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'title': video_title,
|
|
|
|
'formats': formats,
|
2014-09-04 00:40:15 -04:00
|
|
|
'age_limit': self._rta_search(webpage),
|
|
|
|
'thumbnail': thumbnail,
|
2014-01-24 19:46:52 -05:00
|
|
|
}
|