Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow gallery-dl.conf to be named gallery-dl.conf.txt and gallery-dl.conf.json #2333

Open
AlttiRi opened this issue Feb 23, 2022 · 10 comments
Open

Comments

@AlttiRi
Copy link

AlttiRi commented Feb 23, 2022

Allow gallery-dl.conf file to be additionally named gallery-dl.conf.txt.

Since by default Windows hides the extensions in File Explorer.

Some people created gallery-dl.conf.txt and think that they created gallery-dl.conf that is wrong. It generates additional issues here with their problems.

And gallery-dl.conf.json for syntax highlighting in text editors.

if util.WINDOWS:
_default_configs = [
r"%APPDATA%\gallery-dl\config.json",
r"%USERPROFILE%\gallery-dl\config.json",
r"%USERPROFILE%\gallery-dl.conf",
]
else:
_default_configs = [
"/etc/gallery-dl.conf",
"${XDG_CONFIG_HOME}/gallery-dl/config.json"
if os.environ.get("XDG_CONFIG_HOME") else
"${HOME}/.config/gallery-dl/config.json",
"${HOME}/.gallery-dl.conf",
]

@madindehead
Copy link

madindehead commented Feb 23, 2022

Surely people using this can turn on file extensions in Windows? It's not difficult and is incredibly useful.

@AlttiRi
Copy link
Author

AlttiRi commented Feb 23, 2022

Independently how it's useful and easy to set up, it's disabled by default.

And some people will face the problem.

Since they create New Text Document file first from the context menu, then they rename it to gallery-dl.conf that results to gallery-dl.conf.txt actually.

@Hrxn
Copy link
Contributor

Hrxn commented Feb 23, 2022

It's a CLI program, and no matter what you use here, the CLI will always show you the real file extensions, and you can easily rename files from there as well..

@AlttiRi
Copy link
Author

AlttiRi commented Feb 23, 2022

There are 46 issues about "Deviantart 429 Error". (Edit: with mention of it.)

Do you think that everybody knows basic shell commands?

For some people just to run gallery-dl.exe with the default settings is a challenge. Because it requires to use a terminal.

I see that there is a problem and resolving is trivial. Why not.
It will exclude one reason why config is ignored.

@Hrxn
Copy link
Contributor

Hrxn commented Feb 23, 2022

Dunno, but this is even the most basic of the basic ones, like dir or ls, and you're already only one step away from renaming a file then..

But you're probably right about this, with regard to the issue count.

So, don't get me wrong, I'm not against this change.

-- Edit --

One thing that definitely could be improved here is maybe adding an additional line to the debug status messages when running in --verbose.

This wasn't an issue for me personally yet, because you can actually tell from the verbose messages from the extractor if you are using any custom auth settings or something. More, you can always check the output settings with gallery-dl -E <url>, which shows you your custom "directory" and "filename" settings e.g. - when you see these, it must mean that your config has been successfully loaded.

But again, something along the lines of what yt-dlp is currently doing might be a good idea:

PS D:\Temp> yt-dlp -v
[debug] Command-line config: ['-v']
[debug] User config "C:\Users\Hrxn\AppData\Roaming\yt-dlp\config.txt": ['--download-archive', 'E:\\ {SNIP} ..]
.. {SNIP} ...

So, the first debug message shows the options provided from the CLI, and the second line the user config file, with it's entire path, and then following in the square-brackets the actual options set by this file (which isn't even that important, in my opinion, a simple message a la "config file loaded from <PATH> successfully" or something should be enough).

@AlttiRi
Copy link
Author

AlttiRi commented Feb 23, 2022

Yes, I also suggested this before.

#2143 (comment)

@madindehead
Copy link

Honestly, I would question why someone is using a CLI utility if they can't even change file extensions via the CLI. Or just turn them on in the Windows explorer.

@ghost
Copy link

ghost commented Mar 2, 2022

If someone use the Windows Explorer to run, create or configure a CLI utility, that person should buy one of numerous downloaders for windows available on the internet. I felt kind a shame for the author of this "issue"...

@AlttiRi
Copy link
Author

AlttiRi commented Mar 3, 2022

I felt kind a shame for the author of this "issue"...

Because I want to decrease the issue's count and help a bit to people who are not "elite" because they want to download the content with the best tool, but it's their the first experience with CLI?
With a minor fix that will not change, but only extend the interface. You (and me too) will continue to use gallery-dl.conf.

Maybe lets start to close all issues if there is an answer in the other one? Just marks these issues as a duplicate and close for commenting.

Okay, @mikf your opinion about it?
I see this opened issue is the red rag to CLI-masters. Even people that never commented here anything were triggered ([1], [2]).


BTW, the repost of my old message:

Add in --version showing if there is any config file in use.
Add a command to create a dummy config file.

Read also gallery-dl.conf.txt?
To resolve such problems in future.

Or add a command to open (and create an empty file if it does not exist) the config file.
--open-config

@thatfuckingbird
Copy link
Contributor

I don't think that it should automatically use these files, as that would be just further enabling user mistakes. But I agree with @AlttiRi that the problem is real, I think implementing a check for these mistakenly named files and displaying a warning/instructions would be OK.
I think it's better to to educate users about potential problems than trying to silently paper over them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants