setnicka / ulozto-downloader

EOL - end of life | Uloz.to quick multiple sessions downloader
MIT License
279 stars 46 forks source link

WARNING: File '{filename}' already exists, overwrite it? [y/n] #59

Closed owinter92 closed 3 years ago

owinter92 commented 3 years ago

Hi, great piece of software however suppose you want to do something like this:

while IFS= read -r line; do
    ulozto-downloader --auto-captcha --parts 50 $line
done < to_download.txt

It would be really convient if you cound add another parameter, say --Y or --N, that would do the obvious thing here.

stinovlas commented 3 years ago

Can't you achieve the same result by using yes or yes n respectively?

while IFS= read -r line; do
    yes | ulozto-downloader --auto-captcha --parts 50 $line
done < to_download.txt
owinter92 commented 3 years ago

Possibly (I need to test it) but not in the case of No because after No the script returns exit(1) and it kill the whole loop.

stinovlas commented 3 years ago

Possibly (I need to test it) but not in the case of No because after No the script returns exit(1) and it kill the whole loop.

sys.exit(1) only means that the script terminates with exit status 1. Why wouldn't it continue with the next loop iteration? That's not how the POSIX shell while loop behaves. yes n | ulozto-downloader ... should work like a charm.

owinter92 commented 3 years ago

Indeed you are right. I was a little bit confused because if I tried to do it by hand the loops stopped. Thanks.