Skip to content

Commit b2af4d1

Browse files
committed
refactor(app): 修复动态图片无法下载的问题
1 parent e43a018 commit b2af4d1

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

source/application/image.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ def __extract_image_token(url: str) -> str:
5555

5656
@staticmethod
5757
def __get_live_link(items: list) -> list:
58-
return [
59-
(
60-
Html.format_url(
61-
Namespace.object_extract(item, "stream.h264[0].masterUrl")
62-
)
63-
or None
64-
)
65-
for item in items
66-
]
58+
result = []
59+
for item in items:
60+
url = None
61+
stream = Namespace.object_extract(item, "stream", {})
62+
for key in vars(stream):
63+
url = Namespace.object_extract(
64+
stream, f"{key}[0].backupUrls[0]"
65+
) or Namespace.object_extract(stream, f"{key}[0].masterUrl")
66+
if url := Html.format_url(url):
67+
break
68+
result.append(url)
69+
return result

static/Release_Notes.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
3. 修复 CLI 模式 KeyError 异常
66
4. 修复控制字符导致程序报错的问题
77
5. 修复部分分享链接提取失败的问题
8-
6. 优化用户脚本与程序联动功能
9-
7. 优化视频下载链接提取逻辑
10-
8. 新增单独保存作品信息功能
11-
9. 重构项目内置请求延时机制
12-
10. 新增对 RedNote 的支持
13-
11. 支持图形用户交互界面
8+
6. 修复动态图片无法下载的问题
9+
7. 优化用户脚本与程序联动功能
10+
8. 优化视频下载链接提取逻辑
11+
9. 新增单独保存作品信息功能
12+
10. 重构项目内置请求延时机制
13+
11. 新增对 RedNote 的支持
14+
12. 支持图形用户交互界面
1415

1516
*****
1617

0 commit comments

Comments
 (0)