Repository: yt-dlp/yt-dlp

Issue:
PornEZ... Again....
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2023.02.17** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Europe

### Provide a description that is worded well enough to be understood

PornEZ made their IDs alphanumeric and now the regex isn't matching anymore and the URL is thrown out as not supported.

I was able to "fix" it by changing the regex patterns in 'extractor/lazy_extractors.py' and 'extractor/pornez.py'.

New Regex: 'https?://(?:www\\.)?pornez\\.net/video(?P<id>[0-9a-z]+)/'

While investigating this, I stumbled upon something else. I picked random URLs till I noticed that the ID was changed to alphanumeric. After fixing the issue with the regular expression, I tried downloading a random URL and ran into another issue: 

The following URLs have "too much information" in their meta tags (literally). This in turn leads to a too long filename and the script exiting with an error. Neither --restrict-filenames nor --windows-filenames kick in and prevent this from happening. I downloaded the url and added a file called "broken.html.gz" to this report, in case the URL becomes unreachable.

- URL: https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/
- File: [broken.html.gz](https://github.com/yt-dlp/yt-dlp/files/10778045/broken.html.gz)

Here the debug output when the problem occurs:
```
$ yt-dlp --ignore-config --restrict-filenames --windows-filenames -vU 'https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/'
[debug] Command-line config: ['--ignore-config', '--restrict-filenames', '--windows-filenames', '-vU', 'https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.02.17 [a0a7c01] (pip)
[debug] Python 3.9.10 (CPython x86_64 64bit) - CYGWIN_NT-10.0-22621-3.4.6-1.x86_64-x86_64-64bit-WindowsPE (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: ffmpeg 5.0.1-full_build-www.gyan.dev (setts), ffprobe 5.0.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2021.10.08, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1782 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
[Pornez] Extracting URL: https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/
[Pornez] vzs27fj: Downloading webpage
[Pornez] vzs27fj: Downloading webpage
[Pornez] vzs27fj: Downloading m3u8 information
[Pornez] vzs27fj: Downloading m3u8 information
[Pornez] vzs27fj: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] vzs27fj: Downloading 1 format(s): 1080p
[debug] Invoking hlsnative downloader on "https://pornez.net/m4u8/ch677neT74N_1080.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 331
[download] Destination: Tutor4K_E14_Blue_Wave_XXX_1080p_MP4_NBQ_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_mp4_Tutor4K_E14_Blue_Wave_480p_mp4_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_mkv-[vzs27fj].mp4
ERROR: unable to download video data: [Errno 91] File name too long: 'Tutor4K_E14_Blue_Wave_XXX_1080p_MP4_NBQ_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_mp4_Tutor4K_E14_Blue_Wave_480p_mp4_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_mkv-[vzs27fj].mp4.ytdl'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/utils.py", line 640, in sanitize_open
    stream = locked_file(filename, open_mode, block=False).__enter__()
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/utils.py", line 2198, in __init__
    self.f = os.fdopen(os.open(filename, flags, 0o666), mode, encoding=encoding)
OSError: [Errno 91] File name too long: 'Tutor4K_E14_Blue_Wave_XXX_1080p_MP4_NBQ_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_mp4_Tutor4K_E14_Blue_Wave_480p_mp4_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_mkv-[vzs27fj].mp4.ytdl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 3231, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 2954, in dl
    return fd.download(name, new_info, subtitle)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/common.py", line 444, in download
    ret = self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/hls.py", line 148, in real_download
    self._prepare_and_start_frag_download(ctx, info_dict)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/fragment.py", line 81, in _prepare_and_start_frag_download
    self._prepare_frag_download(ctx)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/fragment.py", line 205, in _prepare_frag_download
    self._write_ytdl_file(ctx)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/fragment.py", line 101, in _write_ytdl_file
    frag_index_stream, _ = self.sanitize_open(self.ytdl_filename(ctx['filename']), 'w')
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/common.py", line 235, in wrapper
    retry.error_callback(err, 1, 0)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/common.py", line 221, in error_callback
    return RetryManager.report_retry(
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/utils.py", line 6117, in report_retry
    raise e
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/common.py", line 230, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/downloader/common.py", line 241, in sanitize_open
    f, filename = sanitize_open(filename, open_mode)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/utils.py", line 642, in sanitize_open
    stream = open(filename, open_mode)
OSError: [Errno 91] File name too long: 'Tutor4K_E14_Blue_Wave_XXX_1080p_MP4_NBQ_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_Tutor4K_E14_Blue_Wave_XXX_SD_MP4_KLEENEX_mp4_Tutor4K_E14_Blue_Wave_480p_mp4_tutor4k_e14_blue_wave_mp4_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_720p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_XvX_Tutor4K_E14_Blue_Wave_XXX_1080p_HEVC_x265_PRT_mkv_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_Tutor4K_E14_Blue_Wave_XXX_720p_WEB_x264_GalaXXXy_mkv-[vzs27fj].mp4.ytdl'

```

Another URL/File pair that is causing the problem:

- URL:  https://pornez.net/videoonobjmv/allover30-22-01-05-olivia-olay-ladies-with-toys/
- File: [broken2.html.gz](https://github.com/yt-dlp/yt-dlp/files/10778066/broken2.html.gz)

I wonder if it wouldn't have been better to open another issue for this...?

Anyway.

If you have questions, feel free to ask.

Kind Regards,

G.


### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
$ yt-dlp --ignore-config -vU "https://pornez.net/video28vci2f/mistresst-mama-will-turn-you-straight-wmv/"
[debug] Command-line config: ['--ignore-config', '-vU', 'https://pornez.net/video28vci2f/mistresst-mama-will-turn-you-straight-wmv/']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.02.17 [a0a7c01] (pip)
[debug] Python 3.9.10 (CPython x86_64 64bit) - CYGWIN_NT-10.0-22621-3.4.6-1.x86_64-x86_64-64bit-WindowsPE (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: ffmpeg 5.0.1-full_build-www.gyan.dev (setts), ffprobe 5.0.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2021.10.08, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Loaded 1782 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
[generic] Extracting URL: https://pornez.net/video28vci2f/mistresst-mama-will-turn-you-straight-wmv/
[generic] mistresst-mama-will-turn-you-straight-wmv: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] mistresst-mama-will-turn-you-straight-wmv: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://pornez.net/video28vci2f/mistresst-mama-will-turn-you-straight-wmv/
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1502, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1578, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 693, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.9/site-packages/yt_dlp/extractor/generic.py", line 2509, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://pornez.net/video28vci2f/mistresst-mama-will-turn-you-straight-wmv/

```
```



Discussion:
Also here:
```diff
-            title = self._search_regex(r'<h1>(.*?)</h1>', webpage, 'title', fatal=True)
+            title = self._html_search_regex(r'(?s)<h1>(.*?)</h1>', webpage, 'title', fatal=False)
```


Resolving patch:
diff --git a/yt_dlp/extractor/pornez.py b/yt_dlp/extractor/pornez.py
--- a/yt_dlp/extractor/pornez.py
+++ b/yt_dlp/extractor/pornez.py
@@ -1,42 +1,60 @@
 from .common import InfoExtractor
-from ..utils import int_or_none, urljoin
+from ..utils import (
+    clean_html,
+    int_or_none,
+    get_element_by_class,
+    urljoin,
+)
 
 
 class PornezIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:www\.)?pornez\.net/video(?P<id>[0-9]+)/'
-    _TEST = {
+    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>\w+)|watch)/'
+    _TESTS = [{
         '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',
+            'title': 'mistresst funny_penis_names wmv',
             'thumbnail': r're:^https?://.*\.jpg$',
             'age_limit': 18,
-        }
-    }
+        },
+        'params': {'skip_download': 'm3u8'},
+    }, {
+        'url': 'https://pornez.net/watch/leana+lovings+stiff+for+stepdaughter/',
+        'info_dict': {
+            'id': '156161',
+            'ext': 'mp4',
+            'title': 'Watch leana lovings stiff for stepdaughter porn video.',
+            'age_limit': 18,
+        },
+        'params': {'skip_download': 'm3u8'},
+    }, {
+        'url': 'https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/',
+        'only_matching': True,
+    }]
 
     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="([^"]+)"', webpage, 'iframe', fatal=True)
-        iframe_src = urljoin('https://pornez.net', iframe_src)
-        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)
+        if not video_id:
+            video_id = self._search_regex(
+                r'<link[^>]+\bhref=["\']https?://pornez.net/\?p=(\w+)["\']', webpage, 'id')
+
+        iframe_src = self._html_search_regex(r'<iframe[^>]+src="([^"]+)"', webpage, 'iframe')
+        iframe = self._download_webpage(urljoin('https://pornez.net', iframe_src), video_id)
+
+        entries = self._parse_html5_media_entries(iframe_src, iframe, video_id)[0]
+        for fmt in entries['formats']:
+            height = self._search_regex(r'_(\d+)\.m3u8', fmt['url'], 'height')
+            fmt['format_id'] = '%sp' % height
+            fmt['height'] = int_or_none(height)
 
         entries.update({
             'id': video_id,
-            'title': title,
-            'thumbnail': thumbnail,
-            'age_limit': 18
+            'title': (clean_html(get_element_by_class('video-title', webpage))
+                      or self._html_search_meta(
+                      ['twitter:title', 'og:title', 'description'], webpage, 'title', default=None)),
+            'thumbnail': self._html_search_meta(['thumbnailUrl'], webpage, 'thumb', default=None),
+            'age_limit': 18,
         })
         return entries


Test patch: