Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API response empty data #269 #274

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]}&aid=1128&version_name=23.5.0&device_platform=android&os_version=2333"
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