Dolda2000 GitWeb
/
automanga.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide proper referers for nelo and kakalot.
[automanga.git]
/
getmanga
diff --git
a/getmanga
b/getmanga
index
c744617
..
bd8401e
100755
(executable)
--- a/
getmanga
+++ b/
getmanga
@@
-83,11
+83,17
@@
def download(mng, tdir, pattern):
msg(1, "getting %s...", nm)
with page.open() as fp:
with open(path, "wb") as out:
msg(1, "getting %s...", nm)
with page.open() as fp:
with open(path, "wb") as out:
- while True:
- data = fp.read(65536)
- if data == b"":
- break
- out.write(data)
+ done = False
+ try:
+ while True:
+ data = fp.read(65536)
+ if data == b"":
+ done = True
+ break
+ out.write(data)
+ finally:
+ if not done:
+ os.unlink(path)
try:
img = Image.open(path)
except OSError:
try:
img = Image.open(path)
except OSError:
@@
-105,6
+111,10
@@
def download(mng, tdir, pattern):
def usage(out):
out.write("usage: getmanga [-hv] [-w WAIT] [-p PROFILE] [-P PATTERN] DIRECTORY [LIBRARY ID]\n")
def usage(out):
out.write("usage: getmanga [-hv] [-w WAIT] [-p PROFILE] [-P PATTERN] DIRECTORY [LIBRARY ID]\n")
+ out.write("\tpattern templates:\n")
+ out.write("\t %i\tSequence number\n")
+ out.write("\t %n\tName\n")
+ out.write("\t %d\tID\n")
def main():
global verbose, wait, mprof, props
def main():
global verbose, wait, mprof, props