Repository: yt-dlp/yt-dlp

Issue:
WeVidi video download support
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

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

### Checklist

- [X] I'm requesting a feature unrelated to a specific site
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [X] I've verified that I'm running yt-dlp version **2023.01.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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)

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

I would like WeVidi video download support implemented into this as said in the title.
If you don't know what WeVidi is, it's basically a YouTube alternative that's like Vidlii but with actually good moderation as stated in the example video URL.
Example of a WeVidi video URL: https://wevidi.net/watch/UOxjNMyp70w

### 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
[debug] Command-line config: ['-vU', 'test:youtube']
[debug] Portable config &quot;yt-dlp.conf&quot;: ['-i']
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [9d339c4] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.22000-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg N-106550-g072101bd52-20220410 (fdk,setts), ffprobe N-106624-g391ce570c8-20220415, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
"wevidi_video.mp4" is the filename for the WeVidi video
"https://wevidi.net/watch/" is the url for the video, and "video_id" is the id for the video
[command] yt-dlp -o wevidi_video.mp4 "https://wevidi.net/watch/video_id"
yes i know it probably doesn't meet up with the proper syntax but idk what does💀
```



Discussion:
>  I'm requesting a feature unrelated to a specific site

Make sure to use the appropriate issue template. Read, don't just blindly check the boxes

Resolving patch:
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py
--- a/yt_dlp/extractor/_extractors.py
+++ b/yt_dlp/extractor/_extractors.py
@@ -2296,6 +2296,7 @@
     WeiboMobileIE
 )
 from .weiqitv import WeiqiTVIE
+from .wevidi import WeVidiIE
 from .whyp import WhypIE
 from .wikimedia import WikimediaIE
 from .willow import WillowIE
diff --git a/yt_dlp/extractor/wevidi.py b/yt_dlp/extractor/wevidi.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/wevidi.py
@@ -0,0 +1,108 @@
+from .common import InfoExtractor
+from ..utils import clean_html, float_or_none, get_element_by_class, js_to_json, traverse_obj
+
+
+class WeVidiIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?wevidi\.net/watch/(?P<id>[\w-]{11})'
+    _TESTS = [{
+        'url': 'https://wevidi.net/watch/2th7UO5F4KV',
+        'md5': 'b913d1ff5bbad499e2c7ef4aa6d829d7',
+        'info_dict': {
+            'id': '2th7UO5F4KV',
+            'ext': 'mp4',
+            'title': 'YouTube Alternative: WeVidi - customizable channels & more',
+            'thumbnail': r're:^https?://.*\.jpg$',
+            'description': 'md5:73a27d0a87d49fbcc5584566326ebeed',
+            'uploader': 'eclecRC',
+            'duration': 932.098,
+        }
+    }, {
+        'url': 'https://wevidi.net/watch/ievRuuQHbPS',
+        'md5': 'ce8a94989a959bff9003fa27ee572935',
+        'info_dict': {
+            'id': 'ievRuuQHbPS',
+            'ext': 'mp4',
+            'title': 'WeVidi Playlists',
+            'thumbnail': r're:^https?://.*\.jpg$',
+            'description': 'md5:32cdfca272687390d9bd9b0c9c6153ee',
+            'uploader': 'WeVidi',
+            'duration': 36.1999,
+        }
+    }, {
+        'url': 'https://wevidi.net/watch/PcMzDWaQSWb',
+        'md5': '55ee0d3434be5d9e5cc76b83f2bb57ec',
+        'info_dict': {
+            'id': 'PcMzDWaQSWb',
+            'ext': 'mp4',
+            'title': 'Cat blep',
+            'thumbnail': r're:^https?://.*\.jpg$',
+            'description': 'md5:e2c9e2b54b8bb424cc64937c8fdc068f',
+            'uploader': 'WeVidi',
+            'duration': 41.972,
+        }
+    }, {
+        'url': 'https://wevidi.net/watch/wJnRqDHNe_u',
+        'md5': 'c8f263dd47e66cc17546b3abf47b5a77',
+        'info_dict': {
+            'id': 'wJnRqDHNe_u',
+            'ext': 'mp4',
+            'title': 'Gissy Talks: YouTube Alternatives',
+            'thumbnail': r're:^https?://.*\.jpg$',
+            'description': 'md5:e65036f0d4af80e0af191bd11af5195e',
+            'uploader': 'GissyEva',
+            'duration': 630.451,
+        }
+    }, {
+        'url': 'https://wevidi.net/watch/4m1c4yJR_yc',
+        'md5': 'c63ce5ca6990dce86855fc02ca5bc1ed',
+        'info_dict': {
+            'id': '4m1c4yJR_yc',
+            'ext': 'mp4',
+            'title': 'Enough of that! - Awesome Exilez Podcast',
+            'thumbnail': r're:^https?://.*\.jpg$',
+            'description': 'md5:96af99dd63468b2dfab3020560e3e9b2',
+            'uploader': 'eclecRC',
+            'duration': 6.804,
+        }
+    }]
+
+    def _extract_formats(self, wvplayer_props):
+        # Taken from WeVidi player JS: https://wevidi.net/layouts/default/static/player.min.js
+        resolution_map = {
+            1: 144,
+            2: 240,
+            3: 360,
+            4: 480,
+            5: 720,
+            6: 1080
+        }
+
+        src_path = f'{wvplayer_props["srcVID"]}/{wvplayer_props["srcUID"]}/{wvplayer_props["srcNAME"]}'
+        for res in traverse_obj(wvplayer_props, ('resolutions', ..., {int}, {lambda x: x or None})):
+            format_id = str(-(res // -2) - 1)
+            yield {
+                'acodec': 'mp4a.40.2',
+                'ext': 'mp4',
+                'format_id': format_id,
+                'height': resolution_map.get(res),
+                'url': f'https://www.wevidi.net/videoplayback/{src_path}/{format_id}',
+                'vcodec': 'avc1.42E01E',
+            }
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+
+        wvplayer_props = self._search_json(
+            r'WVPlayer\(', webpage, 'player', video_id,
+            transform_source=lambda x: js_to_json(x.replace('||', '}')))
+
+        return {
+            'id': video_id,
+            'title': clean_html(get_element_by_class('video_title', webpage)),
+            'description': clean_html(get_element_by_class('descr_long', webpage)),
+            'uploader': clean_html(get_element_by_class('username', webpage)),
+            'formats': list(self._extract_formats(wvplayer_props)),
+            'thumbnail': self._og_search_thumbnail(webpage),
+            'duration': float_or_none(wvplayer_props.get('duration')),
+        }


Test patch: