Repository: yt-dlp/yt-dlp

Issue:
support for likee.video
### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running yt-dlp version **2022.04.08** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that none of provided URLs [violate any copyrights](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [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 am willing to share it if required

### Region

USA

### Example URLs

Video url: https://likee.video/v/k6QcOp
Channel url: https://l.likee.video/p/Gp6YGd

### Description

Can we get channel support for likee.video. Single video download works, I am requesting channel support. 

There seemed to be support for this on the youtube-dl github

https://github.com/ytdl-org/youtube-dl/issues/27999

and it looked like it was in development. 

https://github.com/ytdl-org/youtube-dl/pull/28868/files

I don't have any programming skills to check if this is useful information. 


### Verbose log

```shell
e:\test>yt-dlp --verbose https://likee.video/@fernanda_rivasg
[debug] Command-line config: ['--verbose', 'https://likee.video/@fernanda_rivasg']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2022.04.08 [7884ade] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: avprobe -bsfs
[debug] exe versions: ffmpeg 4.2.3
[debug] Optional libraries: brotli, certifi, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [generic] Extracting URL: https://likee.video/@fernanda_rivasg
[generic] @fernanda_rivasg: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] @fernanda_rivasg: Downloading webpage
[generic] @fernanda_rivasg: Extracting information
[debug] Looking for video embeds
WARNING: [generic] @fernanda_rivasg: Failed to parse JSON Expecting value: line 1 column 3 (char 2)
WARNING: [generic] @fernanda_rivasg: Failed to parse JSON Expecting value: line 1 column 3 (char 2)
ERROR: Unsupported URL: https://likee.video/@fernanda_rivasg
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1408, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1478, in __extract_info
  File "yt_dlp\extractor\common.py", line 641, in extract
  File "yt_dlp\extractor\generic.py", line 4039, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://likee.video/@fernanda_rivasg
```



Discussion:

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
@@ -788,6 +788,10 @@
     LifeNewsIE,
     LifeEmbedIE,
 )
