A Python module for Pixiv crawling and interaction
Project description
pixivtools
A tool for crawling images from pixiv website, supporting multiple crawling modes
Supported Features
- Download images by artwork id
- Download images by artist id (userid)
- Download images by pixivision id (pixivision site)
- Download latest uploads from followed artists
- Download recommended works from homepage
- Download images from rankings
- Download recommended works from commission section
- Download images from user's bookmarks
- Download popular works by specified tags
- Download similar works by specified artwork id
- Download works from all similar artists of a specified artist id
- Download works from platform-recommended artists
- Download works from latest commission artists
Usage
1. Install pixivtools
pip install pixivtools --upgrade
2. Create Configuration Object
There are two ways to set up the configuration, choose according to your preference
1) Create through Constructor
import pixivtools
cfg_maker = pixivtools.pixiv_config_maker()
# Adjust according to your needs
cfg_maker.set_phpsessid("Enter your pixiv PHPSESSID")
cfg_maker.set_proxy("127.0.0.1:7890")
cfg_maker.set_img_dir("./imgs") # Location to store images
cfg_maker.set_log_file("./out.log") # Location for log output
cfg_maker.set_sql_url("sqlite:///pixiv.db") # SQLAlchemy format connection URL, can be ignored if not understood
cfg = cfg_maker()
2) Through Configuration File
Create a config.yaml file, see config.yaml.example in the repository for configuration example
Then use cfg = pixivtools.load_pixiv_config("config.yaml")
3. Start Operations
# Pass the cfg object obtained from the previous step
service = pixivtools.new_pixiv_service(cfg)
# Get crawler instance
crawler = service.crawler()
# Examples of different crawling modes
crawler.get_by_artwork_id(98538269)
crawler.get_by_user_id(23279364)
crawler.get_by_pixivision_aid(9374)
crawler.get_by_follow_latest(1)
crawler.get_by_recommend()
crawler.get_by_rank(pixivtools.RankType.MONTHLY, 20250313, 1)
crawler.get_by_request_recommend()
crawler.get_by_user_bookmark(92803629, 1)
crawler.get_by_tag_popular("ホロライブ")
crawler.get_by_similar_artwork(115812789)
crawler.get_by_similar_user(20015785)
crawler.get_by_recommend_user()
crawler.get_by_request_creator()
4. After crawling is complete, images will be saved to the specified path, and the database will record all related metadata for your use
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pixivtools-0.0.6.tar.gz.
File metadata
- Download URL: pixivtools-0.0.6.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
326c62aea09d93e5e0eb8d55327f253ae823b0a0357b5b8c5ee5e73adf75fb92
|
|
| MD5 |
d64640b778de8bba3fc111651b46b2fc
|
|
| BLAKE2b-256 |
111f90419fcfb429f90a1e07d2560e38b37f766430ce170037570a156fbb5812
|
File details
Details for the file pixivtools-0.0.6-py3-none-any.whl.
File metadata
- Download URL: pixivtools-0.0.6-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ca3e15762acfaa1258144325168dbaff78ffc216b30a00a23d41e5cbaed9b76
|
|
| MD5 |
dc4d88b33127652bf622121388ccdb2d
|
|
| BLAKE2b-256 |
888dbbfcafe2fa8dfba2431b9d4e56b380395bc50ddf4df5352675182ecb50f6
|