1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-23 03:32:52 +08:00
youtube-dl/youtube_dl/extractor/eroprofile.py

46 lines
1.4 KiB
Python
Raw Normal View History

2014-12-27 00:15:34 +08:00
from __future__ import unicode_literals
from .common import InfoExtractor
2014-12-27 01:32:41 +08:00
2014-12-27 00:15:34 +08:00
class EroProfileIE(InfoExtractor):
2014-12-27 01:32:41 +08:00
_VALID_URL = r'https?://(?:www\.)?eroprofile\.com/m/videos/view/(?P<id>[^/]+)'
2014-12-27 00:15:34 +08:00
_TEST = {
'url': 'http://www.eroprofile.com/m/videos/view/sexy-babe-softcore',
'md5': 'c26f351332edf23e1ea28ce9ec9de32f',
'info_dict': {
'id': '3733775',
2014-12-27 01:32:41 +08:00
'display_id': 'sexy-babe-softcore',
2014-12-27 00:15:34 +08:00
'ext': 'm4v',
2014-12-27 01:32:41 +08:00
'title': 'sexy babe softcore',
2014-12-27 00:15:34 +08:00
'thumbnail': 're:https?://.*\.jpg',
'age_limit': 18,
}
}
def _real_extract(self, url):
2014-12-27 01:32:41 +08:00
display_id = self._match_id(url)
2014-12-27 00:15:34 +08:00
2014-12-27 01:32:41 +08:00
webpage = self._download_webpage(url, display_id)
2014-12-27 00:15:34 +08:00
2014-12-27 01:32:41 +08:00
video_id = self._search_regex(
[r"glbUpdViews\s*\('\d*','(\d+)'", r'p/report/video/(\d+)'],
webpage, 'video id', default=None)
2014-12-27 00:15:34 +08:00
2014-12-27 01:32:41 +08:00
video_url = self._search_regex(
r'<source src="([^"]+)', webpage, 'video url')
2014-12-27 00:15:34 +08:00
title = self._html_search_regex(
2014-12-27 01:32:41 +08:00
r'Title:</th><td>([^<]+)</td>', webpage, 'title')
thumbnail = self._search_regex(
r'onclick="showVideoPlayer\(\)"><img src="([^"]+)',
webpage, 'thumbnail', fatal=False)
2014-12-27 00:15:34 +08:00
return {
'id': video_id,
2014-12-27 01:32:41 +08:00
'display_id': display_id,
2014-12-27 00:15:34 +08:00
'url': video_url,
'title': title,
'thumbnail': thumbnail,
'age_limit': 18,
}