• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Get your Pixiv token easily (for running upbit/pixivpy)

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

More Repositories

1

deepl-cli

DeepL Translator CLI (without API Key)
Python
138
star
2

ghcr-badge

Generate ghcr.io (GitHub Container Registory) container's status badge
Python
35
star
3

getjump

Retrieve and save images from manga distribution sites using GigaViewer
Python
25
star
4

popcat

*pop* *pop* *pop*
TypeScript
16
star
5

pixiv-bulk-downloader

Pixiv Bulk Downloader
Python
16
star
6

wbsv-cli

CLI for archiving pages and its all links to Wayback Machine
Python
14
star
7

ghitter

GitHub as a SNS
10
star
8

gh-repos

Create list of specific user's public repos as json and csv
Shell
10
star
9

awesome-japanese-censored-words

Awesome List of Sources of Japanese Censored Words
10
star
10

shindan-cli

ShindanMaker (診断メーカー, https://shindanmaker.com) CLI + Library
Python
9
star
11

networkx-stubs

Typing stubs for NetworkX
Python
7
star
12

de-no

で〜の.deno.dev
TypeScript
6
star
13

shikanoko

Outputs しか / のこ / こし / たん randomly until repeating しかのこのこのここしたんたん with n times.
Rust
6
star
14

self-intro

自己紹介スライド♪
5
star
15

dojinvoice_db

Make DB of Dojinvoice (DLsite)
Python
5
star
16

face-symmetrizer

Easy symmetrizer for an image contained face(s)
Jupyter Notebook
5
star
17

zutool

Unofficial zutool (頭痛ール: https://zutool.jp) API Wrapper
Python
5
star
18

deepl-select-jump

選択中テキストを右クリックしてDeepL翻訳に投げられるChrome拡張
JavaScript
4
star
19

install-playwright-python

Execute `playwright install` from Python
Python
4
star
20

dlMEGA

mega.nz file downloader
Shell
4
star
21

get-twitter-shortened-url

Get shortened link(s) from Twitter URL Shortener (t.co)
Python
4
star
22

dlsite-recommendation-llm

Recommend DLSite voice works with LLM
Python
4
star
23

doonroom_db

同人音声の部屋(http://doonroom.blog.jp/) Unofficial DB
Python
4
star
24

pixiv-tag-analyzer

Revealing peculiar habits through tags extracted from Pixiv user information
Python
4
star
25

aovec

Easy aozorabunko Word2Vec Builder - 青空文庫全書籍のWord2Vecビルダー+構築済みモデル
Python
3
star
26

sh-xmas

🎄Plant X'mas tree(s) on your Terminal🎄
Shell
3
star
27

gettake

Get and save images from webcomicgamma
Python
3
star
28

gh-matome

Creates a enum list of repos owned by the specified user
Shell
3
star
29

pyjlyric

Japanese Lyric Aggregator
Python
3
star
30

ads

Endless AD Distributor
HTML
3
star
31

shtris-docker

ContentsViewer/shtris on Docker
Dockerfile
3
star
32

twvideo-dl

A simple CLI for downloading videos from X, formerly Twitter
Python
3
star
33

rendakun.py

連打くん in Python
Python
2
star
34

nijisanji-v23d-status

にじさんじ 2.0&3.0&3Dの実装状況と登録者数関係表を作る
Shell
2
star
35

reportlab-stubs

Typing stubs for ReportLab
Python
2
star
36

jma-api-doc

jma.go.jp forecast APIのメモ
2
star
37

jsmr

Analyze Japanese ASMR - a site that illegally uploads DLSite voice works.
Shell
2
star
38

aegi

https://hungry-foxtail.sakura.ne.jp/game/Talk/Talk.html をリファクタリング
JavaScript
2
star
39

wordle-dic

Dictionary of valid words in Wordle (Automatically updated daily)
Shell
2
star
40

eijiro-to-sqlite

英辞郎 (English-Japanese dictionary) -> sqlite3
Python
2
star
41

i2aa-jave

Convert an image to texts of AA(ascii art) with JavE
Shell
2
star
42

wiredify

Convert japanese kana from ba-bi-bu-be-bo into va-vi-vu-ve-vo
Python
2
star
43

pimg

{Save an image in clipboard | Copy an image to clipboard} CLI+Library
Python
2
star
44

simpleverse

API wrapper for versatileapi (https://versatileapi.herokuapp.com/api) in Python
Python
2
star
45

shellscraping

Codes for scraping in Bash
Shell
2
star
46

netatmo

Retrieve netatmo station data (WIP)
Python
1
star
47

shellgeibot-tweet-archive

シェル芸botのツイートアーカイヴ
Jupyter Notebook
1
star
48

etoyear

show etoyear list command
Shell
1
star
49

hasanmap-dl

Hasanmap Downloader
Shell
1
star
50

genkaio

genkaio(限界王) - 限界しりとりでズルがしてぇときの補助CLIツール.
Ruby
1
star
51

fushin_dialogue

日本不審者情報センター不審者セリフ集を読む
HTML
1
star
52

f_down

futaba channel thread downloader via tsumanne
Ruby
1
star
53

userscript

Userscripts synced with GreasyFork
JavaScript
1
star
54

atcoder-docker

AtCoder実行環境の処理系全部入りDockerイメージを作る
Dockerfile
1
star
55

websh.sh

websh(https://websh.jiro4989.com/) on Bash
Shell
1
star
56

kenall-city-extract

2021年度 テキスト処理「KEN_ALL.CSVから市の抽出 && LaTeXレポート作成」
TeX
1
star
57

random-nipple-player

音声作品「乳首オナ指示でカリカリタイム」(RJ323807)用のランダムプレイヤー
Python
1
star
58

twitter_app

おもちゃ
Python
1
star
59

contributter.sh

Contributter on Terminal
Shell
1
star
60

laughing-broccoli

🥦<😆 ((A repository for executing Actions lots of times)) 🥦<😆
1
star
61

twitter-weathername-action

Update Twitter's Username to today forecast of given location with GitHub Actions
Python
1
star
62

useful-compose

Useful docker-compose.yml for my own
1
star
63

ghitter-template

GaaS (GitHub as a SNS) Template
1
star
64

harusa-posgresql-docker-test

harusa+posgresql+docker-compose
1
star
65

infosearch

2021年度「情報検索システム」ノート
Python
1
star
66

rust-cmd-practice

Rust
1
star
67

rubygems-stats

Create a list of Authors from Rubygems.org
Shell
1
star
68

yomiage-openjt

OpenJTalkくんにHな台本を喋らす
Shell
1
star
69

mkbook

Make directory including pictures into a PDF book
Python
1
star
70

my-best-python-project

A Sample Project For Python - Badge, CLI, Code Climate, Docker, GitHub Pages, Linter configuration, Packaging, {GitHub,PyPI,GitHub Container Registry} releaser CI, Type Hints, pre-commit.ci, ...
Python
1
star
71

unko_mark

Book search engine implemented in Ruby CGI + XSLT
Ruby
1
star
72

SetupWindows.ps1

My Windows Desktop Environment
PowerShell
1
star