1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

Add support for AnySex

This commit is contained in:
peugeot 2014-08-30 18:37:45 +02:00
parent 08a36c3569
commit 72c65d39ff
2 changed files with 43 additions and 0 deletions

View File

@ -4,6 +4,7 @@
from .adultswim import AdultSwimIE
from .aftonbladet import AftonbladetIE
from .anitube import AnitubeIE
from .anysex import AnySexIE
from .aol import AolIE
from .allocine import AllocineIE
from .aparat import AparatIE

View File

@ -0,0 +1,42 @@
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class AnySexIE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?anysex\.com/(?P<id>\d+)/?'
_TEST = {
'url': 'http://anysex.com/156592/',
'md5': '023e9fbb7f7987f5529a394c34ad3d3d',
'info_dict': {
'id': '156592',
'ext': 'mp4',
'title': 'Busty and sexy blondie in her bikini strips for you',
'duration': 270
}
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title')
video_url = self._html_search_regex(r'video_url: \'(.*?)\',', webpage, 'video_url')
thumbnail = self._html_search_regex(r'preview_url: \'(.*?)\',', webpage, 'thumbnail')
mobj = re.search(r'<b>Duration:</b> (?P<minutes>\d+):(?P<seconds>\d+)<', webpage)
duration = int(mobj.group('minutes')) * 60 + int(mobj.group('seconds')) if mobj else None
view_count = self._html_search_regex(r'<b>Views:</b> (\d+)', webpage, 'view count', fatal=False)
return {
'id': video_id,
'ext': 'mp4',
'url': video_url,
'title': title,
'duration': duration,
'view_count': view_count
}