Skip to content

Commit 6aa2b79

Browse files
authored
Merge pull request Samueli924#172 from p0ise/main
fix property key error bug
2 parents ca15803 + 3feba3a commit 6aa2b79

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

main.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ def do_work(chaoxingAPI):
5252
if attachment.get('type') != 'video': # 非视频任务跳过
5353
print("跳过非视频任务")
5454
continue
55-
print(f"\n当前视频:{attachment['property']['name']}")
55+
if attachment.get('property', False):
56+
name = attachment['property']['name']
57+
else:
58+
name = attachment['objectId']
59+
print(f"\n当前视频:{name}")
5660
if attachment.get('isPassed'):
5761
print("当前视频任务已完成")
58-
ft.show_progress(attachment['property']['name'], 1, 1)
62+
ft.show_progress(name, 1, 1)
5963
time.sleep(1)
6064
continue
6165
video_info = chaoxingAPI.get_d_token(
@@ -70,7 +74,7 @@ def do_work(chaoxingAPI):
7074
else:
7175
if "jobid" in attachment:
7276
jobid = attachment["jobid"]
73-
else:
77+
elif attachment.get('property', False):
7478
if "jobid" in attachment['property']:
7579
jobid = attachment['property']['jobid']
7680
else:

0 commit comments

Comments
 (0)