What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Mar 22, 2008 by pkretek
Labels: Featured
Torrential  

Introduction

Torrential, Web-interface for enhanced-ctorrent and possibly other command line torrent clients. It's designed to run on embedded systems with appweb such as the NSLU2, but can be potentially installed on any system with php and enhanced-ctorrent (tested with version dnh3.1-9 only). Please leave a comment if you tried it on any other system. I am still working on GPLing the code, so be patient. I am using the config script and some ideas from a early version of Kai-T's torrent interface, however it's a complete rewrite except for the configuration read/write script.

Screenshot

Installation

Quick Installation HowTo on NSLU2 with Unslung 6.8:

ipkg update
ipkg install enhanced-ctorrent
ipkg install appweb
/opt/etc/init.d/S81appweb restartcd /opt/var/appWeb/web/
#get the latest link from this site and download it, example:
curl -O http://oz4projects.googlecode.com/files/torrentialxxxxxxx.zip
unzip torrential.zip
chown -R nobody.everyone torrential/
mkdir /public/torrent/
chmod 777 /public/torrent/
vi inc_config.php 	#(have a look inside)
# visit: http://nslu-ip:7777/torrential/index.php
# user: giveme	pass: torrent
# click on Help.

History


Comment by Alezzandro, Feb 21, 2008

Hi, great job! It works very well on my nslu2 device, but I've experienced some problems using it with lighttpd + php. it Seems to refuse to analyze (maybe some limitations of php) enhanced-ctorrent BIG .stat files, as I can see, enhanced-ctorrent doesn't overwrite the "log"(.stat) file but simply adds new lines to it, increasing the filesize, the result on my webserver is that the dyn_progress.php refuses to load the $(torrent_file).stat, maybe the file is too big (when I've experienced this problem the log file is about 11MB). dyn_stopped.php has the same problem. I found a symply workaround that you can add to your project if you want, simply add this few lines to dyn_progress.php: (it makes on every dyn_progress.php loading a "tail" of current $(torrent_file).stat overwriting every old "tail" maked, with this workaround the filesize will not execeed few KB, so dyn_progress.php/dyn_stopped.php is able to load it)

if( isRunning(substr($file,0,strlen($file)-4)) ){^M
    $filenames=array();
    $filenames[] = substr( $file,0,strlen($file)-3 );
    foreach ($filenames as $val){
      $cmdtail="/usr/bin/tail ". $download_path . $val . "stat > ". $download_path . $val ."stat.tail";
      exec($cmdtail);
    }
    $stats[] = substr( $file,0,strlen($file)-3 ) ."stat.tail";
}

and this line to dyn_stopped.php :

if (substr(strtolower($file), -4)=="stat.tail")

Hope this solution can help someone,

Bye,

Alessandro Arrichiello <alezzandro@gmail.com>.

Comment by Alezzandro, Feb 21, 2008

Who want can download directly patched files (dyn_progress.php and dyn_stopped.php) from here: http://www.alexworld.it/files/torrential-fixedfiles.tar

bye,

Alessandro Arrichiello <alezzandro@gmail.com>.

Comment by Alezzandro, Feb 21, 2008

I've also experienced that on slow device like my 'nslu2' after many hours seeding/downloading with enhanced-ctorrent when the log-file reaches very big size (about 1gb), the 'tail' of the .stat file begin very difficult, so I've thinked another possible workaround completely resetting the .stat file only when .stat file has excedeed a size of 50MB (you can edit it as you want). This will overwrite with no data the current .stat file and will print the current stats for the torrent file.

if( isRunning(substr($file,0,strlen($file)-4)) ){
$filenames=array();
$filenames[] = substr( $file,0,strlen($file)-3 );
foreach ($filenames as $val){
$fsize=exec("ls -s ".$download_path.$val."stat");
$fsize=explode(" ",$fsize);
if ($fsize[0]>52428800){
exec("echo >".$download_path.$val."stat");
sleep(8); // give time to ctorrent to re-populate .stat file
}
$cmdtail="/usr/bin/tail ". $download_path . $val . "stat > ". $download_path . $val ."stat.tail";
exec($cmdtail);
}
$stats[] = substr( $file,0,strlen($file)-3 ) ."stat.tail";
}

the above download link for tar-file is upgraded with new patches, if you don't want them, simply comment them out! :-)

Byebye,

Alessandro Arrichiello <alezzandro@gmail.com>.

Comment by ripperoso, Apr 26, 2008

I find that torrential is very slow...it's a problem of mine?

Comment by tsoupap, May 25, 2008

I use the server on a moded Maxtor Shared Storage II. It runs fine apart from the fact that once the .stat files get really big (after a few minutes) it slows down considerably apart from the space problem. The clearing facility in the script that deletes the .stat files after they get bigger than some MBs doesn't work, and not even external cron scripts do, since the Torrential scripts open the .stat files in create mode. I changed the create operator ">" to append ">>" in inc_functions.php and now both the internal as well as external clearing scripts ( echo > ${statfile}) work.


Sign in to add a comment