Skip to content

Commit

Permalink
🚑Fix API response empty data Johnserf-Seed#269
Browse files Browse the repository at this point in the history
- 我只是简单的修改了代码中的API链接以及JSON的索引
- 没有经过在本地测试,希望作者merge前先将代码复制到本地进行测试。
- 不确定此API是否能长期稳定请求
  • Loading branch information
Evil0ctal authored Dec 22, 2022
1 parent 3c98efc commit 01cbbbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Util/Download.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def VideoDownload(self, profileData):
# 获取单部视频接口信息
try:
# 官方接口
jx_url = f'https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids={self.aweme_id[i]}'
jx_url = f'https://www.iesdouyin.com/aweme/v1/web/aweme/detail/?aweme_id={self.aweme_id[i]}'
js = Util.json.loads(Util.requests.get(
url=jx_url, headers=self.headers).text)

creat_time = Util.time.strftime(
"%Y-%m-%d %H.%M.%S", Util.time.localtime(js['item_list'][0]['create_time']))
"%Y-%m-%d %H.%M.%S", Util.time.localtime(js['aweme_detail']['create_time']))
except Exception as e:
Util.log.warning(e)
print('[ 🚩 ]:%s\r' % e)
Expand Down Expand Up @@ -93,9 +93,9 @@ def VideoDownload(self, profileData):
# 尝试下载音频
try:
if self.music == "yes": # 保留音频
music_url = str(js['item_list'][0]['music']
music_url = str(js['aweme_detail']['music']
['play_url']['url_list'][0])
music_title = str(js['item_list'][0]['music']['author'])
music_title = str(js['aweme_detail']['music']['author'])
music = Util.requests.get(
music_url) # 保存音频
start = Util.time.time() # 下载开始时间
Expand Down

0 comments on commit 01cbbbe

Please sign in to comment.