Code Monkey home page Code Monkey logo

u2bili's Introduction

youtube->bilibili 搬运脚本

STARS LICENSE LAST_COMMIT

Demo预览

Preview

🍔使用

预置环境 node16.x+python3+jq

  1. yarn或者npm install安装node依赖,npx playwright install安装playwright
  2. 安装yt-dlp 文档
  3. 提供cookies:通过 .env 提供或设置BILIBILI_COOKIE环境变量
  4. ./u2bili.sh <url>
关于获取Cookie

登录后F12,Application(应用程序)面板,选择cookie进行查看。 Cookie 以下方法选择一个即可:

  • 创建文件 .env,内容格式如下,填入你的变量值即可
DedeUserID: "xxxxxx"
DedeUserID__ckMd5: "xxxxxx"
bili_jct: "xxxxxx"
SESSDATA: "xxxxxx"

注意:虽然 .gitignore 里已经写上了 .env,但还是要提醒一下一定不要将 .env 文件 push 到远端,否则有账号被盗的危险。

  • 设置BILIBILI_COOKIE环境变量
BILIBILI_COOKIE环境变量格式如下:
DedeUserID=XXX;DedeUserID__ckMd5=XXX;bili_jct=XXX;SESSDATA=XXX

🍱使用框架 Frameworks

  • yt-dlp
  • playwright
  • actionsflow

🧂Q&A

📺关于下载的清晰度

如有装有ffmpeg则会自动选择高画质视频和高画质音频然后合并。 yt-dlp文档 github.com/yt-dlp/yt-dlp#format-selection

🍥使用Github Action

❗重要提示:请clone后push到自己的私有仓库,使用额度内action时间!


Actions面板设置Secret BILIBILI_COOKIE (必要步骤)

DedeUserID=XXX;DedeUserID__ckMd5=XXX;bili_jct=XXX;SESSDATA=XXX

👆 Cookie有效期大概6个月(多设备异地登录会提前过期,所以建议使用小号,获取Cookie后本地浏览器删除Cookie不再登录)

几个重要参数

⚠免责声明

项目仅用于学习参考,如存在违反B站用户协议请使用者风险自负。

📜Licence

MIT

u2bili's People

Contributors

ame-yu avatar yuleicul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

u2bili's Issues

上传时间过长

action部分log
subs --embed-subs -o './downloads/%(id)s.%(ext)s' --exec 'node upload.js ./downloads/JQTIFDVLD3E.json'
[0-youtube-youtube.yml/U2bili workflow 0] | 从环境变量读取Cookie
[0-youtube-youtube.yml/U2bili workflow 0] | 开始上传/home/runner/work/u2bili/u2bili/downloads/JQTIFDVLD3E.webm
[0-youtube-youtube.yml/U2bili workflow 0] | 上传时间过长

运行时出现报错

./u2bili.sh:` line 14: jq: command not found                                                                                                                                            
./u2bili.sh: line 15: jq: command not found
./u2bili.sh: line 18: [: -ge: unary operator expected
./u2bili.sh: line 24: [: -ge: unary operator expected
youtube-dl https://youtu.be/QFgZQu0Fvxg -q --all-subs --embed-subs -o 'F:\111%(id)s.%(ext)s' --exec 'node upload.js F:\111QFgZQu0Fvxg.json'
WARNING: Requested formats are incompatible for merge and will be merged into mkv.    

大佬, 悄悄的告诉你, 字幕可以和视频同时上传, B站前段时间开通了.

这里不能截图, 具体位置在:
B站网页投稿页面 "标签", "简介", "定时发布" 点开下面的 " 更多设置 (含声明与权益、视频元素、互动管理等)" ,
里边有视频元素, 可以在这个页面, 在上传视频的同时上传字幕

很期待你补充这个功能

我刚参照你的代码写了 python 版 playwright 上传字幕功能, 不过只能在审核后的视频页面提交. 稍显繁琐

最后感谢你, 成就满满

大佬, 2.0 怎么没有发布 uploadsubs.js, 上传字幕功能?

大佬, 你好,
上个版本的上传字幕功能, 报错 .
var vlist = spaceData.data.list.vlist
TypeError: Cannot read properties of undefined (reading 'vlist')
我找了很多上传字幕的脚本, 你这个是我最后的希望了?
什么时间更新发布 uploadsubs.js?

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.