diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index cbeca19..38764ee 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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 diff --git a/zeit-dl b/zeit-dl index 26faa27..8368e8e 100755 --- a/zeit-dl +++ b/zeit-dl @@ -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: