aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoises Lima <mozlima@users.noreply.github.com>2022-01-07 09:06:09 -0300
committerGitHub <noreply@github.com>2022-01-07 17:36:09 +0530
commit768145d48a65eefd31b0a75e06fb3b1297cfa0da (patch)
treed02c8dc1e47241a5d0315edb5160a8ee02b5fa84
parent976ae3eabb4893f4768b381c6ba32e911303bc1c (diff)
downloadhypervideo-pre-768145d48a65eefd31b0a75e06fb3b1297cfa0da.tar.lz
hypervideo-pre-768145d48a65eefd31b0a75e06fb3b1297cfa0da.tar.xz
hypervideo-pre-768145d48a65eefd31b0a75e06fb3b1297cfa0da.zip
[Pornez] Add extractor (#2236)
Authored by: mozlima
-rw-r--r--yt_dlp/extractor/extractors.py1
-rw-r--r--yt_dlp/extractor/pornez.py43
2 files changed, 44 insertions, 0 deletions
diff --git a/yt_dlp/extractor/extractors.py b/yt_dlp/extractor/extractors.py
index 8231fa2b9..cb506dbb9 100644
--- a/yt_dlp/extractor/extractors.py
+++ b/yt_dlp/extractor/extractors.py
@@ -1183,6 +1183,7 @@ from .pornhub import (
from .pornotube import PornotubeIE
from .pornovoisines import PornoVoisinesIE
from .pornoxo import PornoXOIE
+from .pornez import PornezIE
from .puhutv import (
PuhuTVIE,
PuhuTVSerieIE,
diff --git a/yt_dlp/extractor/pornez.py b/yt_dlp/extractor/pornez.py
new file mode 100644
index 000000000..713dc0080
--- /dev/null
+++ b/yt_dlp/extractor/pornez.py
@@ -0,0 +1,43 @@
+# coding: utf-8
+from __future__ import unicode_literals
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class PornezIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornez\.net/video(?P<id>[0-9]+)/'
+ _TEST = {
+ 'url': 'https://pornez.net/video344819/mistresst-funny_penis_names-wmv/',
+ 'md5': '2e19a0a1cff3a5dbea0ef1b9e80bcbbc',
+ 'info_dict': {
+ 'id': '344819',
+ 'ext': 'mp4',
+ 'title': r'mistresst funny_penis_names wmv',
+ 'thumbnail': r're:^https?://.*\.jpg$',
+ 'age_limit': 18,
+ }
+ }
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+ iframe_src = self._html_search_regex(
+ r'<iframe[^>]+src="(https?://pornez\.net/player/\?[^"]+)"', webpage, 'iframe', fatal=True)
+ title = self._html_search_meta(['name', 'twitter:title', 'og:title'], webpage, 'title', default=None)
+ if title is None:
+ title = self._search_regex(r'<h1>(.*?)</h1>', webpage, 'title', fatal=True)
+ thumbnail = self._html_search_meta(['thumbnailUrl'], webpage, 'title', default=None)
+ webpage = self._download_webpage(iframe_src, video_id)
+ entries = self._parse_html5_media_entries(iframe_src, webpage, video_id)[0]
+ for format in entries['formats']:
+ height = self._search_regex(r'_(\d+)\.m3u8', format['url'], 'height')
+ format['format_id'] = '%sp' % height
+ format['height'] = int_or_none(height)
+
+ entries.update({
+ 'id': video_id,
+ 'title': title,
+ 'thumbnail': thumbnail,
+ 'age_limit': 18
+ })
+ return entries