FIx force and crash
This commit is contained in:
parent
7591eae028
commit
23bcb49a5f
@ -2,6 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -25,14 +26,19 @@ def drive_list(path):
|
|||||||
|
|
||||||
|
|
||||||
def download(path, file):
|
def download(path, file):
|
||||||
if os.path.isfile(os.path.join(path, file)):
|
if not force and os.path.isfile(os.path.join(path, file)):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["rclone", "copy", "-P", "-v", f"{remote}:{path}/{file}", f"{path}/"],
|
["rclone", "copy", "-P", "-v", f"{remote}:{path}/{file}", f"{path}/"],
|
||||||
check=True,
|
check=True,
|
||||||
stdout=sys.stdout,
|
stdout=sys.stdout,
|
||||||
)
|
)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print("Waiting for 10 minutes ...")
|
||||||
|
time.sleep(10 * 60)
|
||||||
|
download(path, file)
|
||||||
|
|
||||||
|
|
||||||
req_titles = requests.get(
|
req_titles = requests.get(
|
||||||
@ -62,7 +68,7 @@ for base in bases:
|
|||||||
|
|
||||||
id = re_id.group(1)
|
id = re_id.group(1)
|
||||||
|
|
||||||
if not force and id not in titles:
|
if id not in titles:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
id = id[0:-4]
|
id = id[0:-4]
|
||||||
|
Loading…
Reference in New Issue
Block a user