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*

网页界面,如图所示:
截图 2025-04-28 14-55-31.png

最后,需要注意的是,在网页播放的磁力链接,他是会直接保存在程序所在的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/magnet2torrent.html

推荐btdig

https://btdig.com/1dc4a06523665befdd9dc1819249175d5bafb315

magnet to torrent:

http://magnet2torrent.com/

torrent host site:

https://torrage.info/
访问方法:
https://torrage.info/torrent.php?h=640FE84C613C17F663551D218689A64E8AEBEABE
https://itorrents.org/
访问方法:
https://itorrents.org/torrent/B415C913643E5FF49FE37D304BBB5E6E11AD5101.torrent
https://btcache.me/
访问方法:
https://btcache.me/torrent/640FE84C613C17F663551D218689A64E8AEBEABE

经过测试与验证,先说结论,不需要LANMAN1就可以支持ntlm 0.12了.只需要NT1就可以支持ntlm 0.12了.

问题来源于小米盒子不能访问树莓派的smb服务,但是能访问打开了smbv1的windows共享服务.

修改后的树莓派的smb.conf配置如下:

[global]
client min protocol NT1
server min protocol NT1

使用testparam验证过,也没提示说配置有问题.

testparm 
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

在小米盒子高清播放器里面访问树莓派时,提示不能连接,在树莓派里抓包

sudo tcpdump -i eth0 port 445 -w smb.pcap

结果如图所示:
Dialect: NT LM 0.12
Selected Index: -1, server does not support any of the listed dialects
截图 2025-05-15 10-01-40.png
截图 2025-05-15 10-04-08.png

感觉是不支持这个的意思了.

哪就用smbclient来验证一下了.

在树莓派上面安装smbclient工具

sudo apt install smbclient cifs-utils

smbclient -L 192.168.31.6 -m LANMAN1

lp_load_ex: Max protocol LANMAN1 is less than min protocol NT1.
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX

smbclient -L 192.168.31.6 -m NT1

Enter WORKGROUPpi's password:

提示下面的输入密码就是正确的了.

如果是提示下面这样的,就说明samba的服务器server min protocol不匹配

smbclient -L 192.168.31.6 -m NT1

smbXcli_negprot_smb1_done: No compatible protocol selected by server.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE

正确的树莓派server min 配置如下:

[global]
client min protocol = NT1
server min protocol = NT1

修改参数的后重启

sudo systemctl restart smbd.service

当smbclient访问的时候,抓个包看看.

Dialect有NT LANMAN 1.0和NT LM 0.12了
截图 2025-05-15 10-13-03.png

连接成功的效果图
截图 2025-05-15 10-14-05.png

另外,要查看SMB本身支持哪些protocol

地址在这儿:https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#CLIENTMAXPROTOCOL

Possible values are :

CORE: Earliest version. No concept of user names.

COREPLUS: Slight improvements on CORE for efficiency.

LANMAN1: First modern version of the protocol. Long filename support.

LANMAN2: Updates to Lanman1 protocol.

NT1: Current up to date version of the protocol. Used by Windows NT. Known as CIFS.

SMB2: Re-implementation of the SMB protocol. Used by Windows Vista and later versions of Windows. SMB2 has sub protocols available.

SMB2_02: The earliest SMB2 version.

SMB2_10: Windows 7 SMB2 version.

By default SMB2 selects the SMB2_10 variant.

SMB3: The same as SMB2. Used by Windows 8. SMB3 has sub protocols available.

SMB3_00: Windows 8 SMB3 version.

SMB3_02: Windows 8.1 SMB3 version.

SMB3_11: Windows 10 SMB3 version.

By default SMB3 selects the SMB3_11 variant.

引用:
https://unix.stackexchange.com/questions/458203/available-min-max-values-for-smb-protocol
https://discussion.fedoraproject.org/t/samba-broken/82614/4
https://docs.redhat.com/zh-cn/documentation/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/assembly_using-the-smbclient-utility-to-access-an-smb-share_assembly_using-samba-as-a-server#proc_using-smbclient-in-interactive-mode_assembly_using-the-smbclient-utility-to-access-an-smb-share
https://blog.csdn.net/smstong/article/details/4977976