Unofficial PyPI distribution of Pinchana Twitter/X scraper maintained by radimbig
Project description
radimbig-pinchana-twitter
Unofficial PyPI distribution of the Pinchana Twitter/X scraper, maintained by radimbig for use as both a Pinchana plugin and an importable Python package.
Original project and copyright belong to Pinchana. This fork keeps the original logic and adds packaging metadata plus a small synchronous library wrapper.
Strategy
- Primary: X internal GraphQL (
TweetResultByRestId) using guest token activation + CSRF (ct0) handling. - Resilience: Automatic VPN IP rotation via Gluetun on rate limits (429/403).
- Fallback:
api.fxtwitter.comfor public tweet metadata when GraphQL is blocked. - Media: Download media to local cache and expose via
/media/twitter/{tweet_id}/{file}.
API
POST /scrape— scrape a tweet URLGET /media/twitter/{tweet_id}/{filename}— serve cached mediaGET /health— VPN status
Library Usage
Install the package:
pip install radimbig-pinchana-twitter
Import the package as pinchana_twitter:
from pinchana_twitter import download_x_post_assets
result = download_x_post_assets(
post_url="https://x.com/user/status/1234567890",
temp_directory="./temp_videos",
user_id=42,
request_id="abc123",
)
print(result["text"])
print(result["author_username"])
print(result["files"])
The synchronous wrapper returns:
{
"text": "...",
"author_username": "user",
"files": [{"path": "...", "media_type": "photo"}],
}
Use media_type == "photo" for images and media_type == "video" for videos.
Publishing
The package publishes to PyPI when a v* tag is pushed and the repository has a
PYPI_API_TOKEN secret configured.
Project details
Release history Release notifications | RSS feed
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 radimbig_pinchana_twitter-1.0.0.tar.gz.
File metadata
- Download URL: radimbig_pinchana_twitter-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d28f6d4af70a38fbbf6254481a0717038ec3e304613c05abab47a087618316b
|
|
| MD5 |
211dad4d94cdc37de232c5e93d0beacd
|
|
| BLAKE2b-256 |
fa6ccef40dd63a22ff997053be2291fac8df152da61939fa74516117d6c05dc4
|
File details
Details for the file radimbig_pinchana_twitter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: radimbig_pinchana_twitter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa22e9ce090d64f2d59ff439dc7c3ff8a0b13eefc5daa3b124ea78110b7ebc57
|
|
| MD5 |
9a07bfe788072e67d63012ab1c212a6f
|
|
| BLAKE2b-256 |
6a3e8283a2b7efe37cd57bb5696368400730db2455ecc8e925e967af1de6506b
|