diff --git a/TikTok.py b/TikTok.py index ecc996c..314a936 100644 --- a/TikTok.py +++ b/TikTok.py @@ -418,8 +418,7 @@ class TikTok(object): # 分区 self.result.liveDict["partition"] = live_json['data']['partition_road_map']['partition']['title'] self.result.liveDict["sub_partition"] = \ - live_json['data']['partition_road_map']['sub_partition']['partition'][ - 'title'] + live_json['data']['partition_road_map']['sub_partition']['partition']['title'] except Exception as e: self.result.liveDict["partition"] = '无' self.result.liveDict["sub_partition"] = '无' @@ -429,8 +428,7 @@ class TikTok(object): for i, f in enumerate(self.result.liveDict["flv_pull_url"].keys()): flv.append(f) - self.result.liveDict["flv_pull_url0"] = self.result.liveDict["flv_pull_url"][flv[0]].replace("http://", - "https://") + self.result.liveDict["flv_pull_url0"] = self.result.liveDict["flv_pull_url"][flv[0]] return self.result.liveDict, live_json @@ -498,8 +496,7 @@ class TikTok(object): # 分区 self.result.liveDict["partition"] = live_json['data']['partition_road_map']['partition']['title'] self.result.liveDict["sub_partition"] = \ - live_json['data']['partition_road_map']['sub_partition']['partition'][ - 'title'] + live_json['data']['partition_road_map']['sub_partition']['partition']['title'] except Exception as e: self.result.liveDict["partition"] = '无' self.result.liveDict["sub_partition"] = '无' @@ -517,8 +514,7 @@ class TikTok(object): rate = int(input('[ 🎬 ]输入数字选择推流清晰度:')) - self.result.liveDict["flv_pull_url0"] = self.result.liveDict["flv_pull_url"][flv[rate]].replace("http://", - "https://") + self.result.liveDict["flv_pull_url0"] = self.result.liveDict["flv_pull_url"][flv[rate]] # 显示清晰度列表 print('[ %s ]:%s' % (flv[rate], self.result.liveDict["flv_pull_url"][flv[rate]])) @@ -949,7 +945,7 @@ class TikTok(object): pass else: try: - url = awemeDict["video"]["play_addr"]["url_list"] + url = awemeDict["video"]["play_addr"]["url_list"][0] if url != "": self.isdwownload = False # task_id = self.progress.add_task("download", filename="[ 视频 ]:" + desc, start=False) diff --git a/TikTokResult.py b/TikTokResult.py index b13837d..4a3b296 100644 --- a/TikTokResult.py +++ b/TikTokResult.py @@ -121,7 +121,7 @@ class Result(object): self.videoDict = { "play_addr": { "uri": "", - "url_list": "", + "url_list": [], }, "cover_original_scale": { "height": "", @@ -259,7 +259,7 @@ class Result(object): # 使用 这个api 可以获得1080p # dataNew[item]["url_list"] = "https://aweme.snssdk.com/aweme/v1/play/?video_id=%s&ratio=1080p&line=0" \ # % dataNew[item]["uri"] - dataNew[item]["url_list"] = dataRaw["bit_rate"][0]["play_addr"]["url_list"][0] + dataNew[item]["url_list"] = copy.deepcopy(dataRaw["bit_rate"][0]["play_addr"]["url_list"]) continue # 常规 递归遍历 字典