snylonue / b2m Goto Github PK
View Code? Open in Web Editor NEWplay bilibili video with mpv
License: MIT License
play bilibili video with mpv
License: MIT License
有时我想开启 MPV 硬件加速, 需要开启 --hwdec=auto
选项; 或者想让 MPV 在视频缓冲后自动全屏播放, 需要添加 --fs=yes
选项. 上述两者虽然都可以在 MPV 界面初始化之后通过快捷键或者界面内的其他方式手动控制, 但终究不如有一个能通过 b2m 直接给 MPV 传递参数选项的方法来的方便直接. 因此是否可以在 b2m 中增加一个选项, 接受一个字符串, 并将其传递给 MPV 进行初始化? 例如:
USAGE:
b2m [FLAGS] [OPTIONS] <url>
FLAGS:
--no-option Don't pass any option to MPV
OPTIONS:
-o, --option <options> Set options passing to MPV
多个 options 之间可通过分号分割, 例如:
b2m -o "--hwdec=auto;--fs=yes" <url>
测试视频: https://www.bilibili.com/video/BV1px411K7Zp 等
使用 b2m https://www.bilibili.com/video/BV1px411K7Zp
播放时,视频没有声音,并且 MPV 有以下表现:
进度条显示为视频长度的两倍少一点(该视频3分22秒),第二段“视频”无法缓冲或播放,右侧音轨显示为 -/0
也就是没有音轨。
猜测是 Dash 流格式分离视频和音频导致,不过找了半天这么远古的视频都翻出来了,就是找不到一个没有 Dash 流的视频,我也不知道怎么指定 b2m
使用原本的 flv,所以我也不能确定。
使用 -j
参数可以获得两个链接,不知道是不是我姿势不对,即使伪造了 referrer
头,这两个链接也会报403
错误。audio
字段给出了一个空数组"audio":[]
。
Debian 10.5 "buster"
一开始以为是 you-get
和 mpv
的版本旧了,还特别去更新了一下。mpv
不是 Debian Stable 仓库里的(仓库里的还在 0.29.1)。
执行 b2m -c
的结果如下
Running checking
b2m version: 0.19.0
Checking for you-get
Running you-get -V
you-get version: 0.4.1456,
Stdout:
Stderr:
you-get: version 0.4.1456, a tiny downloader that scrapes the web.
you-get checking succeeded
Checking for annie
Running annie -v
annie version: 0.10.3
Stdout:
annie: version 0.10.3, A fast, simple and clean video downloader.
Stderr:
annie checking succeeded
Checking for mpv
Running mpv -V
mpv version: 0.32.0
Stdout:
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on Wed Feb 12 09:06:47 CET 2020
ffmpeg library versions:
libavutil 56.31.100
libavcodec 58.54.100
libavformat 58.29.100
libswscale 5.5.100
libavfilter 7.57.100
libswresample 3.5.100
ffmpeg version: 4.2.2
Stderr:
mpv checking succeeded
Error caught with bilibili/annie Error: Os { code: 2, kind: NotFound, message: "No such file or directory", }
Please fix, thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.