From f2398c00702c2266b5824c41069b39ea821b4789 Mon Sep 17 00:00:00 2001 From: tabjy Date: Sun, 2 Oct 2022 06:41:08 -0400 Subject: [PATCH] [VXXX] Support "friend" site: mrgay.com --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/mrgay.py | 42 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 youtube_dl/extractor/mrgay.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index f06fdf60a..95cd463d0 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -675,6 +675,7 @@ from .metacritic import MetacriticIE from .mgoon import MgoonIE from .mgtv import MGTVIE from .miaopai import MiaoPaiIE +from .mrgay import MrGayIE from .microsoftvirtualacademy import ( MicrosoftVirtualAcademyIE, MicrosoftVirtualAcademyCourseIE, diff --git a/youtube_dl/extractor/mrgay.py b/youtube_dl/extractor/mrgay.py new file mode 100644 index 000000000..8d44463ab --- /dev/null +++ b/youtube_dl/extractor/mrgay.py @@ -0,0 +1,42 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .vxxx import VXXXIE + + +class MrGayIE(VXXXIE): + _VALID_URL = r'https?://mrgay\.com/video/(?P\d+)' + _TESTS = [{ + 'url': 'https://mrgay.com/video/10169199/jpn-crossdresser-6/', + 'md5': 'b2ff401f8a168007702f3f5cbecd7bc2', + 'info_dict': { + 'id': '10169199', + 'ext': 'mp4', + 'title': 'Jpn Crossdresser 6', + 'display_id': 'jpn-crossdresser-6', + 'thumbnail': 'https://tn.mrgay.com/media/tn/10169199_1.jpg', + 'description': '', + 'timestamp': 1651066888, + 'upload_date': '20220427', + 'duration': 834.0, + 'categories': ['Amateur', 'Asian', 'Brunette', 'Crossdressing', + 'Japanese', 'Webcam'], + } + }] + + def _download_info_object(self, video_id): + return self._download_json( + 'https://mrgay.com/api/json/video/86400/0/{}/{}.json'.format( + int(video_id) // 1000 * 1000, + video_id, + ), video_id, headers={'Referer': 'https://mrgay.com'})['video'] + + def _download_format_object(self, video_id): + return self._download_json( + 'https://mrgay.com/api/videofile.php?video_id={}'.format(video_id), + video_id, + headers={'Referer': 'https://mrgay.com'} + ) + + def _get_video_host(self): + return 'mrgay.com'