better scriptability and chown behaviour

This commit is contained in:
Leon Haag-Fank 2024-04-05 13:04:14 +02:00
parent 093d01a841
commit a7701168a1
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,7 @@
#!/bin/sh
python ./zeit-dl "$ZEITDL_USER" "$ZEITDL_PASSWORD" ${ZEITDL_OPTIONS:=-o /data}
chown -R $UID:$GID /data
[[ -n "$CHOWN_UID" || -n "$CHOWN_GID" ]] && chown_arg='-q'
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

View file

@ -104,7 +104,7 @@ def download(page, args):
file = page.context.request.get(url)
if file.headers['content-type'] != 'text/html':
if args.quiet:
print(filename)
print(filepath)
else:
log('Downloading {}...'.format(filename), args=args)
with open(filepath, 'wb') as f: