CWHer / PixivCrawler

Pixiv Utils implemented in Python, including Pixiv Crawler and Mosaic Puzzles, support for rankings, personal bookmarks, artist works and keyword search for personalized filtering, and provide high-performance multi-threaded parallel download. 🤗
GNU General Public License v3.0
223 stars 28 forks source link
crawler multithreading pixiv pixiv-crawler pixiv-downloader python

Pixiv Utils

Daily test

The Chinese version of README can be found here.

About

Pixiv Utils implemented in Python, including Pixiv Crawler and Mosaic Puzzles, support for rankings, personal bookmarks, artist works and keyword search for personalized filtering, and provide high-performance multi-threaded parallel download. 🤗

This GIF depicts a sample run in normal speed,

Features

Installation

Install from PyPI (Recommended)

pip install pixiv-utils

Install from source

git clone git@github.com:CWHer/PixivCrawler.git
pip install -v .

Quick Start

Please refer to tutorial for comprehensive instructions.

Note: This section only contains the usage of Pixiv Crawler. For the usage of Mosaic Puzzles, please refer to Mosaic Puzzles Doc.

import datetime

from pixiv_utils.pixiv_crawler import (
    RankingCrawler,
    checkDir,
    displayAllConfig,
    download_config,
    network_config,
    ranking_config,
    user_config,
)

if __name__ == "__main__":
    network_config.proxy["https"] = "127.0.0.1:7890"
    user_config.user_id = ""
    user_config.cookie = ""
    download_config.with_tag = False
    ranking_config.start_date = datetime.date(2024, 5, 1)
    ranking_config.range = 2
    ranking_config.mode = "weekly"
    ranking_config.content_mode = "illust"
    ranking_config.num_artwork = 50

    displayAllConfig()
    checkDir(download_config.store_path)

    app = RankingCrawler(capacity=200)
    app.run()

Learn about the configurations

The configurations locate at config.py, which contains several items that should potentially be modified, denoted by :warning:. You can simply import these configurations, modify them like the example above, and use displayAllConfig() to check if they are correct.

Create a crawler instance

Run

Just run your script. :laughing:

Tips

Documentation

Star History

Star History Chart