Creating a Torrent

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Robin Hood
Posts: 10
Joined: Mon Jun 06, 2011 6:27 pm

Creating a Torrent

Post by Robin Hood »

Right of the bat I'd like to apologize for my utter lack of skill with all this. I have no understanding of coding, and have some issues doing things on my server.

I'm wondering if there is any way (through the web interface or otherwise) for me to create a .torrent file so I can torrent files I have/put on my server?

Thank you so much!
Robin Hood
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Creating a Torrent

Post by rb07 »

Your second phrase is incomplete:
Robin Hood wrote:to create a .torrent file so I can torrent files I have/put on my server
so you can... what?

Create? You have to use a different tool to create .torrent files, the Web interface doesn't do that... but with the daemon, which is the Web client, comes some console tools: transmission-create, transmission-edit, and transmission-show (also transmission-remote), or you can use one of the applications with GUI that also come with Transmission, depending on the OS you want to use: Transmission-Mac, Transmission-GTK, and Transmission-Qt. The last 2 work in Linux and Windows, the last one works everywhere in fact.

Also you don't put .torrent files on "your" server, unless you own the tracker. Those have to be uploaded to the site which has the tracker, then you download the .torrent file created/modified by the site, and finally you set the location and verify contents before starting to seed. Some trackers are different, openbittorrent doesn't need you to upload the file for instance, you can use your .torrent file.
Robin Hood
Posts: 10
Joined: Mon Jun 06, 2011 6:27 pm

Re: Creating a Torrent

Post by Robin Hood »

I'm saying I have a bunch of files on my server. I'd like to be able to take those files, and create a .torrent containing the information to those files.

That way I can use that .torrent file, and seed from my server instead of from my computer. I'm sorry, I didn't understand much of those last bits (it's me, I'm sure).
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Creating a Torrent

Post by Jordan »

There are a few different ways to create a .torrent file in Transmission. You can do it through the Mac, GTK+, and Qt clients, and also from the command line using the utility "transmission-create".
Robin Hood
Posts: 10
Joined: Mon Jun 06, 2011 6:27 pm

Re: Creating a Torrent

Post by Robin Hood »

I'm sorry, but I'm still not understanding how to do it.

So if I have a bunch of files on my server, where should I put them, and what command should I type into my SSH client (I'm assuming) to get a .torrent file I can then use? Because the web interface doesn't seem to have a way for me to do that.
super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: Creating a Torrent

Post by super-poussin »

create an html page which call this php script with all the info

Code: Select all

<?php
$name = $_POST ['name'];
$var2 = $_POST ['var2'];
$directory = $_POST ['directory'];
$URL = $_POST ['tracker'];
$private = $_POST ['private_torrent'];
$torrentpath="/c/media/BitTorrent/sources/";
$savepath="/c/webroot/transmission/archives/";
$filename=$name.".torrent";
$mode="0777";
$transcreate="/usr/local/bin/transmission-create";
switch ($private)
 {
  case "yes" :
      $last_line=exec("$transcreate  -p -o $savepath$filename -t $URL $directory",$retval=array());
     break;
  case "no" :
  default :
      $last_line=system("$transcreate  -o $savepath$filename -t $URL $directory",$retval=array());
 }
copy( "$savepath$filename","$torrentpath$filename");
echo '<pre>';

 echo '
</pre>
<hr /> Result : '  . $last_line;
#chown("$path$filename","nobody");
chmod ("$torrentpath$filename",0777);
chmod ("$savepath$filename",0777);
#exec("chown nobody:nogroup $path$filename");
#exec("/c/webroot/transmission/modify.sh");
echo '<pre>';
 echo '
</pre>';
?>

super-poussin
Posts: 74
Joined: Sun Mar 15, 2009 8:04 pm

Re: Creating a Torrent

Post by super-poussin »

html page can look like this :

Code: Select all

<html>
<header>
<center>
<bold>
Released by Super-Poussin
</bold>
</center>
</header>
<body  background="fond.jpg">
 <table border="0" width="100%" align="left" height="80%" cellpadding="0" cellspacing="0">
  <tbody>
   <tr>
    <td valign="middle">

      <table border="0" width="45%" align="left" height="100%">
      <tbody>
       <tr>
        <td align="center" height="100%" cellpadding="0" cellspacing="0" valign="middle"><img src="SuperPoussin.png"></td>
       </tr>
      </tbody>
     </table>

<form id="form1" name="form1" method=post  action="transmission.php">

<p><kbd><strong>Torrent Name: </strong></kbd></p>

<p>

<label>

<input type="text" name="name" id="textfield1" value="Mytorrent"/>

</label>

</p>


<p><kbd><strong>Directory or File : </strong></kbd></p>

<p>

<label>

<input type="text" name="directory" id="textfield3" value="/c/"/>

</label>

</p>

<p><kbd><strong>Tracker URL: </strong></kbd></p>

<p>
<label>
<input type="text" name="tracker" id="textfield4" value="http://"/>

</label>

</p>
Private Torrent:<br />
<select name="private_torrent">
<option value="choose" selected="selected">Choose an option
<option value="yes">yes
<option value="no">no
</select>
<p> </p>
<input type="submit" name="button" value="Create Torrent"/>

<p>

 </label>

<p> </p>

</form>
</body>
<footer>
<br>It coudld be long, be patient ! <br/>
Files are saved in /c/webroot/transmission/archives  and put in /c/media/BitTorrent/sources/  for immediate seeding
</footer>
</html>

bobsbarricades
Posts: 4
Joined: Sun Aug 07, 2011 12:18 am

Re: Creating a Torrent

Post by bobsbarricades »

I am in the same boat as the OP, and the answers are quite confusing to me.

I read it's real simple to do in uTorrent...but I'm in OS X. Things should be easier! =)

