'Download a torrent with php

I want to download a torrent using php.

So the scenario is that the user uploads a torrent and the server downloads it. Than the user can download the torrent using his browser.



Solution 1:[1]

Dont know if this is the right way for you but:

  • Install rtorrent (https://wiki.archlinux.org/index.php/RTorrent)
  • configure rtorrent to watch a direcory for new torrent-files (http://jkt.im/2011/09/28/automatic-torrent-management-with-rtorrent-and-some-helper-scripts/)
  • rtorrent will download the files and move it into a directory like "done"
  • php script checks the folder vor new content and convert / show the files online in webpage

Solution 2:[2]

All the functionality you need already exist with rTWi http://rtwi.jmk.hu/ and its also open source so all you need is little customization

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 take
Solution 2 Baba