Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
CDNDrive
提交
78665780
C
CDNDrive
项目概览
OpenDocCN
/
CDNDrive
通知
12
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
CDNDrive
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
78665780
编写于
8月 16, 2020
作者:
W
wizardforcel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
将图像处理逻辑引至 API 类
上级
22d3ec53
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
3 deletion
+3
-3
CDNDrive/__main__.py
CDNDrive/__main__.py
+2
-2
CDNDrive/drivers/BaseApi.py
CDNDrive/drivers/BaseApi.py
+1
-1
未找到文件。
CDNDrive/__main__.py
浏览文件 @
78665780
...
...
@@ -45,7 +45,7 @@ def load_api_by_prefix(s):
def
fetch_meta
(
s
):
url
=
api
.
meta2real
(
s
)
if
not
url
:
return
None
full_meta
=
image_download
(
url
)
full_meta
=
api
.
image_download
(
url
)
if
not
full_meta
:
return
None
meta_dict
=
json
.
loads
(
encoder
.
decode
(
full_meta
).
decode
(
"utf-8"
))
return
meta_dict
...
...
@@ -171,7 +171,7 @@ def tr_download(i, block_dict, f, offset):
url
=
block_dict
[
'url'
]
for
j
in
range
(
10
):
if
not
succ
:
break
block
=
image_download
(
url
)
block
=
api
.
image_download
(
url
)
if
not
block
:
log
(
f
"分块
{
i
+
1
}
/
{
nblocks
}
第
{
j
+
1
}
次下载失败"
)
if
j
==
9
:
succ
=
False
...
...
CDNDrive/drivers/BaseApi.py
浏览文件 @
78665780
...
...
@@ -17,7 +17,7 @@ class BaseApi:
def
get_user_info
(
self
,
fmt
=
True
):
return
'获取用户信息功能尚未实现'
def
image_download
(
url
):
def
image_download
(
self
,
url
):
return
image_download
(
url
)
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录