better scriptability and chown behaviour
This commit is contained in:
parent
093d01a841
commit
a7701168a1
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data}
|
[[ -n "$CHOWN_UID" || -n "$CHOWN_GID" ]] && chown_arg='-q'
|
||||||
chown -R $UID:$GID /data
|
if out=$(python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data} $chown_arg) then
|
||||||
|
[[ -n "$CHOWN_UID" ]] && chown $CHOWN_UID "$out"
|
||||||
|
[[ -n "$CHOWN_GID" ]] && chgrp $CHOWN_GID "$out"
|
||||||
|
fi
|
||||||
|
|
2
zeit-dl
2
zeit-dl
|
@ -104,7 +104,7 @@ def download(page, args):
|
||||||
file = page.context.request.get(url)
|
file = page.context.request.get(url)
|
||||||
if file.headers['content-type'] != 'text/html':
|
if file.headers['content-type'] != 'text/html':
|
||||||
if args.quiet:
|
if args.quiet:
|
||||||
print(filename)
|
print(filepath)
|
||||||
else:
|
else:
|
||||||
log('Downloading {}...'.format(filename), args=args)
|
log('Downloading {}...'.format(filename), args=args)
|
||||||
with open(filepath, 'wb') as f:
|
with open(filepath, 'wb') as f:
|
||||||
|
|
Loading…
Add table
Reference in a new issue