'Add a file or directory to this torrent definition. When adding a
directory, all files in that directory will be added to the torrent.
One can add multiple files and directories to a torrent definition.
In that case the "outpath" parameter must be used to indicate how
the files/dirs should be named in the torrent. The outpaths used must
start with a common prefix which will become the "name" field of the
torrent.
To seed the torrent via the core (as opposed to e.g. HTTP) you will
need to start the download with the dest_dir set to the top-level
directory containing the files and directories to seed. For example,
a file "c:\Videosile.avi" is seeded as follows:
<pre>
tdef = TorrentDef()
tdef.add_content("c:\Videosile.avi",playtime="1:59:20")
tdef.set_tracker(s.get_internal_tracker_url())
tdef.finalize()
dscfg = DownloadStartupConfig()
dscfg.set_dest_dir("c:\Video")
s.start_download(tdef,dscfg)
</pre>
@param inpath Absolute name of file or directory on local filesystem,
as Unicode string.
@param outpath (optional) Name of the content to use in the torrent def
as Unicode string.
@param playtime (optional) String representing the duration of the
multimedia file when played, in [hh:]mm:ss format.'

def add_content(self, inpath, outpath=None, playtime=None):

    s = os.stat(inpath)
    d = {'inpath': inpath, 'outpath': outpath, 'playtime': playtime, 'length': s.st_size}
    self.input['files'].append(d)
    self.metainfo_valid = False
