2024-06-11 19:09:58 -04:00
|
|
|
import urllib.parse
|
|
|
|
|
2014-07-09 06:14:53 -04:00
|
|
|
from .common import InfoExtractor
|
|
|
|
from ..utils import (
|
2014-12-12 06:55:13 -05:00
|
|
|
parse_duration,
|
2014-07-09 06:14:53 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class GoshgayIE(InfoExtractor):
|
2016-09-08 07:29:05 -04:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?goshgay\.com/video(?P<id>\d+?)($|/)'
|
2014-07-09 06:14:53 -04:00
|
|
|
_TEST = {
|
2014-12-12 06:55:13 -05:00
|
|
|
'url': 'http://www.goshgay.com/video299069/diesel_sfw_xxx_video',
|
2016-04-12 05:23:00 -04:00
|
|
|
'md5': '4b6db9a0a333142eb9f15913142b0ed1',
|
2014-07-09 06:14:53 -04:00
|
|
|
'info_dict': {
|
2014-12-12 06:55:13 -05:00
|
|
|
'id': '299069',
|
2014-07-09 06:14:53 -04:00
|
|
|
'ext': 'flv',
|
2014-12-12 06:55:13 -05:00
|
|
|
'title': 'DIESEL SFW XXX Video',
|
2017-01-02 07:08:07 -05:00
|
|
|
'thumbnail': r're:^http://.*\.jpg$',
|
2016-04-12 05:23:00 -04:00
|
|
|
'duration': 80,
|
2014-07-11 05:01:59 -04:00
|
|
|
'age_limit': 18,
|
2024-06-11 19:09:58 -04:00
|
|
|
},
|
2014-07-09 06:14:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2014-11-05 18:19:20 -05:00
|
|
|
video_id = self._match_id(url)
|
2014-07-09 06:14:53 -04:00
|
|
|
webpage = self._download_webpage(url, video_id)
|
2014-12-12 06:44:32 -05:00
|
|
|
|
2014-12-12 06:55:13 -05:00
|
|
|
title = self._html_search_regex(
|
|
|
|
r'<h2>(.*?)<', webpage, 'title')
|
|
|
|
duration = parse_duration(self._html_search_regex(
|
|
|
|
r'<span class="duration">\s*-?\s*(.*?)</span>',
|
|
|
|
webpage, 'duration', fatal=False))
|
2014-07-09 06:14:53 -04:00
|
|
|
|
2024-06-11 19:09:58 -04:00
|
|
|
flashvars = urllib.parse.parse_qs(self._html_search_regex(
|
2014-12-12 06:55:13 -05:00
|
|
|
r'<embed.+?id="flash-player-embed".+?flashvars="([^"]+)"',
|
|
|
|
webpage, 'flashvars'))
|
|
|
|
thumbnail = flashvars.get('url_bigthumb', [None])[0]
|
|
|
|
video_url = flashvars['flv_url'][0]
|
2014-07-09 06:14:53 -04:00
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'url': video_url,
|
|
|
|
'title': title,
|
|
|
|
'thumbnail': thumbnail,
|
2014-12-12 06:55:13 -05:00
|
|
|
'duration': duration,
|
2016-04-12 05:23:00 -04:00
|
|
|
'age_limit': 18,
|
2014-07-09 06:14:53 -04:00
|
|
|
}
|