您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
https://mikanani.me/ 蜜柑计划增加播放器播放按钮,下载,在线播放
蜜柑计划调用bitplay实现iina/potplayer在线播放油猴脚本 感谢bitplay项目,服务器端:https://github.com/aculix/bitplay
docker run -d \
--name bitplay \
-p 3347:3347 \
-v $(pwd)/torrent-data:/app/torrent-data \
-v $(pwd)/config:/app/config \
--restart unless-stopped \
ghcr.io/aculix/bitplay:main
在 script.js
中修改 SERVER_LIST
常量即可添加额外的后台服务器,例如:
let SERVER_LIST = [
{ name: 'bitplay', url: 'https://bitplay.to', ping: 0 },
{ name: 'custom', url: 'https://example.com', ping: 0 }
];
当使用自定义域名时,需要同步在脚本头部添加对应的 @connect
声明,可写多行或使用通配符:
// @connect bitplay.to
// @connect example.com
// @connect *.example.net
如果没有更新 @connect
,对这些地址的 GM.xmlHttpRequest
请求将会被阻止。
脚本还支持从远程地址获取服务器列表,地址由 SERVER_LIST_URL
常量配置。
若配置此项,SERVER_LIST的值会无效,配置服务器也需要增加@connect
远程接口需要返回如下格式的 JSON:
{ "serverList": [ { "name": "bitplay", "url": "https://bitplay.to" } ] }
当 SERVER_LIST_URL
设置为非空值时,脚本会优先从远程加载列表,
并将结果缓存 12 小时以减少请求次数。
优化项:
bitplay在调用/add接口后可用于播放的stream链接大概只有20分钟的存活期,可以配置Cloudfalre缓存对https://{$host}/api/v1/torrent/*/stream/*/*.mp4
进行缓存可以解决这个问题
bitplay的在线播放按钮和下载按钮都是唤起另一个页面打开https://{$host}/api/v1/torrent/*/stream
接口的逻辑,由于bitplay没有返回Content-Disposition,默认逻辑都是从当前浏览器播放。
如果使用Cloudfalre的缓存过后,Cloudfalre会默认增加Content-Disposition:attachment
响应头导致会执行下载行为,因此需要配置Cloudfalre的响应标头转换规则。(注意执行顺序)
| URL | 响应头 |
| :----------------------------------------------------- | :---------------------------------------------------------- |
| https://{$host}/api/v1/torrent/*/stream/*/*.mp4
| Content-Disposition:attachment
,Content-Type: video/mp4
|
| https://{$host}/api/v1/torrent/*/stream/*/stream.mp4
| Content-Disposition:inline
,Content-Type: video/mp4
|
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址