I want to download the torrent file contents ( example : blabla.mp3 ) directly to my website using PHP ( not to my computer ) .
我想使用PHP(而不是我的电脑)将torrent文件内容(例如:blabla.mp3)直接下载到我的网站。
For example: http://put.io/
例如:http://put.io/
2 个解决方案
#1
1
If you have the right to do it (you have ssh access)
如果你有权这样做(你有ssh访问权限)
install a bittorrent client
安装一个bittorrent客户端
http://www.cyberciti.biz/tips/linux-command-line-bittorrent-client.html
then make a php script in which you call
然后制作一个你打电话的PHP脚本
exec("/path/to/bittorrent/client/bin/bittorrent-curses 'http:://www.torrentsite.org/file.torrent'");
This will start the download.
这将开始下载。
This is an example you have to "study" a bit to let this working well. And, as I said before, you need ssh access to your webserver and the possibility to install new stuff, moreover I'm not really sure about this kind of connection are forbidden or not to a shared/unmanaged web server.
这是一个例子,你必须“学习”一点,让这个运作良好。而且,正如我之前所说,你需要ssh访问你的网络服务器和安装新东西的可能性,而且我不确定这种连接是否被禁止或不被共享/非托管的Web服务器。
The best think is to have your local webserver online, so you can install whatever you want and do whatever you want. But in this case what suggested Matt Williamson is what you are searching for..
最好的想法是让您的本地网络服务器在线,这样您就可以安装任何您想要的东西并做任何您想做的事情。但在这种情况下,建议马特威廉姆森是你正在寻找的...
#2
0
To do what you would like you would need to implement a bittorrent client in php which afaik does not yet exist. The bittorrent protocol isn't the most intuitive either and I really wouldnt recommend attacking it without a good prior understanding of it. On the other hand something very close to your goal:
要做你想做的事,你需要在php中实现一个bittorrent客户端,而afaik还不存在。 bittorrent协议也不是最直观的,我真的不建议在没有事先了解它的情况下攻击它。另一方面,与您的目标非常接近:
- you can either use a CLI client from your webserver ( rTorrent for example ) and have it run in the background / detached session ( gnu/screen or nohup )
- you could use a client that comes with a web interface and simply control you torrents from the webui ( for example Deluge http://en.wikipedia.org/wiki/Deluge_%28software%29 )
您可以使用来自Web服务器的CLI客户端(例如rTorrent)并让它在后台/分离会话中运行(gnu / screen或nohup)
你可以使用一个带有web界面的客户端,只需控制你从webui的种子(例如Deluge http://en.wikipedia.org/wiki/Deluge_%28software%29)
Cheers
#1
1
If you have the right to do it (you have ssh access)
如果你有权这样做(你有ssh访问权限)
install a bittorrent client
安装一个bittorrent客户端
http://www.cyberciti.biz/tips/linux-command-line-bittorrent-client.html
then make a php script in which you call
然后制作一个你打电话的PHP脚本
exec("/path/to/bittorrent/client/bin/bittorrent-curses 'http:://www.torrentsite.org/file.torrent'");
This will start the download.
这将开始下载。
This is an example you have to "study" a bit to let this working well. And, as I said before, you need ssh access to your webserver and the possibility to install new stuff, moreover I'm not really sure about this kind of connection are forbidden or not to a shared/unmanaged web server.
这是一个例子,你必须“学习”一点,让这个运作良好。而且,正如我之前所说,你需要ssh访问你的网络服务器和安装新东西的可能性,而且我不确定这种连接是否被禁止或不被共享/非托管的Web服务器。
The best think is to have your local webserver online, so you can install whatever you want and do whatever you want. But in this case what suggested Matt Williamson is what you are searching for..
最好的想法是让您的本地网络服务器在线,这样您就可以安装任何您想要的东西并做任何您想做的事情。但在这种情况下,建议马特威廉姆森是你正在寻找的...
#2
0
To do what you would like you would need to implement a bittorrent client in php which afaik does not yet exist. The bittorrent protocol isn't the most intuitive either and I really wouldnt recommend attacking it without a good prior understanding of it. On the other hand something very close to your goal:
要做你想做的事,你需要在php中实现一个bittorrent客户端,而afaik还不存在。 bittorrent协议也不是最直观的,我真的不建议在没有事先了解它的情况下攻击它。另一方面,与您的目标非常接近:
- you can either use a CLI client from your webserver ( rTorrent for example ) and have it run in the background / detached session ( gnu/screen or nohup )
- you could use a client that comes with a web interface and simply control you torrents from the webui ( for example Deluge http://en.wikipedia.org/wiki/Deluge_%28software%29 )
您可以使用来自Web服务器的CLI客户端(例如rTorrent)并让它在后台/分离会话中运行(gnu / screen或nohup)
你可以使用一个带有web界面的客户端,只需控制你从webui的种子(例如Deluge http://en.wikipedia.org/wiki/Deluge_%28software%29)
Cheers