3 from .common
import InfoExtractor
13 class LikeeIE(InfoExtractor
):
15 _VALID_URL
= r
'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^/]+)/video/|v/)(?P<id>\w+)'
17 'url': 'https://likee.video/@huynh_hong_quan_/video/7093444807096327263',
19 'id': '7093444807096327263',
22 'description': 'md5:9a7ebe816f0e78722ee5ed76f75983b4',
23 'thumbnail': r
're:^https?://.+\.jpg',
24 'uploader': 'Huỳnh Hồng Quân ',
25 'artist': 'Huỳnh Hồng Quân ',
26 'timestamp': 1651571320,
27 'upload_date': '20220503',
29 'uploader_id': 'huynh_hong_quan_',
35 'url': 'https://likee.video/@649222262/video/7093167848050058862',
37 'id': '7093167848050058862',
39 'title': 'likee video #7093167848050058862',
40 'description': 'md5:3f971c8c6ee8a216f2b1a9094c5de99f',
41 'thumbnail': r
're:^https?://.+\.jpg',
44 'uploader': 'Vương Phước Nhi',
45 'timestamp': 1651506835,
46 'upload_date': '20220502',
48 'artist': 'Vương Phước Nhi',
49 'uploader_id': '649222262',
53 'url': 'https://likee.video/@fernanda_rivasg/video/6932224568407629502',
55 'id': '6932224568407629502',
57 'title': 'Un trend viejito🔥 #LIKEE #Ferlovers #trend ',
58 'description': 'md5:c42b903a72a99d6d8b73e3d1126fbcef',
59 'thumbnail': r
're:^https?://.+\.jpg',
62 'uploader_id': 'fernanda_rivasg',
64 'artist': 'La Cami La✨',
66 'uploader': 'Fernanda Rivas🎶',
67 'timestamp': 1614034308,
68 'upload_date': '20210222',
71 'url': 'https://likee.video/v/k6QcOp',
75 'title': '#AguaChallenge tú ya lo intentaste?😱🤩',
76 'description': 'md5:b0cc462689d4ff2b624daa4dba7640d9',
77 'thumbnail': r
're:^https?://.+\.jpg',
81 'timestamp': 1611694774,
83 'uploader': 'Fernanda Rivas🎶',
84 'uploader_id': 'fernanda_rivasg',
85 'artist': 'ʟᴇʀɪᴋ_ᴜɴɪᴄᴏʀɴ♡︎',
86 'upload_date': '20210126',
89 'url': 'https://www.likee.video/@649222262/video/7093167848050058862',
90 'only_matching': True,
92 'url': 'https://www.likee.video/v/k6QcOp',
93 'only_matching': True,
96 def _real_extract(self
, url
):
97 video_id
= self
._match
_id
(url
)
98 webpage
= self
._download
_webpage
(url
, video_id
)
99 info
= self
._parse
_json
(
100 self
._search
_regex
(r
'window\.data\s=\s({.+?});', webpage
, 'video info'),
101 video_id
, transform_source
=js_to_json
)
102 video_url
= traverse_obj(info
, 'video_url', ('originVideoInfo', 'video_url'))
104 self
.raise_no_formats('Video was deleted', expected
=True)
106 'format_id': 'mp4-with-watermark',
108 'height': info
.get('video_height'),
109 'width': info
.get('video_width'),
111 'format_id': 'mp4-without-watermark',
112 'url': video_url
.replace('_4', ''),
113 'height': info
.get('video_height'),
114 'width': info
.get('video_width'),
119 'title': info
.get('msgText'),
120 'description': info
.get('share_desc'),
121 'view_count': int_or_none(info
.get('video_count')),
122 'like_count': int_or_none(info
.get('likeCount')),
123 'comment_count': int_or_none(info
.get('comment_count')),
124 'uploader': str_or_none(info
.get('nick_name')),
125 'uploader_id': str_or_none(info
.get('likeeId')),
126 'artist': str_or_none(traverse_obj(info
, ('sound', 'owner_name'))),
127 'timestamp': parse_iso8601(info
.get('uploadDate')),
128 'thumbnail': info
.get('coverUrl'),
129 'duration': int_or_none(traverse_obj(info
, ('option_data', 'dur'))),
134 class LikeeUserIE(InfoExtractor
):
135 IE_NAME
= 'likee:user'
136 _VALID_URL
= r
'https?://(www\.)?likee\.video/(?P<id>[^/]+)/?$'
138 'url': 'https://likee.video/@fernanda_rivasg',
141 'title': 'fernanda_rivasg',
143 'playlist_mincount': 500,
145 'url': 'https://likee.video/@may_hmoob',
148 'title': 'may_hmoob',
150 'playlist_mincount': 80,
153 _API_GET_USER_VIDEO
= 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
155 def _entries(self
, user_name
, user_id
):
158 user_videos
= self
._download
_json
(
159 self
._API
_GET
_USER
_VIDEO
, user_name
,
162 'count': self
._PAGE
_SIZE
,
163 'lastPostId': last_post_id
,
166 headers
={'content-type': 'application/json'},
167 note
=f
'Get user info with lastPostId #{last_post_id}')
168 items
= traverse_obj(user_videos
, ('data', 'videoList'))
172 last_post_id
= item
['postId']
173 yield self
.url_result(f
'https://likee.video/{user_name}/video/{last_post_id}')
175 def _real_extract(self
, url
):
176 user_name
= self
._match
_id
(url
)
177 webpage
= self
._download
_webpage
(url
, user_name
)
178 info
= self
._parse
_json
(
179 self
._search
_regex
(r
'window\.data\s*=\s*({.+?});', webpage
, 'user info'),
180 user_name
, transform_source
=js_to_json
)
181 user_id
= traverse_obj(info
, ('userinfo', 'uid'))
182 return self
.playlist_result(self
._entries
(user_name
, user_id
), user_id
, traverse_obj(info
, ('userinfo', 'user_name')))