mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
wget: delete url file
This commit is contained in:
parent
fe323f59af
commit
12b7317831
|
@ -25,7 +25,7 @@ from urllib.parse import unquote_to_bytes as unquote
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
fp = sys.argv[1]
|
fp = os.path.abspath(sys.argv[1])
|
||||||
fdir = os.path.dirname(fp)
|
fdir = os.path.dirname(fp)
|
||||||
fname = os.path.basename(fp)
|
fname = os.path.basename(fp)
|
||||||
if not fname.startswith("put-") or not fname.endswith(".bin"):
|
if not fname.startswith("put-") or not fname.endswith(".bin"):
|
||||||
|
@ -65,6 +65,10 @@ def main():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sp.check_call(cmd)
|
sp.check_call(cmd)
|
||||||
|
|
||||||
|
# OPTIONAL:
|
||||||
|
# on success, delete the .bin file which contains the URL
|
||||||
|
os.unlink(fp)
|
||||||
except:
|
except:
|
||||||
open("-- FAILED TO DONWLOAD " + name, "wb").close()
|
open("-- FAILED TO DONWLOAD " + name, "wb").close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue