Telegram 隨機色圖,支援每日自動爬取

Overview

Telegram 隨機色圖機器人

使用此原始碼的Bot

開放的隨機色圖機器人: @katonei_bot

已實現的功能

  • 爬取每日R18排行榜
  • 不夠色!再來一張
  • Tag 索引,指定Tag色圖
  • 將爬取到的色圖轉為 WebP 格式儲存,節省空間

需要注意的事件

  • 好久之前的怪東西,代碼質量不保證
  • 請在使用API前修改 cookie.conf,將自己的pixiv登錄cookie填入(R-18內容必須登錄才能請求)
  • 請啟動 app.py, bot.py 兩個 python 檔,app.py 為 WebAPI,運行於 8080
  • 定時任務需要外部實現(定時請求指定API)
  • 可能不支援 Python 3.6 以前的版本

使用教程

1. 安裝依賴庫

pip3 install python-telegram-bot
pip3 install requests
pip3 install web.py
pip3 install pillow

2. 申請 Bot Token (如果你有token可以跳過這一步)

  • 私訊 @BotFather,申請 Bot Token
  • 將申請到的 BotToken 填入 bot.py 的第 7 行,如 123456789:IAWUGHIGEBIEGHEJguegvhsig

3. 啟動 Bot 和 WebAPI

nohup python3 app.py &
nohup python3 bot.py &

4. 手動設定定時任務

  • xxx.xxx.xxx.xxx:8080/api/updateNow 爬取每日 R-18 排行榜 (一天一次)
    • 返回值:ok
  • xxx.xxx.xxx.xxx:8080/api/tagsdb_update 更新tag索引列表 (每次爬取/更新圖庫完成後)
    • 返回值:ok
  • xxx.xxx.xxx.xxx:8080/api/list_update 更新全局索引列表 (每次爬取/更新圖庫完成後)
    • 返回值:ok

5. 結束!導入色圖庫或開始爬取

  • 關於命令:請發送 /help 給Bot查看如何操作
  • 導入色圖庫:我將會在整理完成已有的色圖庫後將其上載

完整API列表

  • xxx.xxx.xxx.xxx:8080/api/num 獲取隨機 imgid ( /webp/ 目錄內的索引)
    • 返回值:隨機imgid,如 19852
  • xxx.xxx.xxx.xxx:8080/api/num_tag?tag=tag名 指定 Tag 的隨機 imgid (需要先更新tag索引列表)
    • 返回值:隨機imgid
  • xxx.xxx.xxx.xxx:8080/api/updateNow 爬取每日 R-18 排行榜
    • 返回值:ok
  • xxx.xxx.xxx.xxx:8080/api/tagsdb_update 更新tag索引列表
    • 返回值:ok
  • xxx.xxx.xxx.xxx:8080/api/list_update 更新全局索引列表
    • 返回值:ok
Owner
cluckbird
cluckbird
A GitHub Action that automatically reports your Advent of Code progress in a table in your README

Advent README Stars This action adds and maintains a stars report in your README based on your Advent of Code progress. Example Table 2021 Results Day

Kevin Duff 36 Dec 30, 2022
Dashboard to monitor the performance of your Binance Futures account

futuresboard A python based scraper and dashboard to monitor the performance of your Binance Futures account. Note: A local sqlite3 database config/fu

86 Dec 29, 2022
just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam these websides with fake logins

scam-webside-spammer just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam the

TerrificTable 3 Sep 23, 2022
Implement SAST + DAST through Github actions

Implement SAST + DAST through Github actions The repository is supposed to implement SAST+DAST checks using github actions against a vulnerable python

Syed Umar Arfeen 3 Nov 09, 2022
A minimalistic library designed to provide native access to YNAB data from Python

pYNAB A minimalistic library designed to provide native access to YNAB data from Python. Install The simplest way is to install the latest version fro

Ivan Smirnov 92 Apr 06, 2022
This is a python bot that automatically logs in, clicks the new button, and sends heroes to work in the bombcrypto game

This is a python bot that automatically logs in, clicks the new button, and sends heroes to work in the bombcrypto game. It is fully open source and free.

856 Jan 04, 2023
Oussama has taken his first dose of vaccine D days ago

Oussama has taken his first dose of vaccine D days ago. He may take the second dose no less than L days and no more than R days since his first dose. Determine if Oussama is too early, too late, or i

INDIA - ENSAM Rabat 2 Feb 01, 2022
Automatically copy the Discord Status of a Friend you share a server with (conditions have to be satisfied to work)

CopyDiscordStatusOfUser-SelfBot Basic Function Automatically copy the Discord Status of a friend User whom you share a server with (These conditions h

Certified Baller 5 Aug 05, 2022
Discord bot ( discord.py ), uses pandas library from python for data-management.

Discord_bot A Best and the most easy-to-use Discord bot !! Some simple basic auto moderations, Chat functions. It includes a game similar to Casino, g

Jaitej 4 Aug 30, 2022
Polar devices Python API and CLI.

loophole - Polar devices API About Python API for Polar devices. Command line interface included. Tested with: A360 Loop M400 Installation pip install

[roscoe] 145 Sep 14, 2022
Andrei 1.4k Dec 24, 2022
dex.guru python sdk

dexguru-sdk.py dexguru-sdk.py allows you to access dex.guru public methods from your async python scripts. Installation To install latest version, jus

DexGuru 17 Dec 06, 2022
A simple fun discord bot using discord.py that can post memes

A simple fun discord bot using discord.py * * Commands $commands - to see all commands $meme - for a random meme from the internet $cry - to make the

Dice Flip 2 Dec 20, 2021
Example code for interacting with solana anchor programs - candymachine

candypy example code for interacting with solana anchor programs - candymachine THIS IS PURELY SAMPLE CODE TO FORK, MODIFY, UNDERSTAND AND INTERACT WI

dubbelosix 3 Sep 18, 2022
Robot Swerve Test Public With Python

Robot-Swerve-Test-Public The codebase for our swerve drivetrain prototype robot.

1 Jan 09, 2022
Student-Management-System-in-Python - Student Management System in Python

Student-Management-System-in-Python Student Management System in Python

G.Niruthian 3 Jan 01, 2022
Backend.AI Client Library for Python

Backend.AI Client The official API client library for Backend.AI Usage (KeyPair mode) You should set the access key and secret key as environment vari

Lablup 10 Feb 10, 2022
A Telegram Music Bot with proper functions written in Python with Pyrogram and Py-Tgcalls.

⭐️ Yukki Music Bot ⭐️ A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls Ready to use method A Support Group and ready-to-use runnin

Shikhar Kumar 1000 Jan 03, 2023
A python bot that will allow you to have maximum luck during Veve drops.

VeveBot You can follow me here Github | Twitter Features: - Click on the purchase at the time of the drop. - Be able to choose to do more than one tes

Rodz 1 Dec 04, 2021