From e4a0ebba4f39cc55e8d070e12b6597ab5c3745d3 Mon Sep 17 00:00:00 2001 From: imgyh <1974355683@qq.com> Date: Sun, 19 Mar 2023 13:07:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(live):=20=E7=9B=B4=E6=92=AD=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=94=AF=E6=8C=81APP=E7=AB=AF=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TikTok.py | 8 ++++++++ TikTokUrls.py | 1 + 2 files changed, 9 insertions(+) diff --git a/TikTok.py b/TikTok.py index 62fa7f2..026716b 100644 --- a/TikTok.py +++ b/TikTok.py @@ -93,6 +93,14 @@ class TikTok(object): # 获取原声 id key = re.findall('music/(\d+)?', urlstr)[0] key_type = "music" + elif "/webcast/reflow/" in urlstr: + key1 = re.findall('reflow/(\d+)?', urlstr)[0] + url = self.urls.LIVE2 + self.utils.getXbogus( + f'live_id=1&room_id={key1}&app_id=1128') + res = requests.get(url, headers=self.headers) + resjson = json.loads(res.text) + key = resjson['data']['room']['owner']['web_rid'] + key_type = "live" elif "live.douyin.com" in r.url: key = r.url.replace('https://live.douyin.com/', '') key_type = "live" diff --git a/TikTokUrls.py b/TikTokUrls.py index 306b4f5..ccedc78 100644 --- a/TikTokUrls.py +++ b/TikTokUrls.py @@ -70,6 +70,7 @@ class Urls(object): # 直播 self.LIVE = 'https://live.douyin.com/webcast/room/web/enter/?' + self.LIVE2 = 'https://webcast.amemv.com/webcast/room/reflow/info/?' # 音乐 self.MUSIC = 'https://www.douyin.com/aweme/v1/web/music/aweme/?'