No project description provided
Project description
Grabber
Utilities to extract media from supported sources and publish to Telegram/Telegraph.
Quick Start
- Install dependencies:
uv sync --dev
- Configure environment in
.env(at minimum):
BOT_TOKENTELEGRAPH_TOKENSHORT_NAMEAUTHOR_NAMEAUTHOR_URL
- Show supported entities:
uv run grabber -a
Run (CLI)
Example:
uv run grabber --publish --channel @your_channel --sources "https://example.com/post"
Send plain text to a channel:
uv run grabber --channel @your_channel --text "Some text"
Post text into a thread (discussion group):
uv run grabber --channel @your_channel --thread-id 123 --text "Some text in thread"
If --thread-id is omitted, grabber prints the resolved thread id so you can reuse it:
uv run grabber --channel @your_channel --text "Some text"
Output:
Text sent to @your_channel
Resolved thread id for reuse: --thread-id 123
Run Interactive Bot
uv run python -m grabber.core.bot.interactive_bot
Then use /post, select channel, and send source URLs.
Run Web UI
The web interface is served in two services:
web-api: FastAPI backend (session-protected endpoints)web-ui: React dashboard
Setup
- Add web environment variables:
WEB_UI_PASSWORD=your-strong-password
WEB_SESSION_SECRET=a-long-random-string
WEB_SESSION_TTL_SECONDS=86400
- Start the stack:
docker compose up --build web-api web-ui
-
Open
http://<your-vps-ip>:8888(or map another public port indocker-compose.yml). -
Log in with
WEB_UI_PASSWORD. After login:
- Enter one or more URLs and target channel
- Optionally enable tag mode/video mode
- Send plain text by checking Post text only
- Optionally provide a thread id (
--thread-id) for text replies/comments
Notes:
- The channel list is pulled from the existing bot
CHANNELSmapping (src/grabber/core/settings.py). - Entity list comes from
QUERY_MAPPING. - API routes are exposed under
/api/*and proxied by the UI.
Pornhub Video-to-Channel
Single-video Pornhub URLs are supported for direct Telegram delivery.
Requirements
- A target channel is mandatory (
--channelin CLI or bot channel picker). yt_dlpmust be available in the runtime environment.PORNHUB_COOKIES_FILE_PATHmust point to a valid Netscape-format cookies file.
Add to .env:
PORNHUB_COOKIES_FILE_PATH=/absolute/path/to/pornhub_cookies.txt
Supported Pornhub hosts
pornhub.comwww.pornhub.comm.pornhub.com
CLI example
uv run grabber \
--publish \
--channel -1003835153909 \
--sources "https://www.pornhub.com/view_video.php?viewkey=ph5abc123"
Note: CLI --channel must be a Telegram username/ID (for example @channel_name or -100...), not the interactive bot display label.
Delivery behavior
- Chooses the best format expected to fit Telegram Bot API upload limits (
<= 50MB). - If the selected media is oversized, it sends a link message fallback to the channel.
- If
--channelis missing, Pornhub execution fails fast with an explicit error. - If
PORNHUB_COOKIES_FILE_PATHis missing/invalid, execution fails fast. - Checkpoint dedupe is applied, and successful sends are committed.
Troubleshooting
PORNHUB_COOKIES_FILE_PATH is required...- Set
PORNHUB_COOKIES_FILE_PATHin.env.
- Set
...does not exist or is not a file- Fix the path and permissions for the cookies file.
yt_dlp is required to process Pornhub sources- Install dependencies in the same runtime where
grabberexecutes.
- Install dependencies in the same runtime where
ERROR: [PornHub] ... Unable to extract title- The adapter now auto-falls back to HTML media parsing when
yt_dlpmetadata extraction fails. - If it still fails, refresh/export cookies again and update
yt-dlpin your runtime.
- The adapter now auto-falls back to HTML media parsing when
- Oversized media warnings
- Expected behavior; the source falls back to link delivery.
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 grabberlib2-0.15.3.tar.gz.
File metadata
- Download URL: grabberlib2-0.15.3.tar.gz
- Upload date:
- Size: 121.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de3b1fa38f16665c90f8e977bd195709ed298e7c391455460b83b2693aa6434e
|
|
| MD5 |
be99423d6348cd13531fe230722f0f13
|
|
| BLAKE2b-256 |
bcc3697e6c00d836674dceaaf1aa74d301537efefc5d3d848cb171437682c92e
|
File details
Details for the file grabberlib2-0.15.3-py3-none-any.whl.
File metadata
- Download URL: grabberlib2-0.15.3-py3-none-any.whl
- Upload date:
- Size: 283.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27499aaa95328916037b855a613e0660a1d92162e221826c88de558d32007901
|
|
| MD5 |
c7b82884384ff8d95329a8de02b767ce
|
|
| BLAKE2b-256 |
761891ae56835f1c9e2c76146e119bac2aca48c5b8b9b9af981b9c35e9b857bc
|