bitplay 安装测试
BitPlay 是一个开源在线Bitorrent/磁力资源边下边看播放器。可以不用下载任何客户端,直接在浏览器中播放Bittorrent种子文件或磁力链接资源
官网地址:https://bitplay.to/
Github:https://github.com/aculix/bitplay
编译安装:
Go语言版本最少要1.24.0
安装最新版本的Go1.24.2
wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
加代理
export http_proxy=socks5://127.0.0.1:10008
export https_proxy=socks5://127.0.0.1:10008
git clone https://github.com/aculix/bitplay.git
cd bitplay
go mod download
go build .
启动应用
./torrent-stream
2025/04/28 14:41:54 Proxy is disabled, not setting global HTTP proxy.
2025/04/28 14:41:54 Attempting to start server on :3347
2025/04/28 14:41:55 🚀 Server successfully started on :3347
✅ Server started! Open in your browser:
http://localhost:3347
在浏览器打开http://localhost:3347
点击Try Demo With SInter按钮正常情况下就可以播放了.
2025/04/28 14:46:54 Checking for unused sessions...
2025/04/28 14:47:07 Creating torrent client without proxy...
2025/04/28 14:47:07 Torrent added: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Successfully got torrent info for 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Creating new session with ID: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Successfully stored session: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Torrent handler called with path: /api/v1/torrent/08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Path parts: [ api v1 torrent 08ada5a7a6183aae1e09d831df6748d566095a10] (length: 5)
2025/04/28 14:47:07 Looking for session with ID: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:07 Available sessions: [08ada5a7a6183aae1e09d831df6748d566095a10]
2025/04/28 14:47:07 Found session with ID: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:08 Torrent handler called with path: /api/v1/torrent/08ada5a7a6183aae1e09d831df6748d566095a10/stream/5
2025/04/28 14:47:08 Path parts: [ api v1 torrent 08ada5a7a6183aae1e09d831df6748d566095a10 stream 5] (length: 7)
2025/04/28 14:47:08 Looking for session with ID: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:08 Available sessions: [08ada5a7a6183aae1e09d831df6748d566095a10]
2025/04/28 14:47:08 Found session with ID: 08ada5a7a6183aae1e09d831df6748d566095a10
2025/04/28 14:47:08 Streaming file: Sintel.mp4 (type: .mp4)
找一些比较新的磁力种子,应该都是能够播放的.
比如找个破地狱的
https://www.seedhub.cc/movies/121470/
https://www.seedhub.cc/link_start/?seed_id=374251&movie_title=%E7%A0%B4%C2%B7%E5%9C%B0%E7%8B%B1%E7%9A%84%E7%A3%81%E5%8A%9B
在上面的网址中,找到了磁力链接
在浏览器中输入下面的磁力链接,点击播放
magnet:?xt=urn:btih:dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:13 Creating torrent client without proxy...
2025/04/28 14:54:13 Torrent added: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Successfully got torrent info for dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Creating new session with ID: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Successfully stored session: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Torrent handler called with path: /api/v1/torrent/dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Path parts: [ api v1 torrent dca15e22e9fd90fd47a7815dcbe1541db2e60a84] (length: 5)
2025/04/28 14:54:20 Looking for session with ID: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Available sessions: [08ada5a7a6183aae1e09d831df6748d566095a10 f3b17b9ae3981580231caf40ccde53b3b1b204ab dca15e22e9fd90fd47a7815dcbe1541db2e60a84]
2025/04/28 14:54:20 Found session with ID: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Torrent handler called with path: /api/v1/torrent/dca15e22e9fd90fd47a7815dcbe1541db2e60a84/stream/0
2025/04/28 14:54:20 Path parts: [ api v1 torrent dca15e22e9fd90fd47a7815dcbe1541db2e60a84 stream 0] (length: 7)
2025/04/28 14:54:20 Looking for session with ID: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Available sessions: [08ada5a7a6183aae1e09d831df6748d566095a10 f3b17b9ae3981580231caf40ccde53b3b1b204ab dca15e22e9fd90fd47a7815dcbe1541db2e60a84]
2025/04/28 14:54:20 Found session with ID: dca15e22e9fd90fd47a7815dcbe1541db2e60a84
2025/04/28 14:54:20 Streaming file: The.Last.Dance.2024.1080p.DSNP.WEB-DL.DDP5.1.H264-PandaQT.mkv (type: .mkv)
Serving content*
网页界面,如图所示:
最后,需要注意的是,在网页播放的磁力链接,他是会直接保存在程序所在的torrent-data目录里面的.下次再打开就会很快了.
ubuntu@VM-4-7-ubuntu:~/bitplay/torrent-data$ tree
.
├── Sintel
│ ├── Sintel.de.srt
│ ├── Sintel.en.srt
│ ├── Sintel.es.srt
│ ├── Sintel.fr.srt
│ ├── Sintel.it.srt
│ ├── Sintel.mp4
│ ├── Sintel.nl.srt
│ ├── Sintel.pl.srt
│ ├── Sintel.pt.srt
│ ├── Sintel.ru.srt
│ └── poster.jpg
└── 【高清影视之家发布 www.SSDSSE.com】破·地狱[国语音轨+简繁字幕].The.Last.Dance.2024.1080p.DSNP.WEB-DL.DDP5.1.H264-PandaQT
├── The.Last.Dance.2024.1080p.DSNP.WEB-DL.DDP5.1.H264-PandaQT.mkv
├── 【更多无水印蓝光原盘请访问 www.BBQDDQ.com】【更多无水印蓝光原盘请访问 www.BBQDDQ.com】.MP4
├── 【更多无水印蓝光电影请访问 www.BBQDDQ.com】【更多无水印蓝光电影请访问 www.BBQDDQ.com】.DOC
└── 【更多无水印高清电影请访问 www.BBQDDQ.com】【更多无水印高清电影请访问 www.BBQDDQ.com】.MKV
2 directories, 15 files
另外:这个项目也使用了go实现的一个torrent项目:
https://github.com/anacrolix/torrent?tab=readme-ov-file#installation
也是可以直接安装这个工具,直接使用它下载bt文件.
go install github.com/anacrolix/torrent/cmd/...@latest
./torrent download 'magnet:?xt=urn:btih:dca15e22e9fd90fd47a7815dcbe1541db2e60a84'
795ns: getting torrent info for "infohash:dca15e22e9fd90fd47a7815dcbe1541db2e60a84"
本文链接地址:https://const.net.cn/833.html