I have my files on my server. I have a link that if you go to, will download a .zip. How do I tell transmission, when creating a torrent, to go to THIS file. not one on my local computer?

thanks for any clarification on the matter guys.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Creating a Torrent

Post by rb07 »

Creating a torrent is independent of where you actually upload/download.

The points on this thread that should be clear:
  • The Web client does not have the functionality to create torrent files.
  • There are GUI and CLI options within the Transmission project "products" that do have the functionality.
  • Choose whatever best suits you. This probably depends on where you want to work.
If you want to work on your Mac, you can use the Mac application, no need to download or upload with it, just use the create torrent function and then do whatever is needed to make your real transmission server use it.

I said "whatever is needed" because the procedure changes depending on what you are doing. If you are independently seeding, then just load the .torrent file. If you are seeding on a private tracker, then follow their instructions (usually you upload your .torrent file to them, they modify it, you download it back, verify content, and start seeding).
bobsbarricades wrote:How do I tell transmission, when creating a torrent, to go to THIS file. not one on my local computer?
Paths are relative to the location you set, or the default location. That means the answer is don't worry about local/remote. Also if you can verify the content, that means you have the paths right.
Last edited by rb07 on Sun Aug 07, 2011 11:54 pm, edited 1 time in total.
bobsbarricades
Posts: 4
Joined: Sun Aug 07, 2011 12:18 am

Re: Creating a Torrent

Post by bobsbarricades »

Paths are relative to the location you set, or the default location. That means the answer is don't worry about local/remote. Also if you can verify the content, that means you have the paths right.
this confuses me because I HAVE to select something on my computer when making the .torrent. Do you mean I can download the file from the web that I'm hosting, then select that, then just upload the torrent and it will automatically understand the URL of the file the .torrent is downloading from?

<----very dense
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Creating a Torrent

Post by rb07 »

bobsbarricades wrote:I HAVE to select something on my computer when making the .torrent
Yes, you select either a file or a directory.

The item you select just has to be visible on your computer, doesn't have to be strictly on your computer, could be something you have access using NFS or CIFS -- yeah, I know, one more variable to make things even more confusing.
bobsbarricades wrote:I can download the file from the web that I'm hosting, then select that, then just upload the torrent
Yes that works, but its different from what you said before.
bobsbarricades
Posts: 4
Joined: Sun Aug 07, 2011 12:18 am

Re: Creating a Torrent

Post by bobsbarricades »

OK - so I have the .zip on my server and on my desktop.

I make the .torrent using the .zip on my desktop.

I upload the .torrent to the same place as my .zip on my server.

I can download the torrent fine..it lists the two trackers in the details...but it's not downloading anything. How does it know to download from the file that's on my server?
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Creating a Torrent

Post by rb07 »

bobsbarricades wrote:I upload the .torrent to the same place as my .zip on my server.
No, where did you get that idea?

You use Transmission's Web client to load the .torrent file, don't start it yet, select it and look in the inspector, where does it say its the "Download dir:"?

