Code Monkey home page Code Monkey logo

pornbot_go's Introduction

pornbot_go

特点

破解91视频的播放限制、理论上可以无限下载

切除长视频(4分钟)播放开始的静态帧(10秒)

为标题添加中文分词,解决电报对中文搜索的问题

重试机制,网络超时重试

bot采用 webhook 方式,并发(同时可以做负载均衡)

向机器人(@porn_91Bot)发送链接,可以 获取视频真实地址下载视频

docker预装环境,方便更换服务,一键启动

自定义关键字删除

已知问题

ffmeg转换长视频会随机卡住,手动杀死进程后,自动重试正常

iOS电报的视频会显示方形(已修复)

更新

2021-10-12 优化获取方式,cookie

2021-09-26 优化大文件上传,取消切割视频

2021-09-13 重复消息直接回复,速度超快

2021-09-12 解决验证问题

2021-09-11 增加分层构建镜像,减小镜像体积

软件安装

安装 docker

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh --mirror Aliyun&&systemctl enable docker&&systemctl start docker

安装docker-compose

curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose &&chmod +x /usr/local/bin/docker-compose

常用docker命令

删除容器
docker rm -f pornbot
删除镜像
docker rmi jwstar/pornbot_tg
进入容器
docker exec -it pornbot /bin/bash

配置

创建目录 /porn

mkdir /porn

申请证书

注意事项参考 https://core.telegram.org/bots/api#setwebhook


1.只要设置了传出 webhook,您就无法使用getUpdates接收更新。
2.要使用自签名证书,您需要使用证书参数上传您的公钥证书。请上传为 InputFile,发送字符串将不起作用。3. Webhooks当前支持的端口:443, 80, 88, 8443。

证书申请 根据 cloudflare dns申请 ,其他方法参考 https://github.com/acmesh-official/acme.sh/wiki/%E8%AF%B4%E6%98%8E


curl  https://get.acme.sh | sh -s [email protected]


export CF_Key="xxxxxx"

export CF_Email="[email protected]"

acme.sh   --issue   --dns dns_cf   -d xxxx.xxxx.com 
//设置证书位置到项目下
acme.sh  --installcert  -d  xxxx.xxxx.com     \
        --key-file   /porn/server.key \
        --fullchain-file /porn/server.crt

编辑/porn下的 conf.yml

#telegram  Token
token: "***:*********"

webhook_url: "https://****************"
webhook_port: ":443"
max_connections: 4
#群组或自己的id
telegram_id: 22222
#定时任务表达式
spec: "0 0 6 * * ?"

编辑docker-compose

version: "3.7"

services:
  pornbot:
    image: jwstar/pornbot_tg
    container_name: pornbot
    volumes:
      - /porn:/config
    ports:
      - "443:443"  #端口号和conf.yml一致

启动项目

docker-compose up 

测试

发送 /hello 到机器人

得到回复 Hello World!

鸣谢

https://github.com/acmesh-official/acme.sh/wiki/%E8%AF%B4%E6%98%8E

https://github.com/tucnak/telebot

https://github.com/gocolly/colly

https://github.com/chromedp/chromedp

https://github.com/go-ego/gse

pornbot_go's People

Contributors

jw-star avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.