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

The Configure Json files did not appear/How to add Pixiv user name, password and refresh token #6821

Open
Dukenukem300000 opened this issue Jan 13, 2025 · 4 comments

Comments

@Dukenukem300000
Copy link

Dukenukem300000 commented Jan 13, 2025

Hello, dear Dev! have a question about configure files of Gallery DL.

I am trying to download from Pixiv, so I try to find the configuration files of Gallery DL, and add lines it it.

According to the guides, the configure files are supposed to be found in these locations:

Desktop 2025-01-12 19-29-12-139

However, I run the %APPDATA%\gallery-dl\config.json command, and find that I have no configure files, only a "cache.sqlite3" files:

Desktop 2025-01-12 19-29-26-666

I try to open it with Notepad+ and NotePad++, but noth of them only show lots of random Jibberish:

And thus, my question is, what happened with my Gallery DL, and how can I recover the "right" json file? Also, how can I add the username, password and fresh Token in configure files? What command should I use?

Desktop 2025-01-12 19-37-11-355
Desktop 2025-01-12 19-29-53-400

One thing I wanna add is that I am using Media Downloader, will this result in different solution?

@mikf
Copy link
Owner

mikf commented Jan 13, 2025

the configure files are supposed to be found in these locations:

No, gallery-dl will search for configuration files in these locations. It is your responsibility to put something there.

You can run gallery-dl --config-create to create a basic config file, or you copy docs/gallery-dl.conf and rename/modify that.

only a "cache.sqlite3" files

That's an SQLite3 database. You need special software like DB4S to edit them, but you (usually) don't need to touch this file.

Pixiv user name, password

Pixiv does not support login with username & password. You need a refresh-token which you can acquire by running gallery-dl oauth:pixiv (see #5754 (comment)) or by using something like https://github.com/eggplants/get-pixivpy-token.

@Dukenukem300000
Copy link
Author

the configure files are supposed to be found in these locations:

No, gallery-dl will search for configuration files in these locations. It is your responsibility to put something there.

You can run gallery-dl --config-create to create a basic config file, or you copy docs/gallery-dl.conf and rename/modify that.

only a "cache.sqlite3" files

That's an SQLite3 database. You need special software like DB4S to edit them, but you (usually) don't need to touch this file.

Pixiv user name, password

Pixiv does not support login with username & password. You need a refresh-token which you can acquire by running gallery-dl oauth:pixiv (see #5754 (comment)) or by using something like https://github.com/eggplants/get-pixivpy-token.

Roger that sir. I have successfully download the Json files with default files.

Just wanna be sure. I only need to find the "callback" lines that show up when pressing F12 in login of Pixiv, then find "refresh token" section in Json files, then paste "code=...." in that section, then it will be over, is it?

Desktop 2025-01-14 22-56-17-532

@mikf
Copy link
Owner

mikf commented Jan 15, 2025

No, you paste the code value in your terminal during the oauth:pixiv step.

$ gallery-dl oauth:pixiv
[oauth][info] Opening URL in browser:

https://app-api.pixiv.net/web/v1/login?code_challenge=abcdefgU&code_challenge_method=S256&client=pixiv-android

1) Open your browser's Developer Tools (F12) and switch to the Network tab
2) Login
3) Select the last network monitor entry ('callback?state=...')
4) Copy its 'code' query parameter, paste it below, and press Enter

- This 'code' will expire 30 seconds after logging in.
- Copy-pasting more than just the 'code' value will work as well,
  like the entire URL or several query parameters.

code: ENTER/PASTE CODE HERE

This will then give you a refresh-token value, which you can add to your config file.


While you are at it, you might also want to add the DeviantArt API credentials here instead of passing them as command-line arguments via -o.

@Dukenukem300000
Copy link
Author

Roger that sir, I will do that now. I apologize for late reply.

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

2 participants