1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-18 08:16:10 +00:00
youtube-dl/youtube_dl/extractor/mrgay.py

44 lines
1.4 KiB
Python
Raw Normal View History

# coding: utf-8
from __future__ import unicode_literals
from .vxxx import VXXXIE
class MrGayIE(VXXXIE):
_VALID_URL = r'https?://mrgay\.com/video/(?P<id>\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'],
2022-10-02 10:50:56 +00:00
'age_limit': 18,
}
}]
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'