wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.06k stars 342 forks source link

Read the ENV for tmp or cache dir => need to use this in docker #274

Open lordspace opened 1 year ago

lordspace commented 1 year ago

Provide environment information

Thanks for creating this tool. It seems the tool tries to create files/dirs somewhere in the user's home. Is it possible to make it so it checks the ENV variables such as GDOWN_CACHE_DIR or GDOWN_TMP_DIR so I can pass that to my docker container? I had to pass multiple folders to the docker run command in order to keep gdown happy.

--tmpfs /var/www/.cache/ \ --tmpfs /tmp \ --tmpfs /var/www/vhosts \ --tmpfs /home \

/usr/bin/python
Python 3.11.4
gdown  4.7.1

Traceback (most recent call last): File "/usr/bin/gdown", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/gdown/cli.py", line 156, in main filename = download( ^^^^^^^^^ File "/usr/lib/python3.11/site-packages/gdown/download.py", line 223, in download os.makedirs(osp.dirname(cookies_file)) File "<frozen os>", line 215, in makedirs File "<frozen os>", line 215, in makedirs File "<frozen os>", line 215, in makedirs File "<frozen os>", line 225, in makedirs PermissionError: [Errno 13] Permission denied: '/var/www/vhosts'

What OS are you using?

Ubuntu 22.04.4

Describe the Bug

PermissionError: [Errno 13] Permission denied

Expected Behavior

maybe try to save the lock or cookie files in the current dir or /tmp but ideally to read the ENV vars. See the ticket description

To Reproduce

see ticket description.