Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
download
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
download
Commits
155227b6
Commit
155227b6
authored
Oct 28, 2022
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "1"
This reverts commit
f849aae0
.
parent
f849aae0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
download.py
download.py
+13
-0
No files found.
download.py
View file @
155227b6
...
...
@@ -25,6 +25,7 @@ class DownFile:
self
.
save_path
=
save_path
self
.
page_string
=
page_string
self
.
call_date_string
=
call_date_string
self
.
lock
=
threading
.
Lock
()
@staticmethod
def
ali_yun_sdk
(
call_time
,
call_id
):
...
...
@@ -89,6 +90,9 @@ class DownFile:
if
len
(
item
[
'voice_file'
])
>
0
:
local_file
=
self
.
save_path
+
item
[
'voice_file'
]
if
self
.
check_file
(
local_file
):
self
.
lock
.
acquire
()
self
.
old_num
=
self
.
old_num
+
1
self
.
lock
.
release
()
continue
time_array
=
time
.
strptime
(
item
[
'call_time'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
...
...
@@ -136,13 +140,22 @@ class DownFile:
continue
if
self
.
check_file
(
local_file
):
self
.
lock
.
acquire
()
self
.
old_num
=
self
.
old_num
+
1
self
.
lock
.
release
()
continue
self
.
check_dir
(
self
.
save_path
+
local_dir
)
result
=
request
.
urlretrieve
(
url
,
local_file
)
self
.
lock
.
acquire
()
self
.
download_num
=
self
.
download_num
+
1
self
.
lock
.
release
()
self
.
log
(
'url'
,
url
)
self
.
log
(
'download_file'
,
result
)
self
.
log
(
"download_num"
,
self
.
download_num
)
self
.
log
(
"old_num"
,
self
.
old_num
)
def
download_remote
(
self
,
data
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment