1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-24 16:55:51 +00:00

[sexykarma] Add support for watchindianporn

This commit is contained in:
Sergey M 2014-10-19 01:53:15 +07:00
parent 4510d14f0a
commit 16efb3695f

View file

@ -12,7 +12,8 @@ from ..utils import (
class SexyKarmaIE(InfoExtractor): class SexyKarmaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sexykarma\.com/gonewild/video/(?P<display_id>[^/]+)-(?P<id>[a-zA-Z0-9]+)\.html' IE_DESC = 'Sexy Karma and Watch Indian Porn'
_VALID_URL = r'https?://(?:www\.)?(?:sexykarma\.com|watchindianporn\.net)/(?:[^/]+/)*video/(?P<display_id>[^/]+)-(?P<id>[a-zA-Z0-9]+)\.html'
_TESTS = [{ _TESTS = [{
'url': 'http://www.sexykarma.com/gonewild/video/taking-a-quick-pee-yHI70cOyIHt.html', 'url': 'http://www.sexykarma.com/gonewild/video/taking-a-quick-pee-yHI70cOyIHt.html',
'md5': 'b9798e7d1ef1765116a8f516c8091dbd', 'md5': 'b9798e7d1ef1765116a8f516c8091dbd',
@ -21,11 +22,10 @@ class SexyKarmaIE(InfoExtractor):
'display_id': 'taking-a-quick-pee', 'display_id': 'taking-a-quick-pee',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Taking a quick pee.', 'title': 'Taking a quick pee.',
'description': '',
'thumbnail': 're:^https?://.*\.jpg$', 'thumbnail': 're:^https?://.*\.jpg$',
'uploader': 'wildginger7', 'uploader': 'wildginger7',
'upload_date': '20141007', 'upload_date': '20141007',
'duration': 81, 'duration': 22,
'view_count': int, 'view_count': int,
'comment_count': int, 'comment_count': int,
'categories': list, 'categories': list,
@ -38,7 +38,6 @@ class SexyKarmaIE(InfoExtractor):
'display_id': 'pot-pixie-tribute', 'display_id': 'pot-pixie-tribute',
'ext': 'mp4', 'ext': 'mp4',
'title': 'pot_pixie tribute', 'title': 'pot_pixie tribute',
'description': 'tribute',
'thumbnail': 're:^https?://.*\.jpg$', 'thumbnail': 're:^https?://.*\.jpg$',
'uploader': 'banffite', 'uploader': 'banffite',
'upload_date': '20141013', 'upload_date': '20141013',
@ -47,6 +46,22 @@ class SexyKarmaIE(InfoExtractor):
'comment_count': int, 'comment_count': int,
'categories': list, 'categories': list,
} }
}, {
'url': 'http://www.watchindianporn.net/video/desi-dancer-namrata-stripping-completely-nude-and-dancing-on-a-hot-number-dW2mtctxJfs.html',
'md5': '9afb80675550406ed9a63ac2819ef69d',
'info_dict': {
'id': 'dW2mtctxJfs',
'display_id': 'desi-dancer-namrata-stripping-completely-nude-and-dancing-on-a-hot-number',
'ext': 'mp4',
'title': 'Desi dancer namrata stripping completely nude and dancing on a hot number',
'thumbnail': 're:^https?://.*\.jpg$',
'uploader': 'Don',
'upload_date': '20140213',
'duration': 83,
'view_count': int,
'comment_count': int,
'categories': list,
}
}] }]
def _real_extract(self, url): def _real_extract(self, url):
@ -57,14 +72,11 @@ class SexyKarmaIE(InfoExtractor):
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
video_url = self._html_search_regex( video_url = self._html_search_regex(
r'<p>Save this video to your computer: </p><p><a href="([^"]+)"', r"url: escape\('([^']+)'\)", webpage, 'url')
webpage, 'url')
title = self._html_search_regex( title = self._html_search_regex(
r'<h2 class="he2"><span>(.*?)</span>', r'<h2 class="he2"><span>(.*?)</span>',
webpage, 'title') webpage, 'title')
description = self._html_search_meta(
'description', webpage, 'description', fatal=False, default='')
thumbnail = self._html_search_regex( thumbnail = self._html_search_regex(
r'<span id="container"><img\s+src="([^"]+)"', r'<span id="container"><img\s+src="([^"]+)"',
webpage, 'thumbnail', fatal=False) webpage, 'thumbnail', fatal=False)
@ -86,16 +98,15 @@ class SexyKarmaIE(InfoExtractor):
r'<td>Comments:\s*</td>\s*<td align="right"><span>\s*(\d+)\s*</span>', r'<td>Comments:\s*</td>\s*<td align="right"><span>\s*(\d+)\s*</span>',
webpage, 'comment count', fatal=False)) webpage, 'comment count', fatal=False))
categories = self._html_search_meta( categories = re.findall(
'keywords', webpage, 'categories', r'<a href="[^"]+/search/video/desi"><span>([^<]+)</span></a>',
fatal=False, default='').split(',') webpage)
return { return {
'id': video_id, 'id': video_id,
'display_id': display_id, 'display_id': display_id,
'url': video_url, 'url': video_url,
'title': title, 'title': title,
'description': description,
'thumbnail': thumbnail, 'thumbnail': thumbnail,
'uploader': uploader, 'uploader': uploader,
'upload_date': upload_date, 'upload_date': upload_date,