summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/goshgay.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:37:42 +0000
commitc7bab7c39fd51c0812f70020172766303191bc01 (patch)
tree56c05fbdd4fc47409d48ba318a4b621a7b0d299a /yt_dlp/extractor/goshgay.py
parentInitial commit. (diff)
downloadyt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.tar.xz
yt-dlp-c7bab7c39fd51c0812f70020172766303191bc01.zip
Adding upstream version 2023.03.04.upstream/2023.03.04upstream
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.py48
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,
+ }