2014-12-26 08:49:12 -06:00
|
|
|
from __future__ import unicode_literals
|
2014-12-29 09:33:41 -06:00
|
|
|
|
2014-12-26 08:49:12 -06:00
|
|
|
from .common import InfoExtractor
|
2014-12-29 09:33:41 -06:00
|
|
|
from ..utils import (
|
2020-03-20 12:59:48 -05:00
|
|
|
int_or_none,
|
|
|
|
merge_dicts,
|
2014-12-29 09:33:41 -06:00
|
|
|
remove_end,
|
2020-03-20 12:59:48 -05:00
|
|
|
unified_timestamp,
|
2014-12-29 09:33:41 -06:00
|
|
|
)
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2014-12-29 03:38:07 -06:00
|
|
|
|
2014-12-26 08:49:12 -06:00
|
|
|
class HellPornoIE(InfoExtractor):
|
2016-11-19 17:12:22 -06:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?hellporno\.(?:com/videos|net/v)/(?P<id>[^/]+)'
|
|
|
|
_TESTS = [{
|
2014-12-26 08:49:12 -06:00
|
|
|
'url': 'http://hellporno.com/videos/dixie-is-posing-with-naked-ass-very-erotic/',
|
2020-03-20 12:59:48 -05:00
|
|
|
'md5': 'f0a46ebc0bed0c72ae8fe4629f7de5f3',
|
2014-12-26 08:49:12 -06:00
|
|
|
'info_dict': {
|
|
|
|
'id': '149116',
|
2014-12-29 03:38:07 -06:00
|
|
|
'display_id': 'dixie-is-posing-with-naked-ass-very-erotic',
|
2014-12-26 08:49:12 -06:00
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'Dixie is posing with naked ass very erotic',
|
2020-03-20 12:59:48 -05:00
|
|
|
'description': 'md5:9a72922749354edb1c4b6e540ad3d215',
|
|
|
|
'categories': list,
|
2017-01-02 06:08:07 -06:00
|
|
|
'thumbnail': r're:https?://.*\.jpg$',
|
2020-03-20 12:59:48 -05:00
|
|
|
'duration': 240,
|
|
|
|
'timestamp': 1398762720,
|
|
|
|
'upload_date': '20140429',
|
|
|
|
'view_count': int,
|
2014-12-26 08:49:12 -06:00
|
|
|
'age_limit': 18,
|
2020-03-20 12:59:48 -05:00
|
|
|
},
|
2016-11-19 17:12:22 -06:00
|
|
|
}, {
|
|
|
|
'url': 'http://hellporno.net/v/186271/',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2014-12-26 08:49:12 -06:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2014-12-29 03:38:07 -06:00
|
|
|
display_id = self._match_id(url)
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2014-12-29 09:33:41 -06:00
|
|
|
webpage = self._download_webpage(url, display_id)
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2014-12-29 09:33:41 -06:00
|
|
|
title = remove_end(self._html_search_regex(
|
|
|
|
r'<title>([^<]+)</title>', webpage, 'title'), ' - Hell Porno')
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2020-03-20 12:59:48 -05:00
|
|
|
info = self._parse_html5_media_entries(url, webpage, display_id)[0]
|
|
|
|
self._sort_formats(info['formats'])
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2020-03-20 12:59:48 -05:00
|
|
|
video_id = self._search_regex(
|
|
|
|
(r'chs_object\s*=\s*["\'](\d+)',
|
|
|
|
r'params\[["\']video_id["\']\]\s*=\s*(\d+)'), webpage, 'video id',
|
|
|
|
default=display_id)
|
|
|
|
description = self._search_regex(
|
|
|
|
r'class=["\']desc_video_view_v2[^>]+>([^<]+)', webpage,
|
|
|
|
'description', fatal=False)
|
|
|
|
categories = [
|
|
|
|
c.strip()
|
|
|
|
for c in self._html_search_meta(
|
|
|
|
'keywords', webpage, 'categories', default='').split(',')
|
|
|
|
if c.strip()]
|
|
|
|
duration = int_or_none(self._og_search_property(
|
|
|
|
'video:duration', webpage, fatal=False))
|
|
|
|
timestamp = unified_timestamp(self._og_search_property(
|
|
|
|
'video:release_date', webpage, fatal=False))
|
|
|
|
view_count = int_or_none(self._search_regex(
|
|
|
|
r'>Views\s+(\d+)', webpage, 'view count', fatal=False))
|
2014-12-26 08:49:12 -06:00
|
|
|
|
2020-03-20 12:59:48 -05:00
|
|
|
return merge_dicts(info, {
|
2014-12-26 08:49:12 -06:00
|
|
|
'id': video_id,
|
2014-12-29 03:38:07 -06:00
|
|
|
'display_id': display_id,
|
2014-12-26 08:49:12 -06:00
|
|
|
'title': title,
|
2020-03-20 12:59:48 -05:00
|
|
|
'description': description,
|
2014-12-26 08:49:12 -06:00
|
|
|
'categories': categories,
|
2020-03-20 12:59:48 -05:00
|
|
|
'duration': duration,
|
|
|
|
'timestamp': timestamp,
|
|
|
|
'view_count': view_count,
|
2014-12-26 08:49:12 -06:00
|
|
|
'age_limit': 18,
|
2020-03-20 12:59:48 -05:00
|
|
|
})
|