Skip to main content

QChanCrawler

QChanCrawler retrieves posts from QQ channels and saves them to a SQLite database. It can crawl channels supplied explicitly or discover channels from the Explore recommendations.

Requirements

  • Python 3.12 or later.

Installation

pip install qchancrawler

Usage

Crawl specified channels

qchancrawler -g ID1 ID2 ID3

The channel identifiers may be numeric guild IDs or QQ channel numbers. More than one identifier can be supplied; the channels are crawled concurrently.

qchancrawler -e

-e discovers channels from the explore section and crawls them. If no number is supplied, it requests 200 channels. You can also supply with inf or infinite to crawl infinitely from exploration.

Examples

qchancrawler -g 123456
qchancrawler -g 123456 Mine101 -o posts.db
qchancrawler -e -c cookies.txt -v
qchancrawler -e inf

Options:

  • -g, --guild: QQ channel/guild IDs to crawl.
  • -e, --explore: Discover and crawl recommended channels. The optional count defaults to 200.
  • -c, --cookie: Path to an exported pd.qq.com cookie file. Optional for posts, but required to crawl comments and replies.
  • -o, --outfile: SQLite database path. Defaults to ./qchan.db.
  • -p, --page: Starting page number. Crawling continues until the API reports that there are no more pages. Defaults to 1.
  • -v, --verbose: Enable verbose progress output.
  • --version: Show the installed QChanCrawler version.

Database

The posts table contains these fields:

  • id: Auto-incrementing SQLite row ID.
  • guild_id: QQ guild/channel identifier.
  • guild_name: QQ guild/channel name.
  • item_id: Unique ID of the post, comment, or reply. Rows are deduplicated by item_id.
  • item_type: One of post, comment, or reply.
  • published_at: Item publication time as a Unix timestamp.
  • author_name: Author nickname.
  • author_id: Author identifier.
  • author_location: Author province.
  • icon_url: Author avatar URL.
  • text: Item content.
  • post_url: URL of the source post. Comments and replies use the URL of their parent post.

Item relationships

Post
|
|-- Comment
|   |
|   |-- Reply

Each item has its own item_id. Comments and replies are associated with the parent post through post_url.

The cookie file must use the Mozilla/Netscape cookies.txt format. Browser extensions and other cookie-export tools can create files in this format.

Cookies are optional when crawling posts, but are required for crawling comments and replies. It's also recommended for crawling exploration, because the exploration section will be duplicated in log-out status.

The cookie file must contain a pair of valid p_uin and p_skey.

Disclaimer

Use QChanCrawler only for channels and data you are authorized to access. Protect personal data and exported cookies, avoid excessive requests, respect service rate limits, and comply with QQ's terms and policies.

Release files for qchancrawler 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qchancrawler 0.2.0
File Size Uploaded
qchancrawler-0.2.0.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qchancrawler 0.2.0
File Interpreter ABI Platform
qchancrawler-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.3 kB

Release files / qchancrawler-0.2.0.tar.gz

Download URL qchancrawler-0.2.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a954a4337048fcf0f4307d3f99cf110576e3c355c4058691430ff08e5601b90c
BLAKE2b-256 checksum
How to use checksums
99e8b21b91acbc5804251dfa9c90bf30f0b9687901ae2e8bc4640827b967903d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / qchancrawler-0.2.0-py3-none-any.whl

Download URL qchancrawler-0.2.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1e8cdfcfdac7ea85f15dd29f23f963e9a9b7d9fab899226f9a6f5f94c7f869d
BLAKE2b-256 checksum
How to use checksums
af51f3ad3ab4e451135ded029582e21cd6ca45d87728aaf17e25e0a8f79dc670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page