diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:49:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:49:24 +0000 |
commit | 2415e66f889f38503b73e8ebc5f43ca342390e5c (patch) | |
tree | ac48ab69d1d96bae3d83756134921e0d90593aa5 /yt_dlp/extractor/goshgay.py | |
parent | Initial commit. (diff) | |
download | yt-dlp-2415e66f889f38503b73e8ebc5f43ca342390e5c.tar.xz yt-dlp-2415e66f889f38503b73e8ebc5f43ca342390e5c.zip |
Adding upstream version 2024.03.10.upstream/2024.03.10
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/goshgay.py')
-rw-r--r-- | yt_dlp/extractor/goshgay.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/yt_dlp/extractor/goshgay.py b/yt_dlp/extractor/goshgay.py new file mode 100644 index 0000000..9a1f32b --- /dev/null +++ b/yt_dlp/extractor/goshgay.py @@ -0,0 +1,48 @@ +from .common import InfoExtractor +from ..compat import ( + compat_parse_qs, +) +from ..utils import ( + parse_duration, +) + + +class GoshgayIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?goshgay\.com/video(?P<id>\d+?)($|/)' + _TEST = { + 'url': 'http://www.goshgay.com/video299069/diesel_sfw_xxx_video', + 'md5': '4b6db9a0a333142eb9f15913142b0ed1', + 'info_dict': { + 'id': '299069', + 'ext': 'flv', + 'title': 'DIESEL SFW XXX Video', + 'thumbnail': r're:^http://.*\.jpg$', + 'duration': 80, + 'age_limit': 18, + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + 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)) + + flashvars = compat_parse_qs(self._html_search_regex( + r'<embed.+?id="flash-player-embed".+?flashvars="([^"]+)"', + webpage, 'flashvars')) + thumbnail = flashvars.get('url_bigthumb', [None])[0] + video_url = flashvars['flv_url'][0] + + return { + 'id': video_id, + 'url': video_url, + 'title': title, + 'thumbnail': thumbnail, + 'duration': duration, + 'age_limit': 18, + } |