Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Virace/douyu-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DouYu-Push

斗鱼直播间直播推送, 专治随缘主播(🐶)

介绍

  • 已完成的功能

    • 查询直播间直播状态
    • 多个直播间监测
    • Push+ 微信推送
    • WxPusher 微信推送
    • 酷推 QQ机器人推送
    • 多线程推送
  • 待解决的问题

    • 推送可靠性问题

目录

├  index.py
│  database.py
│  push.py
│  requirements.txt

安装

要求:

注意:

  • 所需参数均以环境变量方式提供, 本地测试已pycharm为例, 可以在右上角编辑配置将环境变量加入, 也可以自行新建一个test.py, 然后模拟云函数调用.

部署

  • 环境配置

    • 完整包上传

      pip install -r requirements.txt .    

      意为将包安装在当前目录下, 云函数上传时直接将项目文件全部压缩上传即可.

    • 使用腾讯云 云函数功能“层”

      pip install -r requirements.txt -t scf_env    

      意为将包安装在scf_env目录中, 进入scf_env目录将所有文件选中压缩为zip, 在腾讯云 云函数 控制台上传层, 并在新建的函数中绑定层即可.

      打包环境建议于云函数环境相同, 为Centos7.x, Python3.6, 在本地用Windows打包后上传遇到了兼容问题. 也可以直接使用releases中layer-x.zip.

  • 环境变量

    • LEANCLOUD_APP_ID leancloud应用ID

    • LEANCLOUD_APP_KEY leancloud应用KEY

    • LEANCLOUD_OID 新建数据行ID

    • PUSH_PLUS_TOKEN push+推送token

    • COOL_PUSH_TOKEN 酷推推送token

    • WXPUSHER_TOKEN WxPusher推送token

  • 触发器

    触发器变量为json格式, key值为直播间ID, 后面具体含义详见index.py中monitor_and_notify函数注释. 支持多个直播间监测.

    {
      "71415":{
                "push_plus_topic": "",
                "push_plus_template": "",
                "cool_push_type": "",
                "cool_push_specific": "",
                "leancloud_oid": "",
                "wxpusher_type" : "",
                "wxpusher_topicids" : [],
                "wxpusher_url" : ""
               },
      "74751": {
                "push_plus_topic": "",
                "push_plus_template": "",
                "cool_push_type": "",
                "cool_push_specific": "",
                "leancloud_oid": "",
                "wxpusher_type" : "",
                "wxpusher_topicids" : [],
                "wxpusher_url" : ""
              }
    }

    可以通过创建多个触发器并行.

维护者

Virace

感谢

  • @pcstx1, Push+ 服务提供方

  • @xuthus, CoolPush 服务提供方

  • @lanyunt, WxPusher 服务提供方

  • 以及JetBrains提供开发环境支持

许可证

The MIT License

About

斗鱼直播间直播推送, 专治随缘主播(狗头)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages