[ie/tiktok:live] Fix room ID extraction (#10408)

Closes #10407
Authored by: mokrueger
pull/10402/head^2
mokrueger 4 months ago committed by GitHub
parent 04e17ba20a
commit d2189d3d36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1458,9 +1458,11 @@ class TikTokLiveIE(TikTokBaseIE):
if webpage: if webpage:
data = self._get_sigi_state(webpage, uploader or room_id) data = self._get_sigi_state(webpage, uploader or room_id)
room_id = (traverse_obj(data, ('UserModule', 'users', ..., 'roomId', {str_or_none}), get_all=False) room_id = (
or self._search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=None) traverse_obj(data, ((
or room_id) ('LiveRoom', 'liveRoomUserInfo', 'user'),
('UserModule', 'users', ...)), 'roomId', {str}, any))
or self._search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=room_id))
uploader = uploader or traverse_obj( uploader = uploader or traverse_obj(
data, ('LiveRoom', 'liveRoomUserInfo', 'user', 'uniqueId'), data, ('LiveRoom', 'liveRoomUserInfo', 'user', 'uniqueId'),
('UserModule', 'users', ..., 'uniqueId'), get_all=False, expected_type=str) ('UserModule', 'users', ..., 'uniqueId'), get_all=False, expected_type=str)

Loading…
Cancel
Save