+from .likee import (
+    LikeeIE,
+    LikeeUserIE
+)
 from .limelight import (
     LimelightMediaIE,
     LimelightChannelIE,
diff --git a/yt_dlp/extractor/likee.py b/yt_dlp/extractor/likee.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/likee.py
@@ -0,0 +1,193 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+    int_or_none,
+    js_to_json,
+    parse_iso8601,
+    str_or_none,
+    traverse_obj,
+)
+
+
+class LikeeIE(InfoExtractor):
+    IE_NAME = 'likee'
+    _VALID_URL = r'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^/]+)/video/|v/)(?P<id>\w+)'
+    _TESTS = [{
+        'url': 'https://likee.video/@huynh_hong_quan_/video/7093444807096327263',
+        'info_dict': {
+            'id': '7093444807096327263',
+            'ext': 'mp4',
+            'title': '🤴🤴🤴',
+            'description': 'md5:9a7ebe816f0e78722ee5ed76f75983b4',
+            'thumbnail': r're:^https?://.+\.jpg',
+            'uploader': 'Huỳnh Hồng Qu&acirc;n ',
+            'play_count': int,
+            'download_count': int,
+            'artist': 'Huỳnh Hồng Qu&acirc;n ',
+            'timestamp': 1651571320,
+            'upload_date': '20220503',
+            'view_count': int,
+            'uploader_id': 'huynh_hong_quan_',
+            'duration': 12374,
+            'comment_count': int,
+            'like_count': int,
+        },
+    }, {
+        'url': 'https://likee.video/@649222262/video/7093167848050058862',
+        'info_dict': {
+            'id': '7093167848050058862',
+            'ext': 'mp4',
+            'title': 'likee video #7093167848050058862',
+            'description': 'md5:3f971c8c6ee8a216f2b1a9094c5de99f',
+            'thumbnail': r're:^https?://.+\.jpg',
+            'comment_count': int,
+            'like_count': int,
+            'uploader': 'Vương Phước Nhi',
+            'download_count': int,
+            'timestamp': 1651506835,
+            'upload_date': '20220502',
+            'duration': 60024,
+            'play_count': int,
+            'artist': 'Vương Phước Nhi',
+            'uploader_id': '649222262',
+            'view_count': int,
+        },
+    }, {
+        'url': 'https://likee.video/@fernanda_rivasg/video/6932224568407629502',
+        'info_dict': {
+            'id': '6932224568407629502',
+            'ext': 'mp4',
+            'title': 'Un trend viejito🔥 #LIKEE #Ferlovers #trend ',
+            'description': 'md5:c42b903a72a99d6d8b73e3d1126fbcef',
+            'thumbnail': r're:^https?://.+\.jpg',
+            'comment_count': int,
+            'duration': 9684,
+            'uploader_id': 'fernanda_rivasg',
+            'view_count': int,
+            'play_count': int,
+            'artist': 'La Cami La✨',
+            'download_count': int,
+            'like_count': int,
+            'uploader': 'Fernanda Rivas🎶',
+            'timestamp': 1614034308,
+            'upload_date': '20210222',
+        },
+    }, {
+        'url': 'https://likee.video/v/k6QcOp',
+        'info_dict': {
+            'id': 'k6QcOp',
+            'ext': 'mp4',
+            'title': '#AguaChallenge t&uacute; ya lo intentaste?😱🤩',
+            'description': 'md5:b0cc462689d4ff2b624daa4dba7640d9',
+            'thumbnail': r're:^https?://.+\.jpg',
+            'comment_count': int,
+            'duration': 18014,
+            'play_count': int,
+            'view_count': int,
+            'timestamp': 1611694774,
+            'like_count': int,
+            'uploader': 'Fernanda Rivas🎶',
+            'uploader_id': 'fernanda_rivasg',
+            'download_count': int,
+            'artist': 'ʟᴇʀɪᴋ_ᴜɴɪᴄᴏʀɴ♡︎',
+            'upload_date': '20210126',
+        },
+    }, {
+        'url': 'https://www.likee.video/@649222262/video/7093167848050058862',
+        'only_matching': True,
+    }, {
+        'url': 'https://www.likee.video/v/k6QcOp',
+        'only_matching': True,
+    }]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+        info = self._parse_json(
+            self._search_regex(r'window\.data\s=\s({.+?});', webpage, 'video info'),
+            video_id, transform_source=js_to_json)
+        video_url = traverse_obj(info, 'video_url', ('originVideoInfo', 'video_url'))
+        if not video_url:
+            self.raise_no_formats('Video was deleted', expected=True)
+        formats = [{
+            'format_id': 'mp4-with-watermark',
+            'url': video_url,
+            'height': info.get('video_height'),
+            'width': info.get('video_width'),
+        }, {
+            'format_id': 'mp4-without-watermark',
+            'url': video_url.replace('_4', ''),
+            'height': info.get('video_height'),
+            'width': info.get('video_width'),
+            'quality': 1,
+        }]
+        self._sort_formats(formats)
+        return {
+            'id': video_id,
+            'title': info.get('msgText'),
+            'description': info.get('share_desc'),
+            'view_count': int_or_none(info.get('video_count')),
+            'like_count': int_or_none(info.get('likeCount')),
+            'play_count': int_or_none(info.get('play_count')),
+            'download_count': int_or_none(info.get('download_count')),
+            'comment_count': int_or_none(info.get('comment_count')),
+            'uploader': str_or_none(info.get('nick_name')),
+            'uploader_id': str_or_none(info.get('likeeId')),
+            'artist': str_or_none(traverse_obj(info, ('sound', 'owner_name'))),
+            'timestamp': parse_iso8601(info.get('uploadDate')),
+            'thumbnail': info.get('coverUrl'),
+            'duration': int_or_none(traverse_obj(info, ('option_data', 'dur'))),
+            'formats': formats,
+        }
+
+
+class LikeeUserIE(InfoExtractor):
+    IE_NAME = 'likee:user'
+    _VALID_URL = r'https?://(www\.)?likee\.video/(?P<id>[^/]+)/?$'
+    _TESTS = [{
+        'url': 'https://likee.video/@fernanda_rivasg',
+        'info_dict': {
+            'id': '925638334',
+            'title': 'fernanda_rivasg',
+        },
+        'playlist_mincount': 500,
+    }, {
+        'url': 'https://likee.video/@may_hmoob',
+        'info_dict': {
+            'id': '2943949041',
+            'title': 'may_hmoob',
+        },
+        'playlist_mincount': 80,
+    }]
+    _PAGE_SIZE = 50
+    _API_GET_USER_VIDEO = 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
+
+    def _entries(self, user_name, user_id):
+        last_post_id = ''
+        while True:
+            user_videos = self._download_json(
+                self._API_GET_USER_VIDEO, user_name,
+                data=json.dumps({
+                    'uid': user_id,
+                    'count': self._PAGE_SIZE,
+                    'lastPostId': last_post_id,
+                    'tabType': 0,
+                }).encode('utf-8'),
+                headers={'content-type': 'application/json'},
+                note=f'Get user info with lastPostId #{last_post_id}')
+            items = traverse_obj(user_videos, ('data', 'videoList'))
+            if not items:
+                break
+            for item in items:
+                last_post_id = item['postId']
+                yield self.url_result(f'https://likee.video/{user_name}/video/{last_post_id}')
+
+    def _real_extract(self, url):
+        user_name = self._match_id(url)
+        webpage = self._download_webpage(url, user_name)
+        info = self._parse_json(
+            self._search_regex(r'window\.data\s*=\s*({.+?});', webpage, 'user info'),
+            user_name, transform_source=js_to_json)
+        user_id = traverse_obj(info, ('userinfo', 'uid'))
+        return self.playlist_result(self._entries(user_name, user_id), user_id, traverse_obj(info, ('userinfo', 'user_name')))


Test patch: