Code Monkey home page Code Monkey logo

bilibili-daily-task's Introduction

bilibili-daily-task

自动完成 哔哩哔哩 的每日任务(开发中)

GitHub stars GitHub forks GitHub issues GitHub license

(功能应该都能用了..)

目前的开发已移至dev分支, 确保功能基本可用后合并到main分支.

overview

使用selenium模块控制浏览器完成每日任务

todo

(空)

已知bug / known bugs

  • 有时会弹出登录框. 现在可自动关闭登录框
  • 分享 功能有时会出问题, 故禁用. 可修改源代码启用 目前很少出问题, 故启用
  • 窗口较小时, 会报错 每次点击时, 固定窗口大小和滚动, 确保要点击的元素可见
  • 无头模式下, 不能播放视频
  • 在 github action 中, 第一次不能正常登录, 需要手动扫码登录 见[说明](# github action)

功能 / functions

  • 使用自定义cookies登录
  • 手机端扫描二维码登录, 自动设置cookies
  • 自动观看, 点赞, 投币, 分享
  • 逐步完善... 可提交功能申请issue, 尽量详细说明操作步骤

特点 / feature

  • 模拟操控浏览器, 尽可能防止被封杀
  • 移除了navigator.webdriver接口
  • 无头模式 (见 配置文件)
  • 浏览器默认静音
  • 使用ActionChains完成页面操作, 提高"安全性"
  • 支持手机端扫描二维码设置cookies

Api

github action

设置了 github action, 用于自动执行, 正在测试...

  • todo: 第一次登录时, 自动设置secret
  • 因为 github action 的服务器在国外, 所以第一次需要扫码登录

如何使用 / how to use

安装python环境

  • 版本建议 python3.8 +
  • 详细步骤参考相关文章

安装依赖库

针对linux系统. Windows用户需将pip3改为pip.

pip3 install bs4 urllib3 lxml selenium requests qrcode

安装firefox浏览器和driver(geckodriver)

  • 安装firefox
  • windows用户, 去官方网站下载并放到此项目的根目录.
  • linux用户:
# archlinux:
sudo pacman -S geckodriver

# debian/ubuntu:
sudo apt install firefox-geckodriver net-tools

其他发行版, 去其软件库搜索...

设置cookie

  • 手动修改 配置文件
  • 或, 运行脚本 auto_config.py 通过手机端扫描二维码自动设置cookies

运行

  • 针对linux系统. Windows用户需将python3改为python.
python3 main.py
  • 可自行修改此文件, 定制功能

配置文件 / config files

  • 配置文件目录:config/
  • 相关说明在此目录中

注意事项 / warning

  • 运行过程中, 不要将鼠标光标放入浏览器网页区域内.
  • 若脚本抛出异常并终止, 导致处于无头模式的浏览器仍在运行, 使用kill_browser.py结束后台的浏览器进程(暂不支持windows).
  • 网络不好(访问b站很慢)的情况下, 使用此脚本可能会时不时地崩溃.

bilibili-daily-task's People

Contributors

chloe5685 avatar sb-child avatar

Stargazers

 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.