Repository: yt-dlp/yt-dlp

Issue:
[BUG] Iwara.tv: unable to extract upload_date
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.05.18** ([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/ytdl-org/youtube-dl#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 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

_No response_

### Description

Iwara.tv: unable to extract upload_date

### Verbose log

```shell
F:\downloader\iwara.tv\dl>//ytdl-patched https://www.iwara.tv/videos/axgjgi1pkupwgz4k?playlist=107712 -f best
The filename, directory name, or volume label syntax is incorrect.

F:\downloader\iwara.tv\dl>yt-dlp -a 000MMD_links.txt --conf config_iwara -v
[debug] Command-line config: ['-a', '000MMD_links.txt', '--conf', 'config_iwara', '-v']
[debug] | Config "config_iwara": ['--continue', '--http-chunk-size', '1M', '--buffer-size', '16K', '--sub-lang', 'english', '--embed-metadata', '--embed-thumbnail', '--abort-on-unavailable-fragment', '-o', '%(age_limit)s\\%(uploader)s\\%(title)s [%(id)s].%(ext)s', '--download-archive', 'downloaded.txt', '-f', 'Source/540p/360p', '--ffmpeg-location', 'D:\\Program Files\\ffmpeg\\bin']
[debug] User config "C:\Users\X\AppData\Roaming\yt-dlp\config": ['--continue', '--format-sort', 'vbr,abr', '--http-chunk-size', '1M', '--buffer-size', '16K', '--sub-lang', 'english', '--embed-metadata', '--abort-on-unavailable-fragment', '-o', '%(title)s [%(id)s].%(ext)s', '--ffmpeg-location', 'D:\\Program Files\\ffmpeg\\bin']
[debug] Batch file urls: ['https://ecchi.iwara.tv/videos/03yedh9lbizq1kq8?language=en', 'https://ecchi.iwara.tv/videos/18kqetlxjt3w8wd3?language=en', 'https://ecchi.iwara.tv/videos/25xbni92aixod0wo?language=en', 'https://ecchi.iwara.tv/videos/4jqbmudrwcwmoqwl?language=en', 'https://ecchi.iwara.tv/videos/6a8als43auo2aezk?language=en', 'https://ecchi.iwara.tv/videos/6zq9zc43auol8kbv?language=en', 'https://ecchi.iwara.tv/videos/7v5rxslm6hgrq3ao?language=en', 'https://ecchi.iwara.tv/videos/88jg3t32ytlbzyvk?language=en', 'https://ecchi.iwara.tv/videos/9zopqhkyxhzv2omq?language=en', 'https://ecchi.iwara.tv/videos/aljzzhvylt72jrgy?language=en', 'https://ecchi.iwara.tv/videos/bnawwf4byu38xepq?language=en', 'https://ecchi.iwara.tv/videos/bzq64f4byu3gvbkq?language=en', 'https://ecchi.iwara.tv/videos/deq7wfo2btkdlo2b?language=en', 'https://ecchi.iwara.tv/videos/dmvr7io2btklywam?language=en', 'https://ecchi.iwara.tv/videos/ekvzasjv9umm2gkk?language=en', 'https://ecchi.iwara.tv/videos/gklk6soqzt7zw2pa?language=en', 'https://ecchi.iwara.tv/videos/gl7gdfxovhovz05p?language=en', 'https://ecchi.iwara.tv/videos/gmjyjuoqzt7a9zkk?language=en', 'https://ecchi.iwara.tv/videos/j006wtz5ytej9jjn?language=en', 'https://ecchi.iwara.tv/videos/j090xiz5ytejvmq1?language=en', 'https://ecchi.iwara.tv/videos/kapz8ukgvhqwqme0?language=en', 'https://ecchi.iwara.tv/videos/kxymrhkgvhq5ol2a?language=en', 'https://ecchi.iwara.tv/videos/l0jb6ckwlh8oamp1?language=en', 'https://ecchi.iwara.tv/videos/ldyazhl85hwr3pvr?language=en', 'https://ecchi.iwara.tv/videos/lwnzwhkwlh8grypd?language=en', 'https://ecchi.iwara.tv/videos/lyo9rukwlh8kwkgb?language=en', 'https://ecchi.iwara.tv/videos/make3crjmu8y4klg?language=en', 'https://ecchi.iwara.tv/videos/mjr0xc3bntozmmgb?language=en', 'https://ecchi.iwara.tv/videos/nmpaatgyjtpbzkml?language=en', 'https://ecchi.iwara.tv/videos/ovalos6z0c18aqjy?language=en', 'https://ecchi.iwara.tv/videos/pxaxbsd6vcok2emp?language=en', 'https://ecchi.iwara.tv/videos/q8qy1sy2xtlpjvzd?language=en', 'https://ecchi.iwara.tv/videos/qm7jqhy2xtlvmodo?language=en', 'https://ecchi.iwara.tv/videos/qykebcgzasrlyewa?language=en', 'https://ecchi.iwara.tv/videos/vo529hrdgue9oeaq?language=en', 'https://ecchi.iwara.tv/videos/voyk4srdgue9k0r6?language=en', 'https://ecchi.iwara.tv/videos/wklyehgnlsymomol?language=en', 'https://ecchi.iwara.tv/videos/wpgbkh1xquqm0wjp?language=en', 'https://ecchi.iwara.tv/videos/wzj0kignlsyla75x?language=en', 'https://ecchi.iwara.tv/videos/xk2qjiyd5uwr1n6b?language=en', 'https://ecchi.iwara.tv/videos/2w9y0h92aiqajv7n?language=en', 'https://ecchi.iwara.tv/videos/45bz4hdrwcyjxgaz?language=en', 'https://ecchi.iwara.tv/videos/5vob5sboghwx7j4m?language=en', 'https://ecchi.iwara.tv/videos/6r7g5i43auonmo3q?language=en', 'https://ecchi.iwara.tv/videos/7oywzslm6hmmjo48?language=en', 'https://ecchi.iwara.tv/videos/ak2bouvylt7k4edb?language=en', 'https://ecchi.iwara.tv/videos/bkmjgh4byu34qrra?language=en', 'https://ecchi.iwara.tv/videos/g8pqwhxovhowvxbg?language=en', 'https://ecchi.iwara.tv/videos/gpaqpfoqzt7z4be8?language=en', 'https://ecchi.iwara.tv/videos/gprj1toqzt7grj5j?language=en', 'https://ecchi.iwara.tv/videos/j9vq2sz5yte7qq4z?language=en', 'https://ecchi.iwara.tv/videos/k9wkwckgvhqa9zjr?language=en', 'https://ecchi.iwara.tv/videos/kky6qszmbtzevgz6?language=en', 'https://ecchi.iwara.tv/videos/lkkwmhl85hw6vdoy?language=en', 'https://ecchi.iwara.tv/videos/lnllkcl85hw7zaaz?language=en', 'https://ecchi.iwara.tv/videos/lqxazukwlh8rv6md?language=en', 'https://ecchi.iwara.tv/videos/nab1vigyjtp8wmpb?language=en', 'https://ecchi.iwara.tv/videos/o13opi6z0c1wwwjy?language=en', 'https://ecchi.iwara.tv/videos/o6v4jfrj9t6rqwze?language=en', 'https://ecchi.iwara.tv/videos/0npgys9lbizoeeeq?language=en', 'https://ecchi.iwara.tv/videos/57q8yiboghwkevg8?language=en', 'https://ecchi.iwara.tv/videos/5adrycboghwrx8m9?language=en', 'https://ecchi.iwara.tv/videos/86wrru32ytl3vk93?language=en', 'https://ecchi.iwara.tv/videos/87pkbs32ytlv3jrb?language=en', 'https://ecchi.iwara.tv/videos/a7jo6umbvt8ryvj0?language=en', 'https://ecchi.iwara.tv/videos/ag5vjivylt75wzer?language=en', 'https://ecchi.iwara.tv/videos/b7nwjh4byu39aw6g?language=en', 'https://ecchi.iwara.tv/videos/blm0wc4byu3ybwbr?language=en', 'https://ecchi.iwara.tv/videos/blp3eiv5dtlnv1ar?language=en', 'https://ecchi.iwara.tv/videos/delknho2btk362zx?language=en', 'https://ecchi.iwara.tv/videos/delmnco2btk3oq73?language=en', 'https://ecchi.iwara.tv/videos/dje7buo2btkknlow?language=en', 'https://ecchi.iwara.tv/videos/e41yzsjv9umggyxb?language=en', 'https://ecchi.iwara.tv/videos/ejakwivywtk1am3y?language=en', 'https://ecchi.iwara.tv/videos/exdjdijv9umrmbrw?language=en', 'https://ecchi.iwara.tv/videos/gmwgltxovhoblogy?language=en', 'https://ecchi.iwara.tv/videos/gwewqfxovhogl7bd?language=en', 'https://ecchi.iwara.tv/videos/jlymasdeycwq5p4v?language=en', 'https://ecchi.iwara.tv/videos/jlzyasdeycw7ygqy?language=en', 'https://ecchi.iwara.tv/videos/k40znuzmbtzbon0b?language=en', 'https://ecchi.iwara.tv/videos/kdkgeikgvhqlbjgj?language=en', 'https://ecchi.iwara.tv/videos/kg76kfkgvhqzpkro?language=en', 'https://ecchi.iwara.tv/videos/komebuzmbtzmxlaq?language=en', 'https://ecchi.iwara.tv/videos/odedzt6z0c1j89gm?language=en', 'https://ecchi.iwara.tv/videos/pg5eosd6vcow4j8z?language=en', 'https://ecchi.iwara.tv/videos/q9jlrcy2xtl6llve?language=en', 'https://ecchi.iwara.tv/videos/qjbq7cgzasrjagll?language=en', 'https://ecchi.iwara.tv/videos/qnqm2cgzasr3njlr?language=en', 'https://ecchi.iwara.tv/videos/qnyj1igzasrbbojy?language=en', 'https://ecchi.iwara.tv/videos/r524liklrso8lm7z?language=en', 'https://ecchi.iwara.tv/videos/rga4ltyr9uzgezkr?language=en', 'https://ecchi.iwara.tv/videos/rrx5zcyr9uz4bdzo?language=en', 'https://ecchi.iwara.tv/videos/vb0ems2vkuegaqgz?language=en', 'https://ecchi.iwara.tv/videos/vpzozcrdgue2oorg?language=en', 'https://ecchi.iwara.tv/videos/wbd0bugnlsy0p6ow?language=en', 'https://ecchi.iwara.tv/videos/wglxvfgnlsynkr1v?language=en', 'https://ecchi.iwara.tv/videos/xob2xfyd5uwqwlvn?language=en', 'https://ecchi.iwara.tv/videos/z9xqkfa4aigwjvpe?language=en', 'https://ecchi.iwara.tv/videos/zanowta4aig2r4p3?language=en', 'https://ecchi.iwara.tv/videos/oa39vcrj9t6bjqwa?language=en', 'https://ecchi.iwara.tv/videos/ozdkwt6z0c1kqnov?language=en', 'https://ecchi.iwara.tv/videos/pwqy5hd6vcowg6q8?language=en', 'https://ecchi.iwara.tv/videos/q4z24sgzasr5bobm?language=en', 'https://ecchi.iwara.tv/videos/q6b4yhgzasrmro00?language=en', 'https://ecchi.iwara.tv/videos/qd3zmiy2xtl3mv8y?language=en', 'https://ecchi.iwara.tv/videos/qvmq1hy2xtllezjw?language=en', 'https://ecchi.iwara.tv/videos/rbagwuklrsokopwj?language=en', 'https://ecchi.iwara.tv/videos/rkm4nuyr9uzeevr9?language=en', 'https://ecchi.iwara.tv/videos/rmbqviklrso6dy1p?language=en', 'https://ecchi.iwara.tv/videos/v7yaltrdguev6l3z?language=en', 'https://ecchi.iwara.tv/videos/valw3i2vkuejmmj1?language=en', 'https://ecchi.iwara.tv/videos/vazzpf2vkuejylan?language=en', 'https://ecchi.iwara.tv/videos/vkxazs2vkuer5da1?language=en', 'https://ecchi.iwara.tv/videos/wnbwyi1xquqxym32?language=en', 'https://ecchi.iwara.tv/videos/wx5eatgnlsybdlkl?language=en', 'https://ecchi.iwara.tv/videos/wxoqdignlsyel6v4?language=en', 'https://ecchi.iwara.tv/videos/wxrelignlsya8omd?language=en', 'https://ecchi.iwara.tv/videos/ydrmmh9yjio8qaer?language=en', 'https://ecchi.iwara.tv/videos/z5njbf4anukwdkla?language=en', 'https://ecchi.iwara.tv/videos/zj9mvca4aigk2ekq?language=en', 'https://ecchi.iwara.tv/videos/0e4qzh9lbizye9q9?language=en', 'https://ecchi.iwara.tv/videos/0wlxrf9lbizd5kb2?language=en', 'https://ecchi.iwara.tv/videos/0z0eyu9lbizob4gl?language=en', 'https://ecchi.iwara.tv/videos/2z5pys92aiq43b7x?language=en', 'https://ecchi.iwara.tv/videos/5qg88hboghw0krwe?language=en', 'https://ecchi.iwara.tv/videos/84ygqs32ytloraqo?language=en', 'https://ecchi.iwara.tv/videos/8evjgf32ytlyazyo?language=en', 'https://ecchi.iwara.tv/videos/9e2kpikyxhzqorzy?language=en', 'https://ecchi.iwara.tv/videos/b5jjosv5dtlyjgwk?language=en', 'https://ecchi.iwara.tv/videos/dawbvfo2btkgxyqm?language=en', 'https://ecchi.iwara.tv/videos/djj8wuo2btk9oln9?language=en', 'https://ecchi.iwara.tv/videos/erzbwsvywtk9gqa3?language=en', 'https://ecchi.iwara.tv/videos/ex3rmhvywtkw88p9?language=en', 'https://ecchi.iwara.tv/videos/glkevioqzt7rx2yv?language=en', 'https://ecchi.iwara.tv/videos/j8exesdeycweay1y?language=en', 'https://ecchi.iwara.tv/videos/jjaaytz5yte4gwgk?language=en', 'https://ecchi.iwara.tv/videos/jjr3xuz5yte47m9z?language=en', 'https://ecchi.iwara.tv/videos/l8xvvtl85hwv82ve?language=en', 'https://ecchi.iwara.tv/videos/mbj9zcrjmu8gjwkr?language=en', 'https://ecchi.iwara.tv/videos/mervefrjmu84d0lk?language=en', 'https://ecchi.iwara.tv/videos/nmmxnsgyjtp7yql7?language=en', 'https://ecchi.iwara.tv/videos/ogywlc6z0c19aa7v?language=en', 'https://ecchi.iwara.tv/videos/orzwat6z0c1xv8jz?language=en', 'https://ecchi.iwara.tv/videos/q9lywsgzasreaqbv?language=en', 'https://ecchi.iwara.tv/videos/qemwvfy2xtl8z6lo?language=en', 'https://ecchi.iwara.tv/videos/v4rr6i2vkuewo44n?language=en', 'https://ecchi.iwara.tv/videos/vgmbwt2vkueoyrpo?language=en', 'https://ecchi.iwara.tv/videos/vloybfrdgueedelb?language=en', 'https://ecchi.iwara.tv/videos/wbgbgfgnlsy6epyl?language=en', 'https://ecchi.iwara.tv/videos/wn92jf1xquq132ge?language=en', 'https://ecchi.iwara.tv/videos/zn7dxu4anukygxrv?language=en']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.05.18 [b14d52355]
[debug] Lazy loading extractors is disabled
[debug] Python version 3.10.4 (CPython 64bit) - Windows-10-10.0.19043-SP0
[debug] Checking exe version: "D:\Program Files\ffmpeg\bin\ffmpeg" -bsfs
[debug] Checking exe version: "D:\Program Files\ffmpeg\bin\ffprobe" -bsfs
[debug] exe versions: ffmpeg 2022-03-28-git-5ee198f9aa-essentials_build-www.gyan.dev (setts), ffprobe 2022-03-28-git-5ee198f9aa-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.2
[debug] Proxy map: {}
[debug] Loading archive file 'downloaded.txt'
[debug] [Iwara] Extracting URL: https://ecchi.iwara.tv/videos/03yedh9lbizq1kq8?language=en
[Iwara] 03yedh9lbizq1kq8: Downloading webpage
[Iwara] 03yedh9lbizq1kq8: Downloading JSON metadata
WARNING: [Iwara] unable to extract upload_date; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
[debug] Sort order given by user: vbr, abr
[debug] Formats sorted by: hasvid, ie_pref, vbr, abr, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, asr, proto, vext, aext, hasaud, source, id
[download] SOLAR - Spit it out has already been recorded in the archive
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/iwara.py b/yt_dlp/extractor/iwara.py
--- a/yt_dlp/extractor/iwara.py
+++ b/yt_dlp/extractor/iwara.py
@@ -1,239 +1,184 @@
-import itertools
-import re
+import functools
 import urllib.parse
+import hashlib
 
 from .common import InfoExtractor
 from ..utils import (
+    OnDemandPagedList,
     int_or_none,
     mimetype2ext,
-    remove_end,
-    strip_or_none,
-    unified_strdate,
-    url_or_none,
-    urljoin,
+    traverse_obj,
+    unified_timestamp,
 )
 
 
-class IwaraBaseIE(InfoExtractor):
-    _BASE_REGEX = r'(?P<base_url>https?://(?:www\.|ecchi\.)?iwara\.tv)'
-
-    def _extract_playlist(self, base_url, webpage):
-        for path in re.findall(r'class="title">\s*<a[^<]+href="([^"]+)', webpage):
-            yield self.url_result(urljoin(base_url, path))
-
-
-class IwaraIE(IwaraBaseIE):
-    _VALID_URL = fr'{IwaraBaseIE._BASE_REGEX}/videos/(?P<id>[a-zA-Z0-9]+)'
+class IwaraIE(InfoExtractor):
+    IE_NAME = 'iwara'
+    _VALID_URL = r'https?://(?:www\.)?iwara\.tv/video/(?P<id>[a-zA-Z0-9]+)'
     _TESTS = [{
-        'url': 'http://iwara.tv/videos/amVwUl1EHpAD9RD',
-        # md5 is unstable
+        # this video cannot be played because of migration
+        'only_matching': True,
+        'url': 'https://www.iwara.tv/video/k2ayoueezfkx6gvq',
         'info_dict': {
-            'id': 'amVwUl1EHpAD9RD',
+            'id': 'k2ayoueezfkx6gvq',
             'ext': 'mp4',
-            'title': '【MMD R-18】ガールフレンド carry_me_off',
             'age_limit': 18,
-            'thumbnail': 'https://i.iwara.tv/sites/default/files/videos/thumbnails/7951/thumbnail-7951_0001.png',
-            'uploader': 'Reimu丨Action',
-            'upload_date': '20150828',
-            'description': 'md5:1d4905ce48c66c9299c617f08e106e0f',
+            'title': 'Defeat of Irybelda - アイリベルダの敗北',
+            'description': 'md5:70278abebe706647a8b4cb04cf23e0d3',
+            'uploader': 'Inwerwm',
+            'uploader_id': 'inwerwm',
+            'tags': 'count:1',
+            'like_count': 6133,
+            'view_count': 1050343,
+            'comment_count': 1,
+            'timestamp': 1677843869,
+            'modified_timestamp': 1679056362,
         },
     }, {
-        'url': 'http://ecchi.iwara.tv/videos/Vb4yf2yZspkzkBO',
-        'md5': '7e5f1f359cd51a027ba4a7b7710a50f0',
+        'url': 'https://iwara.tv/video/1ywe1sbkqwumpdxz5/',
+        'md5': '20691ce1473ec2766c0788e14c60ce66',
         'info_dict': {
-            'id': '0B1LvuHnL-sRFNXB1WHNqbGw4SXc',
+            'id': '1ywe1sbkqwumpdxz5',
             'ext': 'mp4',
-            'title': '[3D Hentai] Kyonyu × Genkai × Emaki Shinobi Girls.mp4',
             'age_limit': 18,
+            'title': 'Aponia 阿波尼亚SEX  Party Tonight 手动脱衣 大奶 裸腿',
+            'description': 'md5:0c4c310f2e0592d68b9f771d348329ca',
+            'uploader': '龙也zZZ',
+            'uploader_id': 'user792540',
+            'tags': [
+                'uncategorized'
+            ],
+            'like_count': 1809,
+            'view_count': 25156,
+            'comment_count': 1,
+            'timestamp': 1678732213,
+            'modified_timestamp': 1679110271,
         },
-        'add_ie': ['GoogleDrive'],
-    }, {
-        'url': 'http://www.iwara.tv/videos/nawkaumd6ilezzgq',
-        # md5 is unstable
-        'info_dict': {
-            'id': '6liAP9s2Ojc',
-            'ext': 'mp4',
-            'age_limit': 18,
-            'title': '[MMD] Do It Again Ver.2 [1080p 60FPS] (Motion,Camera,Wav+DL)',
-            'description': 'md5:590c12c0df1443d833fbebe05da8c47a',
-            'upload_date': '20160910',
-            'uploader': 'aMMDsork',
-            'uploader_id': 'UCVOFyOSCyFkXTYYHITtqB7A',
-        },
-        'add_ie': ['Youtube'],
     }]
 
+    def _extract_formats(self, video_id, fileurl):
+        up = urllib.parse.urlparse(fileurl)
+        q = urllib.parse.parse_qs(up.query)
+        paths = up.path.rstrip('/').split('/')
+        # https://github.com/yt-dlp/yt-dlp/issues/6549#issuecomment-1473771047
+        x_version = hashlib.sha1('_'.join((paths[-1], q['expires'][0], '5nFp9kmbNnHdAFhaqMvt')).encode()).hexdigest()
+
+        files = self._download_json(fileurl, video_id, headers={'X-Version': x_version})
+        for fmt in files:
+            yield traverse_obj(fmt, {
+                'format_id': 'name',
+                'url': ('src', ('view', 'download'), {self._proto_relative_url}),
+                'ext': ('type', {mimetype2ext}),
+                'quality': ('name', {lambda x: int_or_none(x) or 1e4}),
+                'height': ('name', {int_or_none}),
+            }, get_all=False)
+
     def _real_extract(self, url):
         video_id = self._match_id(url)
-
-        webpage, urlh = self._download_webpage_handle(url, video_id)
-
-        hostname = urllib.parse.urlparse(urlh.geturl()).hostname
-        # ecchi is 'sexy' in Japanese
-        age_limit = 18 if hostname.split('.')[0] == 'ecchi' else 0
-
-        video_data = self._download_json('http://www.iwara.tv/api/video/%s' % video_id, video_id)
-
-        if not video_data:
-            iframe_url = self._html_search_regex(
-                r'<iframe[^>]+src=([\'"])(?P<url>[^\'"]+)\1',
-                webpage, 'iframe URL', group='url')
-            return {
-                '_type': 'url_transparent',
-                'url': iframe_url,
-                'age_limit': age_limit,
-            }
-
-        title = remove_end(self._html_extract_title(webpage), ' | Iwara')
-
-        thumbnail = self._html_search_regex(
-            r'poster=[\'"]([^\'"]+)', webpage, 'thumbnail', default=None)
-
-        uploader = self._html_search_regex(
-            r'class="username">([^<]+)', webpage, 'uploader', fatal=False)
-
-        upload_date = unified_strdate(self._html_search_regex(
-            r'作成日:([^\s]+)', webpage, 'upload_date', fatal=False))
-
-        description = strip_or_none(self._search_regex(
-            r'<p>(.+?(?=</div))', webpage, 'description', fatal=False,
-            flags=re.DOTALL))
-
-        formats = []
-        for a_format in video_data:
-            format_uri = url_or_none(a_format.get('uri'))
-            if not format_uri:
-                continue
-            format_id = a_format.get('resolution')
-            height = int_or_none(self._search_regex(
-                r'(\d+)p', format_id, 'height', default=None))
-            formats.append({
-                'url': self._proto_relative_url(format_uri, 'https:'),
-                'format_id': format_id,
-                'ext': mimetype2ext(a_format.get('mime')) or 'mp4',
-                'height': height,
-                'width': int_or_none(height / 9.0 * 16.0 if height else None),
-                'quality': 1 if format_id == 'Source' else 0,
-            })
+        video_data = self._download_json(f'http://api.iwara.tv/video/{video_id}', video_id)
 
         return {
             'id': video_id,
-            'title': title,
-            'age_limit': age_limit,
-            'formats': formats,
-            'thumbnail': self._proto_relative_url(thumbnail, 'https:'),
-            'uploader': uploader,
-            'upload_date': upload_date,
-            'description': description,
+            'age_limit': 18 if video_data.get('rating') == 'ecchi' else 0,  # ecchi is 'sexy' in Japanese
+            **traverse_obj(video_data, {
+                'title': 'title',
+                'description': 'body',
+                'uploader': ('user', 'name'),
+                'uploader_id': ('user', 'username'),
+                'tags': ('tags', ..., 'id'),
+                'like_count': 'numLikes',
+                'view_count': 'numViews',
+                'comment_count': 'numComments',
+                'timestamp': ('createdAt', {unified_timestamp}),
+                'modified_timestamp': ('updatedAt', {unified_timestamp}),
+                'thumbnail': ('file', 'id', {str}, {
+                    lambda x: f'https://files.iwara.tv/image/thumbnail/{x}/thumbnail-00.jpg'}),
+            }),
+            'formats': list(self._extract_formats(video_id, video_data.get('fileUrl'))),
         }
 
 
-class IwaraPlaylistIE(IwaraBaseIE):
-    _VALID_URL = fr'{IwaraBaseIE._BASE_REGEX}/playlist/(?P<id>[^/?#&]+)'
-    IE_NAME = 'iwara:playlist'
+class IwaraUserIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?iwara\.tv/profile/(?P<id>[^/?#&]+)'
+    IE_NAME = 'iwara:user'
+    _PER_PAGE = 32
 
     _TESTS = [{
-        'url': 'https://ecchi.iwara.tv/playlist/best-enf',
+        'url': 'https://iwara.tv/profile/user792540/videos',
         'info_dict': {
-            'title': 'Best enf',
-            'uploader': 'Jared98112',
-            'id': 'best-enf',
+            'id': 'user792540',
         },
-        'playlist_mincount': 1097,
+        'playlist_mincount': 80,
     }, {
-        # urlencoded
-        'url': 'https://ecchi.iwara.tv/playlist/%E3%83%97%E3%83%AC%E3%82%A4%E3%83%AA%E3%82%B9%E3%83%88-2',
+        'url': 'https://iwara.tv/profile/theblackbirdcalls/videos',
         'info_dict': {
-            'id': 'プレイリスト-2',
-            'title': 'プレイリスト',
-            'uploader': 'mainyu',
+            'id': 'theblackbirdcalls',
         },
-        'playlist_mincount': 91,
+        'playlist_mincount': 723,
+    }, {
+        'url': 'https://iwara.tv/profile/user792540',
+        'only_matching': True,
+    }, {
+        'url': 'https://iwara.tv/profile/theblackbirdcalls',
+        'only_matching': True,
     }]
 
+    def _entries(self, playlist_id, user_id, page):
+        videos = self._download_json(
+            'https://api.iwara.tv/videos', playlist_id,
+            note=f'Downloading page {page}',
+            query={
+                'page': page,
+                'sort': 'date',
+                'user': user_id,
+                'limit': self._PER_PAGE,
+            })
+        for x in traverse_obj(videos, ('results', ..., 'id')):
+            yield self.url_result(f'https://iwara.tv/video/{x}')
+
     def _real_extract(self, url):
-        playlist_id, base_url = self._match_valid_url(url).group('id', 'base_url')
-        playlist_id = urllib.parse.unquote(playlist_id)
-        webpage = self._download_webpage(url, playlist_id)
+        playlist_id = self._match_id(url)
+        user_info = self._download_json(
+            f'https://api.iwara.tv/profile/{playlist_id}', playlist_id,
+            note='Requesting user info')
+        user_id = traverse_obj(user_info, ('user', 'id'))
 
-        return {
-            '_type': 'playlist',
-            'id': playlist_id,
-            'title': self._html_search_regex(r'class="title"[^>]*>([^<]+)', webpage, 'title', fatal=False),
-            'uploader': self._html_search_regex(r'<h2>([^<]+)', webpage, 'uploader', fatal=False),
-            'entries': self._extract_playlist(base_url, webpage),
-        }
+        return self.playlist_result(
+            OnDemandPagedList(
+                functools.partial(self._entries, playlist_id, user_id),
+                self._PER_PAGE),
+            playlist_id, traverse_obj(user_info, ('user', 'name')))
 
 
-class IwaraUserIE(IwaraBaseIE):
-    _VALID_URL = fr'{IwaraBaseIE._BASE_REGEX}/users/(?P<id>[^/?#&]+)'
-    IE_NAME = 'iwara:user'
+class IwaraPlaylistIE(InfoExtractor):
+    # the ID is an UUID but I don't think it's necessary to write concrete regex
+    _VALID_URL = r'https?://(?:www\.)?iwara\.tv/playlist/(?P<id>[0-9a-f-]+)'
+    IE_NAME = 'iwara:playlist'
+    _PER_PAGE = 32
 
     _TESTS = [{
-        'note': 'number of all videos page is just 1 page. less than 40 videos',
-        'url': 'https://ecchi.iwara.tv/users/infinityyukarip',
-        'info_dict': {
-            'title': 'Uploaded videos from Infinity_YukariP',
-            'id': 'infinityyukarip',
-            'uploader': 'Infinity_YukariP',
-            'uploader_id': 'infinityyukarip',
-        },
-        'playlist_mincount': 39,
-    }, {
-        'note': 'no even all videos page. probably less than 10 videos',
-        'url': 'https://ecchi.iwara.tv/users/mmd-quintet',
-        'info_dict': {
-            'title': 'Uploaded videos from mmd quintet',
-            'id': 'mmd-quintet',
-            'uploader': 'mmd quintet',
-            'uploader_id': 'mmd-quintet',
-        },
-        'playlist_mincount': 6,
-    }, {
-        'note': 'has paging. more than 40 videos',
-        'url': 'https://ecchi.iwara.tv/users/theblackbirdcalls',
+        'url': 'https://iwara.tv/playlist/458e5486-36a4-4ac0-b233-7e9eef01025f',
         'info_dict': {
-            'title': 'Uploaded videos from TheBlackbirdCalls',
-            'id': 'theblackbirdcalls',
-            'uploader': 'TheBlackbirdCalls',
-            'uploader_id': 'theblackbirdcalls',
+            'id': '458e5486-36a4-4ac0-b233-7e9eef01025f',
         },
-        'playlist_mincount': 420,
-    }, {
-        'note': 'foreign chars in URL. there must be foreign characters in URL',
-        'url': 'https://ecchi.iwara.tv/users/ぶた丼',
-        'info_dict': {
-            'title': 'Uploaded videos from ぶた丼',
-            'id': 'ぶた丼',
-            'uploader': 'ぶた丼',
-            'uploader_id': 'ぶた丼',
-        },
-        'playlist_mincount': 170,
+        'playlist_mincount': 3,
     }]
 
-    def _entries(self, playlist_id, base_url):
-        webpage = self._download_webpage(
-            f'{base_url}/users/{playlist_id}', playlist_id)
-        videos_url = self._search_regex(r'<a href="(/users/[^/]+/videos)(?:\?[^"]+)?">', webpage, 'all videos url', default=None)
-        if not videos_url:
-            yield from self._extract_playlist(base_url, webpage)
-            return
-
-        videos_url = urljoin(base_url, videos_url)
-
-        for n in itertools.count(1):
-            page = self._download_webpage(
-                videos_url, playlist_id, note=f'Downloading playlist page {n}',
-                query={'page': str(n - 1)} if n > 1 else {})
-            yield from self._extract_playlist(
-                base_url, page)
-
-            if f'page={n}' not in page:
-                break
+    def _entries(self, playlist_id, first_page, page):
+        videos = self._download_json(
+            'https://api.iwara.tv/videos', playlist_id, f'Downloading page {page}',
+            query={'page': page, 'limit': self._PER_PAGE}) if page else first_page
+        for x in traverse_obj(videos, ('results', ..., 'id')):
+            yield self.url_result(f'https://iwara.tv/video/{x}')
 
     def _real_extract(self, url):
-        playlist_id, base_url = self._match_valid_url(url).group('id', 'base_url')
-        playlist_id = urllib.parse.unquote(playlist_id)
+        playlist_id = self._match_id(url)
+        page_0 = self._download_json(
+            f'https://api.iwara.tv/playlist/{playlist_id}?page=0&limit={self._PER_PAGE}', playlist_id,
+            note='Requesting playlist info')
 
         return self.playlist_result(
-            self._entries(playlist_id, base_url), playlist_id)
+            OnDemandPagedList(
+                functools.partial(self._entries, playlist_id, page_0),
+                self._PER_PAGE),
+            playlist_id, traverse_obj(page_0, ('title', 'name')))


Test patch: