Pixiv¶
Configuration¶
Notice
Pixiv no longer supports username & password authorization from Feb 9, 2021. You'll have to obtain a refresh token in advance. (see #9)
Notice
Since Pixiv access token and refresh token are cached in database, after switching account, you'll need to delete pixiv
document in nazurin
collection from the database.
PIXIV_TOKEN¶
Required unless Nazurin has cached one in your database
Your refresh token, you may use this tool to get one.
PIXIV_MIRROR¶
Optional, defaults to i.pximg.net
, i.e. official image server
Image proxy when viewing artworks, introduced to help Telegram server get the image stably, downloading artworks still uses Pixiv server.
Will replace i.pximg.net
in returned image URL.
e.g.: i.pixiv.cat
PIXIV_TRANSLATION¶
Optional
Language for possible tag translation, if translated name is unavailable, original name is used.
Use original name if not set, configured value will be set as Accept-Language
in headers.
Example: zh-CN
, en-US
PIXIV_BOOKMARK_PRIVACY¶
Optional, defaults to public
Bookmark visibility, public
or private
.
Customizing Storage Path & File Name¶
For more information, refer to Customizing Storage Path & File Name.
PIXIV_FILE_PATH¶
Optional, defaults to Pixiv
Storage path for downloaded artworks.
PIXIV_FILE_NAME¶
Optional, defaults to {filename} - {title} - {user[name]}({user[id]})
File name for downloaded artworks.
Available Variables¶
Only common used ones are listed.
{
"create_date": "Creation date",
"series": "Series",
"page_count": "Total image count",
"height": "Height of first image",
"total_view": "Total view count",
"id": "Artwork ID",
"title": "Artwork title",
"width": "Width of first image",
"type": "Artwork type, e.g. illust, manga",
"tags": [
{
"name": "Tag name",
"translated_name": "Translated tag name"
}
],
"user": {
"account": "Illustrator username",
"id": "Illustrator user ID",
"name": "Illustrator name"
},
"total_bookmarks": "Total bookmark count",
"filename": "Original filename without extension, e.g. 12345_p0",
"page": "Single image position among all images, starting from 0"
}
Ugoira support¶
To support Pixiv ugoira GIF preview (sent as MP4) in Telegram, you should have ffmpeg installed (already included in Docker image).
For more information, refer to https://ffmpeg.org/, make sure libx264 encoder is installed.
On Heroku, add a buildpack to your application:
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
Created: June 8, 2023