From ba4c5b3a2e466a6c8f881b27a1a35ca12ef01f10 Mon Sep 17 00:00:00 2001 From: tabjy Date: Sun, 2 Oct 2022 05:48:44 -0400 Subject: [PATCH] [VXXX] Support "friend" site: inporn.com --- youtube_dl/extractor/bdsmxtube.py | 3 +++ youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/inporn.py | 41 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 youtube_dl/extractor/inporn.py diff --git a/youtube_dl/extractor/bdsmxtube.py b/youtube_dl/extractor/bdsmxtube.py index a7c5299ed..590e2f0a1 100644 --- a/youtube_dl/extractor/bdsmxtube.py +++ b/youtube_dl/extractor/bdsmxtube.py @@ -1,3 +1,6 @@ +# coding: utf-8 +from __future__ import unicode_literals + from .vxxx import VXXXIE diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 3eb9a11c8..a6be263bf 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -521,6 +521,7 @@ from .instagram import ( ) from .internazionale import InternazionaleIE from .internetvideoarchive import InternetVideoArchiveIE +from .inporn import InPornIE from .iprima import IPrimaIE from .iqiyi import IqiyiIE from .ir90tv import Ir90TvIE diff --git a/youtube_dl/extractor/inporn.py b/youtube_dl/extractor/inporn.py new file mode 100644 index 000000000..4bc5e052e --- /dev/null +++ b/youtube_dl/extractor/inporn.py @@ -0,0 +1,41 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .vxxx import VXXXIE + + +class InPornIE(VXXXIE): + _VALID_URL = r'https?://(?:www\.)?inporn\.com/video/(?P\d+)' + _TESTS = [{ + 'url': 'https://inporn.com/video/533613/2k-t-2nd-season-parm-151/', + 'md5': '111e5c4680b1fa5995144e101c521a4f', + 'info_dict': { + 'id': '533613', + 'ext': 'mp4', + 'title': '2k 美月まい - ガーリー系アパレルモt゙ルの挑発パンチラ 2nd Season [parm-151]', + 'display_id': '2k-t-2nd-season-parm-151', + 'thumbnail': 'https://tn.inporn.com/media/tn/533613_1.jpg', + 'description': '', + 'timestamp': 1664571262, + 'upload_date': '20220930', + 'duration': 480.0, + 'categories': ['Asian', 'Brunette', 'Casting', 'HD', 'Japanese', + 'JAV Uncensored']} + }] + + def _download_info_object(self, video_id): + return self._download_json( + 'https://inporn.com/api/json/video/86400/0/{}/{}.json'.format( + int(video_id) // 1000 * 1000, + video_id, + ), video_id, headers={'Referer': 'https://inporn.com'})['video'] + + def _download_format_object(self, video_id): + return self._download_json( + 'https://inporn.com/api/videofile.php?video_id={}'.format(video_id), + video_id, + headers={'Referer': 'https://inporn.com'} + ) + + def _get_video_host(self): + return 'inporn.com'