Git Product home page Git Product logo

get-pixivpy-token's Introduction

gppt: get-pixivpy-token

PyPI ghcr Maintainability pre-commit.ci status

Install

pip install gppt

Enable Proxy

Set ALL_PROXY or HTTPS_PROXY to your environment variables.

Run

Example

from gppt import GetPixivToken
from pixivpy3 import AppPixivAPI

def get_refresh_token() -> str:
    with open("token.txt", "w+") as f:
        if refresh_token := f.read().strip():
            return refresh_token

        g = GetPixivToken(headless=True)
        refresh_token = g.login(username="...", password="...")["refresh_token"]
        f.write(refresh_token)
        return refresh_token

aapi = AppPixivAPI()
aapi.auth(refresh_token=get_refresh_token())
...

From Docker

$ docker run --rm -it ghcr.io/eggplants/get-pixivpy-token lh -u <id> -p <pw>
[+]: Success!
access_token: ***
refresh_token: ***
expires_in: 3600

From CLI

  • Note: In advance, please setup google-chrome-stable + selenium + webdriver
# 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 Library

  • Note: In advance, please setup google-chrome-stable + selenium + webdriver If either username or password are missing, manual input will be required.
from gppt import GetPixivToken

g = GetPixivToken(headless=False,username=None,password=None)
res = g.login(headless=None,username=None,password=None)
  • res.response returns:
{
  "access_token": "***",
  "expires_in": 3600,
  "refresh_token": "***",
  "scope": "",
  "token_type": "bearer",
  "user": {
    "account": "***",
    "id": "***",
    "is_mail_authorized": <bool>,
    "is_premium": <bool>,
    "mail_address": "***@***",
    "name": "***",
    "profile_image_urls": {
      "px_16x16": "https://s.pximg.net/common/images/no_profile_ss.png",
      "px_170x170": "https://s.pximg.net/common/images/no_profile.png",
      "px_50x50": "https://s.pximg.net/common/images/no_profile_s.png"
    },
    "require_policy_agreement": <bool>,
    "x_restrict": 2
  }
}

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

get-pixivpy-token's People

Contributors

dependabot[bot] avatar eggplants avatar exentio avatar mgmcn avatar pre-commit-ci[bot] avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

get-pixivpy-token's Issues

Wrong gppt version in docker image

When I run the following command to enter the container (version 3.1.0)

docker run --entrypoint /bin/bash --rm -it ghcr.io/eggplants/get-pixivpy-token:3.1.0

Then run pip list, this is the result

root@c4ee03b30364:/# pip list                                                                        
Package              Version
-------------------- ---------                  
async-generator      1.10             
attrs                22.2.0                       
certifi              2022.12.7
cffi                 1.15.1                                                                          
charset-normalizer   2.1.1                                                                                                                                                                                 
cloudscraper         1.2.68                                                                          
cryptography         39.0.0                   
gppt                 3.0.0                                                                                                                                                                                 
h11                  0.14.0
idna                 3.4 
outcome              1.2.0                                                                                                                                                                                 
pip                  23.0                                                                            
PixivPy3             3.7.2                                                                                                                                                                                 
pwinput              1.0.2
pycparser            2.21
pyderman             3.3.0                                                                                                                                                                                 
pyOpenSSL            23.0.0                                                                          
pyparsing            3.0.9                                                                                                                                                                                 
PySocks              1.7.1 
requests             2.28.1
requests-toolbelt    0.10.1                 
selenium             4.3.0                   
setuptools           65.5.1                                                                          
sniffio              1.3.0                    
sortedcontainers     2.4.0                     
trio                 0.22.0                   
trio-websocket       0.9.2                    
types-requests       2.28.1                    
types-urllib3        1.26.25.4                
typing_extensions    4.4.0                      
urllib3              1.26.14                    
urllib3-secure-extra 0.1.0                    
wheel                0.38.4                   
wsproto              1.2.0

Gppt version is actually 3.0.0, instead of 3.1.0.

This should be because the pypi package and the docker image are paralleled on the github action workflow, so pypi may not have been deployed properly when docker is still building. My suggestion is to use the previously packaged whl file to install directly during docker build to ensure that the gppt version is correct.

Exception while using CLI on Win 10 in conda vartual environment

An exception happend while using CLI on Win 10 in conda vartual environment. What should I do to fix it?

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\ProgramData\Anaconda3\envs\media_downloader\Scripts\gppt.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'gppt__'

Can't find the login button element

File "/usr/lib/python3.11/site-packages/gppt/_selenium.py", line 93, in login

    self.__try_login()

  File "/usr/lib/python3.11/site-packages/gppt/_selenium.py", line 163, in __try_login

    el = self.driver.find_element(

         ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 830, in find_element

    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute

    self.error_handler.check_response(response)

  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@type='submit'][contains(text(), 'ログイン') or contains(text(), 'Login') or contains(text(), '登录') or contains(text(), '로그인') or contains(text(), '登入')]"}

  (Session info: headless chrome=108.0.5359.125)

There is a login error when reCaptcha occurs

[!]: 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

cache token

~以下に.pixiv_tokenとかを持っておく

Can't log in if headless is set to False

def __try_login(self) -> None:
        if self.headless: 
            label_selectors = [
                f"contains(text(), '{label}')"
                for label in ["ログイン", "Login", "登录", "로그인", "登入"]
            ]
            el = self.driver.find_element(
                By.XPATH, f"//button[@type='submit'][{' or '.join(label_selectors)}]"
            )
            el.send_keys(Keys.ENTER)
.
.
.

I set headless to False, and the browser will always stay at the screen where selenium finished typing the login form without clicking the login button.

Automate the refresh_token question

So.. recently I developing some pixiv application,
the thing is there is no documentation except from community forum upbit/pixivpy and this module.

My question is:
How to automate the token refresh?

My thought is making this module into schedule or cron in every hour, then store it to somewhere like memcache or storage,
so i could make it simple with pixivpy3 and call every endpoints with

api = AppPixivAPI()
api.auth(refresh_token=#GET_FROM_MY_STORAGE)

but i think it's a bit overkill tho..

Is there a simplicity the automated token refresh apart from this? thanks in advance

Chrome version problem in docker

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

caching

保存してなければログインと取得、JSON保存
保存してればJSON読んで返す
r, refreshとかで保存有無関わらず更新

NoSuchElementException

use CLI with headless browser

Traceback (most recent call last):
  File "/home/godz/.local/bin/gppt", line 8, in <module>
    sys.exit(main())
  File "/home/godz/.local/lib/python3.10/site-packages/gppt/main.py", line 135, in main
    args.func(args)
  File "/home/godz/.local/lib/python3.10/site-packages/gppt/main.py", line 60, in func_loginh
    res = g.login(headless=True, username=ns.username, password=ns.password)
  File "/home/godz/.local/lib/python3.10/site-packages/gppt/gppt.py", line 85, in login
    self.__fill_login_form()
  File "/home/godz/.local/lib/python3.10/site-packages/gppt/gppt.py", line 140, in __fill_login_form
    el = self.driver.find_element(By.XPATH, "//input[@autocomplete='username']")
  File "/home/godz/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
  File "/home/godz/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)  File "/home/godz/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate
element: {"method":"xpath","selector":"//input[@autocomplete='username']"}
  (Session info: chrome-headless-shell=124.0.6367.91); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
#0 0x55e553cdccb3 <unknown>
#1 0x55e5539cb4a7 <unknown>
#2 0x55e553a1631d <unknown>
#3 0x55e553a163d1 <unknown>
#4 0x55e553a59734 <unknown>
#5 0x55e553a3843d <unknown>
#6 0x55e553a56be9 <unknown>
#7 0x55e553a381b3 <unknown>
#8 0x55e553a0924a <unknown>
#9 0x55e553a09c1e <unknown>
#10 0x55e553ca0fdb <unknown>
#11 0x55e553ca4f2b <unknown>
#12 0x55e553c8d0f1 <unknown>
#13 0x55e553ca5a92 <unknown>
#14 0x55e553c71faf <unknown>
#15 0x55e553ccbe08 <unknown>
#16 0x55e553ccbfe0 <unknown>
#17 0x55e553cdbe04 <unknown>
#18 0x7f07ec452ac3 <unknown>

Browser window opened even when headless is set, the login form isn't filled

When attempting the login, the headless option isn't respected, and the login doesn't happen as the login form isn't filled, ending in a crash.

The current code in gppt.py masks the real exception:

except TimeoutException as err:
    self.driver.close()
    msg = "Failed to login. Please check your information or proxy. (Maybe restricted by pixiv?)"
    raise ValueError(msg) from err

And I get this error:

(venv) ex@Nanami-Ao ~/p/twitter-to-pixiv-migration-v2 [0|1]> python test.py
Traceback (most recent call last):
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/gppt.py", line 164, in __wait_for_redirect
    WebDriverWait(self.driver, 20).until(EC.url_matches(f"^{REDIRECT_URI}"))
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/selenium/webdriver/support/wait.py", line 105, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/test.py", line 13, in <module>
    print(get_refresh_token())
          ^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/test.py", line 9, in get_refresh_token
    refresh_token = g.login(username="XXXXX", password="XXXXX")["refresh_token"]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/gppt.py", line 75, in login
    self.__wait_for_redirect()
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/gppt.py", line 169, in __wait_for_redirect
    raise ValueError(msg) from err
ValueError: Failed to login. Please check your information or proxy. (Maybe restricted by pixiv?)

So I changed it:

except TimeoutException as err:
    print(err)
    self.driver.close()

And now I get the real crash log:

(venv) ex@Nanami-Ao ~/p/twitter-to-pixiv-migration-v2 [0|1]> python test.py
Message: 

Traceback (most recent call last):
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/test.py", line 13, in <module>
    print(get_refresh_token())
          ^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/test.py", line 9, in get_refresh_token
    refresh_token = g.login(username="XXXXX", password="XXXXX")["refresh_token"]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/gppt.py", line 78, in login
    code = self.__parse_log()
           ^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/gppt/gppt.py", line 142, in __parse_log
    perf_log = self.driver.get_log("performance")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 1031, in get_log
    return self.execute(Command.GET_LOG, {"type": log_type})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
    self.error_handler.check_response(response)
  File "/home/ex/projects/twitter-to-pixiv-migration-v2/venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id

I'm currently running this on a virtual env on Linux, with version 4.0.0 of the library, and I have the latest versions of Google Chrome (121.0.6167.139) and Chromedriver (121.0.6167.85), although the newly implemented Selenium Manager should be downloading the latest version itself and use the downloaded executable.

This problem didn't happen with the fixes I sent in #114 and it's probably an aftermath of the refactoring done in #116 and I'll try to investigate the root of the problem myself, but the various changes have been force-pushed, making it harder to look at the changes in the code. I am guilty of force-pushing myself, but only in minor instances. You should never force-push such important commits, it's really bad practice.

Update on PyPI

The commit d2a2b57 fixes #35, but the PyPI package is still at 2.2.0 and that isn't updated with d2a2b57, can you update the package on PyPI too?

Using pip install git+https://github.com/eggplants/get-pixivpy-token@d2a2b57a085b2a61e6ac0c52835a405b9ef166de does work but in some cases like using Poetry in repl.it (poetry add git+https://github.com/eggplants/get-pixivpy-token@d2a2b57a085b2a61e6ac0c52835a405b9ef166de) crashes, and personally i'd prefer an updated release in PyPI since this does fix a minor bug.

Update for PixivPy 3.7.2

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.*" 👀

WebDriverException while call `GetPixivToken.login()`

Description

This issue is a litte bit strange. Previous runs were prefect.

I can run this code in the early of this day but suddenly I met this situation.

Output

  File "/Users/cardidi/repos/pixiv-qqbot/pixiv_oauth.py", line 48, in _refresh_token
    r = g.login(True, conf.pixiv_user_name, conf.pixiv_user_pwd)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/gppt/_selenium.py", line 72, in login
    self.driver = webdriver.Chrome(
                  ^^^^^^^^^^^^^^^^^
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in __init__
    super().__init__(
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in __init__
    super().__init__(
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/Users/cardidi/repos/pixiv-qqbot/venv/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 209, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: 

Environment

OS: macOS 13.2.1
CPU: Apple Silicon M1 Pro
Python: [email protected] via HomeBrew
gppt: 3.1.0 from GItHub@3aea2de
Clash: TUN mode + System Proxy
Chrome: 112.0.5615.49
ChromeDriver: 112.0.5615.49 (arm_m1)

Error with headless mode: `selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable`

DevTools listening on ws://127.0.0.1:58324/devtools/browser/a6768673-9066-4558-a8a5-c5cd2daaa45c
[0301/170711.413:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is
Traceback (most recent call last):
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\Scripts\gppt.exe\__main__.py", line 7, in <module>
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\main.py", line 148, in main
    args.func(args)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\main.py", line 50, in func_logini
    _, res = a.auth()
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\auth.py", line 22, in auth
    aapi, login_info = self.__auth(cnt)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\auth.py", line 47, in __auth
    ref = self.get_refresh_token(stdin_login[0], stdin_login[1])
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\auth.py", line 58, in get_refresh_token
    res = g.login(headless=True, username=pixiv_id, password=pixiv_pass)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\_selenium.py", line 93, in login
    self.__try_login()
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\gppt\_selenium.py", line 166, in __try_login
    el.send_keys(Keys.ENTER)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 230, in send_keys
    self._execute(
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 403, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: headless chrome=108.0.5359.99)
Stacktrace:
Backtrace:
        (No symbol) [0x00BDF243]
        (No symbol) [0x00B67FD1]
        (No symbol) [0x00A5CF10]
        (No symbol) [0x00A8795E]
        (No symbol) [0x00A870E5]
        (No symbol) [0x00AA858C]
        (No symbol) [0x00A82BFF]
        (No symbol) [0x00AA8804]
        (No symbol) [0x00ABC9EB]
        (No symbol) [0x00AA8386]
        (No symbol) [0x00A8163C]
        (No symbol) [0x00A8269D]
        GetHandleVerifier [0x00E79A22+2655074]
        GetHandleVerifier [0x00E6CA24+2601828]
        GetHandleVerifier [0x00C88C0A+619850]
        GetHandleVerifier [0x00C87830+614768]
        (No symbol) [0x00B705FC]
        (No symbol) [0x00B75968]
        (No symbol) [0x00B75A55]
        (No symbol) [0x00B8051B]
        BaseThreadInitThunk [0x77136709+25]
        RtlGetFullPathName_UEx [0x77BD7D1D+173]
        RtlGetFullPathName_UEx [0x77BD7CEB+123]

Asking about auto login

Hello there, I want to ask about automate login using Selenium, does it works on mobile phone?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.