Skip to main content

Get your Pixiv token (for running upbit/pixivpy)

Project description

gppt: get-pixivpy-token

PyPI Docker Image Size (latest by date) Maintainability

Install

 pip install gppt

Run

  • Note: In advance, please setup google-chrome-stable + selenium + webdriver
  • On Ubuntu, my setup script is available
 ./setup.sh

From Library

from gppt import GetPixivToken as g
gpt = g(headless=True, user="...", pass_="...")
res = gpt.login()
  • 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
  }
}

From CLI

# from GUI gppt login
[!]: The browser will start. Please login.
(Log in to Pixiv from the login screen that starts up.)
[+]: Success!
access_token: ***
refresh_token: ***
expires_in: 3600
# from headless gppt login-headless -u <id> -p <pw>
[!]: The browser will start. 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, create .env and run.
# 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-headless,lh,refresh,r} ...

Get your Pixiv token (for running upbit/pixivpy)

positional arguments:
  {login,l,login-headless,lh,refresh,r}
    login (l)           retrieving auth token
    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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gppt-1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

gppt-1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file gppt-1.1.tar.gz.

File metadata

  • Download URL: gppt-1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for gppt-1.1.tar.gz
Algorithm Hash digest
SHA256 863b537d8612c5f8a656305c5801f19fb74488617e28587ae186805f4ca7b1f3
MD5 65309c9a7a257460ea86d33e4d33d2c3
BLAKE2b-256 24d2de537cce5106e7f72680af712714306cba89a98aa075f20e8194c55eb780

See more details on using hashes here.

File details

Details for the file gppt-1.1-py3-none-any.whl.

File metadata

  • Download URL: gppt-1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for gppt-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 881a428f4f9cfd0259b58486521de0826fce84309341389acb83f6f1903b6ebd
MD5 dbf4a2d8f4827e38d532162a03545820
BLAKE2b-256 b6d265036b87c89d027b4bc18790f082052deb3961975c6de7ca59e881b7d046

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page