diff -dc /media/backup/var/www/html/torrentflux/AliasFile.php /var/www/torrentflux/AliasFile.php *** /media/backup/var/www/html/torrentflux/AliasFile.php 2006-03-29 17:31:45.000000000 -0500 --- /var/www/torrentflux/AliasFile.php 2006-09-17 14:24:44.000000000 -0400 *************** *** 39,45 **** var $seedlimit = ""; var $uptotal = ""; var $downtotal = ""; ! var $size = ""; var $errors = array(); function AliasFile( $inFile, $user="" ) --- 39,46 ---- var $seedlimit = ""; var $uptotal = ""; var $downtotal = ""; ! var $size = ""; ! var $category = "Uncategorized"; var $errors = array(); function AliasFile( $inFile, $user="" ) *************** *** 68,77 **** $this->uptotal = trim($arStatus[10]); $this->downtotal = trim($arStatus[11]); $this->size = trim($arStatus[12]); ! if (sizeof($arStatus) > 13) { ! for ($inx = 13; $inx < sizeof($arStatus); $inx++) { array_push($this->errors, $arStatus[$inx]); } --- 69,79 ---- $this->uptotal = trim($arStatus[10]); $this->downtotal = trim($arStatus[11]); $this->size = trim($arStatus[12]); + $this->category = trim($arStatus[13]); ! if (sizeof($arStatus) > 14) { ! for ($inx = 14; $inx < sizeof($arStatus); $inx++) { array_push($this->errors, $arStatus[$inx]); } *************** *** 98,104 **** $this->peers = ""; $this->seedlimit = ""; $this->uptotal = ""; ! $this->downtotal = ""; $this->errors = array(); // Write to file --- 100,107 ---- $this->peers = ""; $this->seedlimit = ""; $this->uptotal = ""; ! $this->downtotal = ""; ! $this->category = "Uncategorized"; $this->errors = array(); // Write to file *************** *** 148,154 **** $output .= $this->seedlimit."\n"; $output .= $this->uptotal."\n"; $output .= $this->downtotal."\n"; ! $output .= $this->size; for ($inx = 0; $inx < sizeof($this->errors); $inx++) { if ($this->errors[$inx] != "") --- 151,158 ---- $output .= $this->seedlimit."\n"; $output .= $this->uptotal."\n"; $output .= $this->downtotal."\n"; ! $output .= $this->size."\n"; ! $output .= $this->category; for ($inx = 0; $inx < sizeof($this->errors); $inx++) { if ($this->errors[$inx] != "") diff -dc /media/backup/var/www/html/torrentflux/functions.php /var/www/torrentflux/functions.php *** /media/backup/var/www/html/torrentflux/functions.php 2006-04-05 00:58:14.000000000 -0400 --- /var/www/torrentflux/functions.php 2006-09-17 14:23:05.000000000 -0400 *************** *** 2082,2098 **** if (checkQManager() == 0) { ! $cmd1 = "cd " . $cfg["path"] . "TFQUSERNAME"; ! ! if (! array_key_exists("pythonCmd",$cfg)) ! { ! insertSetting("pythonCmd","/usr/bin/python"); ! } ! if (! array_key_exists("debugTorrents",$cfg)) ! { ! insertSetting("debugTorrents",false); ! } if (!$cfg["debugTorrents"]) { --- 2082,2098 ---- if (checkQManager() == 0) { ! $cmd1 = "cd " . $cfg["path"] . "TFQUSERNAME"; ! if (! array_key_exists("pythonCmd",$cfg)) ! { ! insertSetting("pythonCmd","/usr/bin/python"); ! } ! ! if (! array_key_exists("debugTorrents",$cfg)) ! { ! insertSetting("debugTorrents",false); ! } if (!$cfg["debugTorrents"]) { *************** *** 2437,2447 **** { if($show_run) { ! $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>"; } else { ! $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."')\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>"; } } else --- 2437,2447 ---- { if($show_run) { ! $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."&category=".$af->category."')\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>"; } else { ! $output .= "<a href=\"#\" onclick=\"StartTorrent('startpop.php?torrent=".urlencode($entry)."&category=".$af->category."')\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>"; } } else *************** *** 2449,2459 **** // Quick Start if($show_run) { ! $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>"; } else { ! $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>"; } } } --- 2449,2459 ---- // Quick Start if($show_run) { ! $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."&category=".$af->category."\"><img src=\"images/run_on.gif\" width=16 height=16 title=\""._RUNTORRENT."\" border=0></a>"; } else { ! $output .= "<a href=\"".$_SERVER['PHP_SELF']."?torrent=".urlencode($entry)."&category=".$af->category."\"><img src=\"images/seed_on.gif\" width=16 height=16 title=\""._SEEDTORRENT."\" border=0></a>"; } } } diff -dc /media/backup/var/www/html/torrentflux/index.php /var/www/torrentflux/index.php *** /media/backup/var/www/html/torrentflux/index.php 2006-05-28 21:43:01.000000000 -0400 --- /var/www/torrentflux/index.php 2006-09-17 14:28:09.000000000 -0400 *************** *** 161,167 **** { $rerequest = $cfg["rerequest_interval"]; } ! $sharekill = getRequestVar('sharekill'); if ($runtime == "True" ) $sharekill = "-1"; --- 161,169 ---- { $rerequest = $cfg["rerequest_interval"]; } ! $sharekill = getRequestVar('sharekill'); ! ! $category = getRequestVar('category'); if ($runtime == "True" ) $sharekill = "-1"; *************** *** 199,209 **** // The following lines of code were suggested by Jody Steele jmlsteele@stfu.ca // This is to help manage user downloads by their user names //if the user's path doesnt exist, create it ! if (!is_dir($cfg["path"]."/".$owner)) { if (is_writable($cfg["path"])) { ! mkdir($cfg["path"]."/".$owner, 0777); } else { --- 201,211 ---- // The following lines of code were suggested by Jody Steele jmlsteele@stfu.ca // This is to help manage user downloads by their user names //if the user's path doesnt exist, create it ! if (!is_dir($cfg["path"]."/".$owner."/".$category)) { if (is_writable($cfg["path"])) { ! mkdir($cfg["path"]."/".$owner."/".$category, 0777); } else { *************** *** 241,247 **** if (usingTornado()) { ! $command = $runtime." ".$sharekill." ".$cfg["torrent_file_path"].$alias.".stat ".$owner." --responsefile '".$cfg["torrent_file_path"].$torrent."' --display_interval 5 --max_download_rate ". $drate ." --max_upload_rate ".$rate." --max_uploads ".$maxuploads." --minport ".$minport." --maxport ".$maxport." --rerequest_interval ".$rerequest." --super_seeder ".$superseeder; if(file_exists($cfg["torrent_file_path"].$alias.".prio")) { $priolist = explode(',',file_get_contents($cfg["torrent_file_path"].$alias.".prio")); --- 243,249 ---- if (usingTornado()) { ! $command = $runtime." ".$sharekill." ".$cfg["torrent_file_path"].$alias.".stat ".$owner." ".$category." --responsefile '".$cfg["torrent_file_path"].$torrent."' --display_interval 5 --max_download_rate ". $drate ." --max_upload_rate ".$rate." --max_uploads ".$maxuploads." --minport ".$minport." --maxport ".$maxport." --rerequest_interval ".$rerequest." --super_seeder ".$superseeder; if(file_exists($cfg["torrent_file_path"].$alias.".prio")) { $priolist = explode(',',file_get_contents($cfg["torrent_file_path"].$alias.".prio")); *************** *** 257,263 **** } else { ! // This flie is being started manually. if (! array_key_exists("pythonCmd", $cfg)) { --- 259,265 ---- } else { ! // This file is being started manually. if (! array_key_exists("pythonCmd", $cfg)) { *************** *** 274,282 **** $pyCmd = $cfg["pythonCmd"] . " -OO"; }else{ $pyCmd = $cfg["pythonCmd"]; ! } ! ! $command = "cd " . $cfg["path"] . $owner . "; HOME=".$cfg["path"]."; export HOME; nohup " . $pyCmd . " " .$cfg["btphpbin"] . " " . $command; } } --- 276,285 ---- $pyCmd = $cfg["pythonCmd"] . " -OO"; }else{ $pyCmd = $cfg["pythonCmd"]; ! } ! ! $command = "cd " . $cfg["path"] . $owner . "/" . $category . "; HOME=".$cfg["path"]."; export HOME; nohup " . $pyCmd . " " .$cfg["btphpbin"] . " " . $command; ! } } *************** *** 299,305 **** } else { ! // The following command starts the torrent running! w00t! $result = exec($command); AuditAction($cfg["constants"]["start_torrent"], $torrent."<br>Die:".$runtime.", Sharekill:".$sharekill.", MaxUploads:".$maxuploads.", DownRate:".$drate.", UploadRate:".$rate.", Ports:".$minport."-".$maxport.", SuperSeed:".$superseeder.", Rerequest Interval:".$rerequest); --- 302,308 ---- } else { ! // The following command starts the torrent running! w00t! $result = exec($command); AuditAction($cfg["constants"]["start_torrent"], $torrent."<br>Die:".$runtime.", Sharekill:".$sharekill.", MaxUploads:".$maxuploads.", DownRate:".$drate.", UploadRate:".$rate.", Ports:".$minport."-".$maxport.", SuperSeed:".$superseeder.", Rerequest Interval:".$rerequest); diff -dc /media/backup/var/www/html/torrentflux/startpop.php /var/www/torrentflux/startpop.php *** /media/backup/var/www/html/torrentflux/startpop.php 2006-03-30 15:35:00.000000000 -0500 --- /var/www/torrentflux/startpop.php 2006-09-17 14:23:50.000000000 -0400 *************** *** 24,32 **** include_once("config.php"); include_once("functions.php"); ! require_once("metaInfo.php"); ! ! $torrent = getRequestVar('torrent'); $displayName = $torrent; if(strlen($displayName) >= 55) --- 24,33 ---- include_once("config.php"); include_once("functions.php"); ! require_once("metaInfo.php"); ! ! $torrent = getRequestVar('torrent'); ! $category = getRequestVar('category'); $displayName = $torrent; if(strlen($displayName) >= 55) *************** *** 226,231 **** --- 227,235 ---- </tr> <tr> <td colspan="4" align="center"><div ID="sharekiller" align="center" style="visibility:hidden;">Keep seeding until Sharing is: <input type="Text" name="sharekill" maxlength="4" size="4" value="<?php echo $cfg["sharekill"]; ?>">%<font class="tiny"> (0% will keep seeding)</font> </div></td> + </tr> + <tr> + <td colspan="4" align="center"><div ID="category" align="center">Category (Show name): <input type="Text" name="category" maxlength="80" size="80" value="<?php echo $category; ?>"> </div></td> </tr> </table> <br> diff -dc /media/backup/var/www/html/torrentflux/startpop.php /var/www/torrentflux/TF_BitTornado/btphptornado.py *** /media/backup/var/www/html/torrentflux/TF_BitTornado/btphptornado.py 2006-03-29 17:56:15.000000000 -0500 --- /var/www/torrentflux/TF_BitTornado/btphptornado.py 2006-09-17 13:53:46.000000000 -0400 *************** *** 20,25 **** --- 20,26 ---- from BitTornado.natpunch import UPnP_test from threading import Event from os.path import abspath + import os.path from os import getpid, remove from sys import argv, stdout import sys *************** *** 81,86 **** --- 82,88 ---- self.seeds = '' self.peers = '' self.errors = [] + self.category = "" self.last_update_time = -1 self.statFile = 'percent.txt' self.autoShutdown = 'False' *************** *** 251,257 **** f.write(self.shareKill + '\n') f.write(str(self.upTotal) + '\n') f.write(str(self.downTotal) + '\n') ! f.write(str(self.size)) try: errs = [] --- 253,260 ---- f.write(self.shareKill + '\n') f.write(str(self.upTotal) + '\n') f.write(str(self.downTotal) + '\n') ! f.write(str(self.size)+'\n') ! f.write(self.category) try: errs = [] *************** *** 331,337 **** return new_errors ! def run(autoDie,shareKill,statusFile,userName,params): if __debug__: traceMsg('run - begin') --- 334,340 ---- return new_errors ! def run(autoDie,shareKill,statusFile,userName,category, params): if __debug__: traceMsg('run - begin') *************** *** 351,356 **** --- 354,360 ---- h.autoShutdown = autoDie h.shareKill = shareKill h.user = userName + h.category = category while 1: try: *************** *** 396,404 **** --- 400,410 ---- dow = BT1Download(h.display, h.finished, h.error, disp_exception, doneflag, config, response, infohash, myid, rawserver, listen_port) + print "here" if not dow.saveAs(h.chooseFile, h.newpath): break + print "there" if not dow.initFiles(old_style = True): break *************** *** 427,433 **** finally: if __debug__: traceMsg('run - removing PID file :'+statusFile+".pid") ! remove(statusFile+".pid") if __debug__: traceMsg('run - end') --- 433,442 ---- finally: if __debug__: traceMsg('run - removing PID file :'+statusFile+".pid") ! try: ! remove(statusFile+".pid") ! except: ! pass if __debug__: traceMsg('run - end') *************** *** 440,446 **** if PROFILER: import profile, pstats p = profile.Profile() ! p.runcall(run, argv[1],argv[2],argv[3],argv[4],argv[5:]) log = open('profile_data.'+strftime('%y%m%d%H%M%S')+'.txt','a') normalstdout = sys.stdout sys.stdout = log --- 449,455 ---- if PROFILER: import profile, pstats p = profile.Profile() ! p.runcall(run, argv[1],argv[2],argv[3],argv[4],argv[5], argv[6:]) log = open('profile_data.'+strftime('%y%m%d%H%M%S')+'.txt','a') normalstdout = sys.stdout sys.stdout = log *************** *** 448,451 **** pstats.Stats(p).strip_dirs().sort_stats('time').print_stats() sys.stdout = normalstdout else: ! run(argv[1],argv[2],argv[3],argv[4],argv[5:]) --- 457,460 ---- pstats.Stats(p).strip_dirs().sort_stats('time').print_stats() sys.stdout = normalstdout else: ! run(argv[1],argv[2],argv[3],argv[4],argv[5],argv[6:])