Code Monkey home page Code Monkey logo

biliup-rs's Introduction

biliup-rs

Crates.io GitHub all releases Telegram Discord chat

B 站命令行投稿工具,支持短信登录账号密码登录扫码登录浏览器登录以及网页Cookie登录,并将登录后返回的 cookie 和 token 保存在 cookie.json 中,可用于其他项目。

文档地址https://biliup.github.io/biliup-rs

本项目使用 Rust,可以作为 lib 被调用,理论上可以通过 PyO3 作为库提供给 Python 和 napi-rs 给 Node.js 等进行调用。

下载地址

Aspirations

upload

  • bilibili
  • 小红书(work-in-process)

download

  • 斗鱼直播
  • 虎牙直播
  • B站直播
  • 抖音live (coming soon)
  • 快手live (coming soon)

USAGE

投稿支持直接投稿和对现有稿件追加投稿

  • 快速投稿,输入 biliup upload test1.mp4 test2.mp4 即可快速多p投稿;
  • 通过配置文件投稿,配置文件详见 config.yaml ,支持按照 Unix shell style patterns 来批量匹配视频文件,如 /media/**/*.mp4 匹配 media 及其子目录中的所有 mp4 文件且可以自由调整视频标题、简介、标签等:
$ biliup help upload
上传视频

Usage: biliup upload [OPTIONS] [VIDEO_PATH]...

Arguments:
  [VIDEO_PATH]...  需要上传的视频路径,若指定配置文件投稿不需要此参数

Options:
      --submit <SUBMIT>            提交接口 [default: client] [possible values: client, app, web]
  -c, --config <FILE>              Sets a custom config file
  -l, --line <LINE>                选择上传线路 [possible values: bda2, ws, qn, bldsa, tx, txa, bda]
      --limit <LIMIT>              单视频文件最大并发数 [default: 3]
      --copyright <COPYRIGHT>      是否转载, 1-自制 2-转载 [default: 1]
      --source <SOURCE>            转载来源 [default: ]
      --tid <TID>                  投稿分区 [default: 171]
      --cover <COVER>              视频封面 [default: ]
      --title <TITLE>              视频标题 [default: ]
      --desc <DESC>                视频简介 [default: ]
      --dynamic <DYNAMIC>          空间动态 [default: ]
      --tag <TAG>                  视频标签,逗号分隔多个tag [default: ]
      --dtime <DTIME>              延时发布时间,距离提交大于4小时,格式为10位时间戳
      --interactive <INTERACTIVE>  [default: 0]
      --mission-id <MISSION_ID>
      --dolby <DOLBY>              是否开启杜比音效, 0-关闭 1-开启 [default: 0]
      --hires <LOSSLESS_MUSIC>     是否开启 Hi-Res, 0-关闭 1-开启 [default: 0]
      --no-reprint <NO_REPRINT>    0-允许转载,1-禁止转载 [default: 0]
      --open-elec <OPEN_ELEC>      是否开启充电, 0-关闭 1-开启 [default: 0]
      --up-selection-reply         是否开启精选评论,仅提交接口为app时可用
      --up-close-reply             是否关闭评论,仅提交接口为app时可用
      --up-close-danmu             是否关闭弹幕,仅提交接口为app时可用
  -h, --help                       Print help
  • 下载视频:./biliup download https://xxxx
  • 查看转码失败具体分p:./biliup show BVxxxxx
  • 查看完整用法命令行输入 biliup -h
biliup 0.1.14
Upload video to bilibili.

USAGE:
    biliup.exe [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -h, --help                         Print help information
    -u, --user-cookie <USER_COOKIE>    登录信息文件 [default: cookies.json]
    -V, --version                      Print version information

SUBCOMMANDS:
    append      是否要对某稿件追加视频
    download    下载视频
    dump-flv    输出flv元数据
    help        Print this message or the help of the given subcommand(s)
    login       登录B站并保存登录信息
    renew       手动验证并刷新登录信息
    show        打印视频详情
    upload      上传视频

多账号支持

请在子命令之前通过 -u 或者 --user-cookie 参数传入 cookie 文件的路径(默认为当前目录下的 "cookies.json")。例如:

$biliup -u user1.json login
$biliup --user-cookie user2.json upload ...
$biliup renew  # ./cookies.json

Windows 演示

登录:

.\biliup.exe login

login

上传:

.\biliup.exe upload

upload

SEE ALSO


bilibili 投稿模式分主要为 fetch 和直传两种,线路概览:

测速:http://member.bilibili.com/preupload?r=ping

  • bup(直传b站投稿系统)
    • upos
      • bda2(百度云)
      • qn(七牛)
      • ws(网宿)
      • bldsa (百度云)
      • tx (腾讯云EO)
      • txa (腾讯云EO海外)
      • bda (百度云海外)
  • bupfetch (传至合作方后由b站投稿系统拉取,已经长时间不可用
    • kodo(七牛)
    • bos(百度)
    • gcs(谷歌)
    • cos(腾讯)

未选择上传线路时,在上传前会通过 probe 来返回几条线路,并发包测试从中选择响应时间较短的,正常情况下都会选择到良好的上传线路。 如果自动选择的线路上传速度不佳,可以增大并发数或指定上述已支持选择的线路。 理论上,增加并发数能加快上传速度,但部分线路存在并发数限制,请结合实际自行测试。

TIPS

用户等级大于 3 ,且粉丝数 > 1000 ,Web 端投稿不限制分 P 数量。B 站 Web 端将替换为合集

对于不满足条件的账号,多 P 投稿只能依靠 B 站的投稿客户端,但是投稿客户端使用的线路与 Web 端不同,质量低于 Web 端的线路,在国外机器会放大这一差距。所以本项目使用 client 的提交接口配合 Web 端的上传线路,弥补两者各自的不足。既可以多 P 上传,又提供了质量(速度和稳定性)较高的线路,且提供了 Web 端不具备的手动切换线路功能。

For Developers

export DATABASE_URL="sqlite:data.db"
cargo sqlx db create
cargo sqlx migrate run --source .\crates\biliup\migrations\
cargo sqlx prepare  --merged
cargo run -- server -b localhost

biliup-rs's People

Contributors

forgqi avatar haha114514 avatar hguandl avatar kataick avatar eatradish avatar coolzxp avatar xxxxuanran avatar vicat47 avatar zzc10086 avatar cxumol avatar saindriches avatar begnion avatar keyword233 avatar dreammu avatar fwqaaq 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.