# with browser
❭ gppt login
[!]: Chrome browser will be launched. Please login.
(Log in to Pixiv from the login screen that starts up.)
[+]: Success!
access_token: ***
refresh_token: ***
expires_in: 3600
# with headless browser
❭ gppt login-headless -u <id> -p <pw>
[!]: Chrome browser will be launched. Please login.
[+]: Success!
access_token: ***
refresh_token: ***
expires_in: 3600
From Docker
❭ docker run -it eggplanter/gppt -e PIXIV_ID=<id> -e PIXIV_PASS=<pw>
with envfile
# In .env# PIXIV_ID=<id># PIXIV_PASS=<pw>
❭ docker run -it eggplanter/gppt --env-file .env
Help
❭ gppt -h
usage: gppt [-h]
{login,l,login-interactive,li,login-headless,lh,refresh,r} ...
Get your Pixiv token (for running upbit/pixivpy)
positional arguments:
{login,l,login-interactive,li,login-headless,lh,refresh,r}
login (l) retrieving auth token
login-interactive (li)
`login`in interactive mode
login-headless (lh)
`login`in headless mode
refresh (r) refresh tokens
optional arguments:
-h, --help show this help message and exit
❭ gppt l -h
usage: gppt login [-h] [-u USERNAME] [-p PASSWORD] [-j]
optional arguments:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
your E-mail address / pixiv ID
-p PASSWORD, --password PASSWORD
your current pixiv password
-j, --json output response as json
❭ gppt li -h
usage: gppt login-interactive [-h] [-j]
optional arguments:
-h, --help show this help message and exit
-j, --json output response as json
❭ gppt lh -h
usage: gppt login-headless [-h] -u USERNAME -p PASSWORD [-j]
optional arguments:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
your E-mail address / pixiv ID
-p PASSWORD, --password PASSWORD
your current pixiv password
-j, --json output response as json
❭ gppt r -h
usage: gppt refresh [-h] [-j] refresh_token
positional arguments:
refresh_token
optional arguments:
-h, --help show this help message and exit
-j, --json output response as json
[!]: Chrome browser will be launched. Please login.
DevTools listening on ws://127.0.0.1:50733/devtools/browser/11929e54-0deb-463a-a919-b817c72d6e4b
[19148:7992:0401/013412.581:ERROR:device_event_log_impl.cc(214)] [01:34:12.581] USB: usb_service_win.cc:354 Could not get child device's service name: 找不到元素。 (0x490)
[19148:7992:0401/013412.587:ERROR:device_event_log_impl.cc(214)] [01:34:12.588] Bluetooth: bluetooth_adapter_winrt.cc:1075 Getting Default Adapter failed.
Traceback (most recent call last):
File "f:\python3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "f:\python3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "F:\python3\Scripts\gppt.exe\__main__.py", line 7, in <module>
File "f:\python3\lib\site-packages\gppt\main.py", line 149, in main
args.func(args)
File "f:\python3\lib\site-packages\gppt\main.py", line 44, in func_login
res = g.login(user=ns.username, pass_=ns.password)
File "f:\python3\lib\site-packages\gppt\_selenium.py", line 79, in login
self.__try_login()
File "f:\python3\lib\site-packages\gppt\_selenium.py", line 163, in __try_login
raise ValueError("Failed to login")
ValueError: Failed to login
System-level proxy (such as export ALL_PROXY=xxx in ~/.bashrc), if there is, start chrome with this proxy
User-defined proxy, if the user specifies, use this proxy to start chrome
Multi-language recognition support for login buttons (the original code only recognizes the button whose text is Login, so it runs incorrectly in other languages)
The following tests were performed (in Mainland China):
Use system-level proxy (socks5 protocol), run gppt login, it works normally
Use system-level proxy, run gppt login-headless, it works normally
Use system-level proxy, run through Library, try to get refresh_token and refresh access_token, it works normally
Use a custom agent, run through Library, try to get refresh_token and refresh access_token, it works normally
The commit d2a2b57a085b2a61e6ac0c52835a405b9ef166de fixes #35, but the PyPI package is still at 2.2.0 and that isn't updated with d2a2b57a085b2a61e6ac0c52835a405b9ef166de, can you update the package on PyPI too?
Using pip install git+https://github.com/eggplants/[email protected] does work but in some cases like using Poetry in repl.it (poetry add git+https://github.com/eggplants/[email protected]) crashes, and personally i'd prefer an updated release in PyPI since this does fix a minor bug.
Currently the latest release target PixivPy 3.7.1 so I can't update pixivpy to 3.7.2 in poetry. You should update it to target pixivpy 3.7.2 or consider changing it to "3.7.*" :eyes:
- uses: actions/[email protected]
with:
python-version-file: '.python-version' # Read python version from a file
- run: python my_script.py
There is no default python version for this setup-python major version, the action requires to specify either python-version input or python-version-file input. If the python-version input is not specified the action will try to read required version from file from python-version-file input.
The cache-hit output contains boolean value indicating that an exact match was found for the key. It shows that the action uses already existing cache or not. The output is available only if cache is enabled.
... (truncated)
Commits
d09bd5e fix: 3.x-dev can install a 3.y version (#417)
f72db17 Made env.var pythonLocation consistent for Python and PyPy (#418)
53e1529 add support for python-version-file (#336)
3f82819 Fix output for prerelease version of poetry (#409)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
I tried the Docker command and it immediately crashed. Is there any workaround?
Environment:
Docker version 20.10.12, build 20.10.12-0ubuntu4
Stacktrace:
Traceback (most recent call last):
File "/usr/local/bin/gppt", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/gppt/main.py", line 148, in main
args.func(args)
File "/usr/local/lib/python3.10/site-packages/gppt/main.py", line 57, in func_loginh
res = g.login(headless=True, user=ns.username, pass_=ns.password)
File "/usr/local/lib/python3.10/site-packages/gppt/_selenium.py", line 65, in login
self.driver = webdriver.Chrome(
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 92, in __init__
super().__init__(
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 277, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 370, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 435, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 107
Current browser version is 103.0.5060.114 with binary path /usr/bin/google-chrome