✏ A Telegram bot that can download images from Pixiv and Twitter and upload them to Telegram channels.
- Subscribe to Pixiv favorites based on RssHub and push them
- Parse Pixiv links and push them
- Parse Twitter links and push them
- Pull Docker image
$ docker pull googujiang/gu-picbot
- Create bot data folder
$ mkdir ~/gu-picbot
- Create and run container
$ docker run --name gu-picbot \
-v ~/gu-picbot:/data \
-e CHANNEL_ID=<channel_id> \
-e BOT_TOKEN=<bot_token> \
-e RSS_URL=<rss_url> \
-e REFRESH_TOKEN=<refresh_token> \
-e BOT_ADMIN=<bot_admin> \
-d googujiang/gu-picbot
Note:
-
Please refer to the following ❤️ Configuration for
<channel_id>
,<bot_token>
,<rss_url>
,<refresh_token>
. -
Use
,
to separate multipleBOT_ADMIN
.
-
Make sure the
python
version is>=3.6.*
. -
Clone this repository:
$ git clone https://github.com/GooGuJiang/Gu-Random-Image.git
- Install required libraries:
$ pip install -r requirements.txt
- Run initialization:
$ python3 main.py
-
Fill in the configuration file.
-
Run:
$ python3 main.py
Currently, only Pixiv and Twitter links can be parsed, and more functions will be added later.
Here is a detailed description of the configuration parameters:
Parameter | Description |
---|---|
REFRESH_TOKEN | The Refresh token with Pixiv login |
RSS_URL | The URL of the RSS subscription |
BOT_TOKEN | The Telegram bot token |
CHANNEL_ID | The unique identifier of the channel or group to send messages |
BOT_ADMIN | A list of user IDs of the bot administrator |
RSS_SECOND | The time interval (in seconds) for RSS update check |
PROXY | URL of the proxy server |
PROXY_OPEN | Whether to enable the proxy server |
LOG_OPEN | Whether to enable logging |
FILE_DELETE | Whether to delete the downloaded file after downloading |
Note:
- REFRESH_TOKEN, BOT_TOKEN, and CHANNEL_ID are required parameters, and must be correctly configured to run the bot.
- The RSS_URL and RSS_OPEN parameters are used to enable and configure the RSS subscription function, and are optional.
- The PROXY and PROXY_OPEN parameters are used to enable and configure the proxy server, and are optional.
- The BOT_ADMIN parameter is used to configure bot administrators, who have special permissions to manage the bot.
- The value of the parameter must be enclosed in double quotes, and must be connected to the parameter name with an equal sign.
Encounter Cloudflare version 2 Captcha
when starting up
Solution:
It has been solved by a hardcore method, but if it still doesn't work after 10 automatic retries, it may be an IP problem.
Some of the code for downloading Twitter images comes from Twitter media downloader.