开发者

How to download Torrent file contents into a sever using PHP? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

Is there any way to download Torrents from the Linux command line and invoke such a program from a PHP process? What a program do you suggest and what is the proper PHP code to start the download, fetch the progress, and terminate the download pr开发者_如何学Googress?

An example of a service which converts Torrents files into direct download links: http://put.io/


If you have the right to do it (you have ssh access)

install a bittorrent client

http://www.cyberciti.biz/tips/linux-command-line-bittorrent-client.html

then make a php script in which you call

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.

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..


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:

  • 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 )

Cheers

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