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 ',
26 'download_count': int,
27 'artist': 'Huỳnh Hồng Quân ',
28 'timestamp': 1651571320,
29 'upload_date': '20220503',
31 'uploader_id': 'huynh_hong_quan_',
37 'url': 'https://likee.video/@649222262/video/7093167848050058862',
39 'id': '7093167848050058862',
41 'title': 'likee video #7093167848050058862',
42 'description': 'md5:3f971c8c6ee8a216f2b1a9094c5de99f',
43 'thumbnail': r
're:^https?://.+\.jpg',
46 'uploader': 'Vương Phước Nhi',
47 'download_count': int,
48 'timestamp': 1651506835,
49 'upload_date': '20220502',
52 'artist': 'Vương Phước Nhi',
53 'uploader_id': '649222262',
57 'url': 'https://likee.video/@fernanda_rivasg/video/6932224568407629502',
59 'id': '6932224568407629502',
61 'title': 'Un trend viejito🔥 #LIKEE #Ferlovers #trend ',
62 'description': 'md5:c42b903a72a99d6d8b73e3d1126fbcef',
63 'thumbnail': r
're:^https?://.+\.jpg',
66 'uploader_id': 'fernanda_rivasg',
69 'artist': 'La Cami La✨',
70 'download_count': int,
72 'uploader': 'Fernanda Rivas🎶',
73 'timestamp': 1614034308,
74 'upload_date': '20210222',
77 'url': 'https://likee.video/v/k6QcOp',
81 'title': '#AguaChallenge tú ya lo intentaste?😱🤩',
82 'description': 'md5:b0cc462689d4ff2b624daa4dba7640d9',
83 'thumbnail': r
're:^https?://.+\.jpg',
88 'timestamp': 1611694774,
90 'uploader': 'Fernanda Rivas🎶',
91 'uploader_id': 'fernanda_rivasg',
92 'download_count': int,
93 'artist': 'ʟᴇʀɪᴋ_ᴜɴɪᴄᴏʀɴ♡︎',
94 'upload_date': '20210126',
97 'url': 'https://www.likee.video/@649222262/video/7093167848050058862',
98 'only_matching': True,
100 'url': 'https://www.likee.video/v/k6QcOp',
101 'only_matching': True,
104 def _real_extract(self
, url
):
105 video_id
= self
._match
_id
(url
)
106 webpage
= self
._download
_webpage
(url
, video_id
)
107 info
= self
._parse
_json
(
108 self
._search
_regex
(r
'window\.data\s=\s({.+?});', webpage
, 'video info'),
109 video_id
, transform_source
=js_to_json
)
110 video_url
= traverse_obj(info
, 'video_url', ('originVideoInfo', 'video_url'))
112 self
.raise_no_formats('Video was deleted', expected
=True)
114 'format_id': 'mp4-with-watermark',
116 'height': info
.get('video_height'),
117 'width': info
.get('video_width'),
119 'format_id': 'mp4-without-watermark',
120 'url': video_url
.replace('_4', ''),
121 'height': info
.get('video_height'),
122 'width': info
.get('video_width'),
127 'title': info
.get('msgText'),
128 'description': info
.get('share_desc'),
129 'view_count': int_or_none(info
.get('video_count')),
130 'like_count': int_or_none(info
.get('likeCount')),
131 'play_count': int_or_none(info
.get('play_count')),
132 'download_count': int_or_none(info
.get('download_count')),
133 'comment_count': int_or_none(info
.get('comment_count')),
134 'uploader': str_or_none(info
.get('nick_name')),
135 'uploader_id': str_or_none(info
.get('likeeId')),
136 'artist': str_or_none(traverse_obj(info
, ('sound', 'owner_name'))),
137 'timestamp': parse_iso8601(info
.get('uploadDate')),
138 'thumbnail': info
.get('coverUrl'),
139 'duration': int_or_none(traverse_obj(info
, ('option_data', 'dur'))),
144 class LikeeUserIE(InfoExtractor
):
145 IE_NAME
= 'likee:user'
146 _VALID_URL
= r
'https?://(www\.)?likee\.video/(?P<id>[^/]+)/?$'
148 'url': 'https://likee.video/@fernanda_rivasg',
151 'title': 'fernanda_rivasg',
153 'playlist_mincount': 500,
155 'url': 'https://likee.video/@may_hmoob',
158 'title': 'may_hmoob',
160 'playlist_mincount': 80,
163 _API_GET_USER_VIDEO
= 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
165 def _entries(self
, user_name
, user_id
):
168 user_videos
= self
._download
_json
(
169 self
._API
_GET
_USER
_VIDEO
, user_name
,
172 'count': self
._PAGE
_SIZE
,
173 'lastPostId': last_post_id
,
176 headers
={'content-type': 'application/json'}
,
177 note
=f
'Get user info with lastPostId #{last_post_id}')
178 items
= traverse_obj(user_videos
, ('data', 'videoList'))
182 last_post_id
= item
['postId']
183 yield self
.url_result(f
'https://likee.video/{user_name}/video/{last_post_id}')
185 def _real_extract(self
, url
):
186 user_name
= self
._match
_id
(url
)
187 webpage
= self
._download
_webpage
(url
, user_name
)
188 info
= self
._parse
_json
(
189 self
._search
_regex
(r
'window\.data\s*=\s*({.+?});', webpage
, 'user info'),
190 user_name
, transform_source
=js_to_json
)
191 user_id
= traverse_obj(info
, ('userinfo', 'uid'))
192 return self
.playlist_result(self
._entries
(user_name
, user_id
), user_id
, traverse_obj(info
, ('userinfo', 'user_name')))