If it doesn't show the correct directory, where you actually have the file, then you'll have to move the file or make the .torrent again (the Web client doesn't have the option to set the location, if you where using Transmission-Qt you would be able to just change the location);

If the directory is the correct one, then in the context menu (right mouse button everywhere except on Mac, which doesn't have buttons) choose verify... after it finishes verifying it will show 100% available and you can start seeding.
bobsbarricades
Posts: 4
Joined: Sun Aug 07, 2011 12:18 am

Re: Creating a Torrent

Post by bobsbarricades »

rb07 wrote:
bobsbarricades wrote:I upload the .torrent to the same place as my .zip on my server.
No, where did you get that idea?

You use Transmission's Web client to load the .torrent file, don't start it yet, select it and look in the inspector, where does it say its the "Download dir:"?

If it doesn't show the correct directory, where you actually have the file, then you'll have to move the file or make the .torrent again (the Web client doesn't have the option to set the location, if you where using Transmission-Qt you would be able to just change the location);

If the directory is the correct one, then in the context menu (right mouse button everywhere except on Mac, which doesn't have buttons) choose verify... after it finishes verifying it will show 100% available and you can start seeding.
But how do I set the directory to the URL where the file is hosted?!?!? You guys are speaking this totally different language and it doesn't make any sense to me! Ok. Web Client. Looked into that (but then you said it doesn't allow me to change the location...Transmission-QT wil...wait that's for windows?)

Do you see why none of this makes ANY sense to me? The directory will NEVER be the correct one because my only option is to select files ON MY COMPUTER! I realize this is all really basic for your guys but it's not like there are any FAQ's for me to read that cover this.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Creating a Torrent

Post by rb07 »

bobsbarricades wrote:Transmission-QT wil...wait that's for windows?
No, Transmission-Qt runs everywhere (Windows, Mac OS X, Linux, ... )
bobsbarricades wrote:Do you see why none of this makes ANY sense to me?
Yes, I see that you didn't understand what "relative path" means. And on top of that you have other terms mixed:
bobsbarricades wrote:how do I set the directory to the URL where the file is hosted?
What URL? This makes no sense. The directory (which I call path) is not part of any URL; the only URL you use while "Creating a Torrent" is the tracker URL, and that one has nothing to do with the path.

Let's start from the beginning, how do I create a new .torrent file:
  1. Choose the tool I'll be using: transmission-create (a console tool);
  2. See what options do I have:

    Code: Select all

    $ transmission-create -h
    Usage: transmission-create [options] <file|directory>
    
    Options:
     -h --help              Display this help page and exit
     -p --private           Allow this torrent to only be used with the specified
                            tracker(s)
     -o --outfile <file>    Save the generated .torrent to this filename
     -c --comment <comment> Add a comment
     -t --tracker <url>     Add a tracker's announce URL
     -V --version           Show version number and exit
  3. Create the .torrent:

    Code: Select all

    $ transmission-create --private --comment "Just an example" --tracker "udp://tracker.example.com:80/" --outfile example.torrent Something.mp4 
    Creating torrent "example.torrent" ........................................................... done!
  4. Check the result:

    Code: Select all

    $ transmission-show example.torrent 
    Name: Something.mp4
    File: example.torrent
    
    GENERAL
    
      Name: Something.mp4
      Hash: 70390...
      Created by: Transmission/2.33 (12565)
      Created on: Wed Aug 10 12:01:20 2011
      Comment: Just an example
      Piece Count: 1099
      Piece Size: 1.00 MiB
      Total Size: 1.07 GiB
      Privacy: Private torrent
    
    TRACKERS
    
      Tier #1
      udp://tracker.example.com:80/
    
    FILES
    
      Something.mp4 (1.07 GiB)
    
In point 3, the file name could have been given using the full path, say /external/videos/documentaries/Something.mp4; that path is not recorded in the .torrent, just the file name. Same goes if the contents is a directory, the full path is not recorded, just the directory. When you use the .torrent file the file/directory name becomes relative, you'll see how below.

The tracker I used works w/o having to register the torrent with them, the original .torrent file can be used with no other steps involved (you still have to make that .torrent file or the equivalent magnet link available to your peers so they can download).

Then I upload the .torrent file to my server, say (continuing to use terminal tools):

Code: Select all

$ transmission-remote --add example.torrent
The server will look at its "download" directory, as in:

Code: Select all

$ transmission-remote hpmediavault -n user:password -si     
VERSION
  Daemon version: 2.33 (12565)
  RPC version: 13
  RPC minimum version: 1

CONFIG
  Configuration directory: /opt/var/transmission/config
  Download directory: /opt/var/transmission/downloads      <--------------
  Download directory free space: 496.3 GiB
  Listenport: 2310
  Portforwarding enabled: No
  uTP enabled: Yes
  Distributed hash table enabled: Yes
  Local peer discovery enabled: No
  Peer exchange allowed: No
  Encryption: preferred
  Maximum memory cache size: 12.00 MiB

LIMITS
  Peer limit: 600
  Default seed ratio limit: 1.50
  Upload speed limit: 195 KiB/s  (Enabled limit: 195 KiB/s; Disabled turtle limit: 100 KiB/s)
  Download speed limit: Unlimited  (Disabled limit: 1.00 MiB/s; Disabled turtle limit: 1.00 MiB/s)

MISC
  Autostart added torrents: Yes
  Delete automatically added torrents: Yes
If it finds the contents, then verifies that it is the same file (the .torrent file contains 'checksums' for every piece), and starts seeding. If it doesn't find it, then tries to download unless I also specified to start paused (--start-paused).

Now if I wanted to use a different location on the server instead of its default download directory:
  • The sample.torrent file is the same;
  • The location can be changed when I load the .torrent:

    Code: Select all

    $ transmission-remote --download-dir /usbdrive/seeds/documentaries --add example.torrent
  • Or it can be changed "after the fact". Transmission-remote has parameter --move, Transmission-Qt has "Set location...", and so forth.
Post Reply