bittorrent2player

NAME
DESCRIPTION
OPTIONS
EXAMPLES
AUTHOR

NAME

bittorrent2player - transfers data from the BitTorrent network to another protocol (currently HTTP) which is more suitable for media players

DESCRIPTION

*

Server - this program. Server consists of 2 parts: a BitTorrent client and a HTTP server.

*

Client - a program which reads data from the HTTP part of Server. Typically Client is a media (video, audio) player.

*

Peer - a computer in the network which sends data to the BitTorrent part of Server.

*

piece_size - Data in a torrent are divided into parts, called "pieces", each part is of size "piece_size". This is a property of the BitTorrent protocol. To learn how to determine this parameter, search "parameters of the torrent" in this document.

*

media_speed - speed (bitrate) of all streams (video, audio) which Client reads. E.g., if you play a "mkv" file with streams "video 2 Mb/s, audio 0.2 Mb/s" and external audio in a "mp3" file "audio 0.4 Mb/s", then media_speed=2+0.2+0.4.

Server can manage only 1 torrent. Server lists files and some parameters of the torrent on the HTML page accessible via HTTP at "/". That page also shows hyperlinks to the files of the torrent.

You probably need to adjust the connection timeout of your Client. Read the explanation of the option --piece-par. E.g., change the connection timeout in "mplayer" with the patch http://www.beroal.in.ua/prg/bittorrent2player/mplayer-big-timeout.patch .

"bt2p" is the official abbreviation of the name of this program.

OPTIONS

--hash-file and --save-path are mandatory. See default values of options in the source code, the file "main.py", search "configuration" there.
--save-path=$X

Save downloaded data to the directory X. If X contains a partially downloaded file, Server will catch it like a usual BitTorrent client.

BitTorrent parameters
--hash-file=$X

Download the torrent which is described by the file X. X normally has the extension "torrent".

--piece-par=$X

Server downloads X pieces in parallel. Bigger X leads to:

*

Server’s download speed becomes closer to internet connection speed.

*

Server’s delay becomes bigger. The delay is the time between Client requesting data and Server sending those data. The delay roughly is piece_par*piece_size/media_speed after starting playing media or rewinding and piece_size/media_speed otherwise. Adjust the connection timeout of Client accordingly.

*

Server downloads more data which are not requested by Client.

If you want to obtain a precise description of Server’s download behavior, read the source code of Server or ask me.

You can change this option during Server operation by sending to Server’s HTTP part a "GET" request "/?piece_par=$PIECE_PAR".
--resume=$X

Server reads/writes so called "resume data" of a torrent from/to the file X. This allows faster start of dowloading. Read about "resume data" on http://www.rasterbar.com/products/libtorrent/manual.html#save-resume-data .

HTTP parameters
--domain-name=$X
--port=$X

Default: 17580.

Logging
Either option below enables logging.

--log

Parameters of logging are in the file "/etc/bittorrent2player/logging.conf".

--log-conf=$X

Parameters of logging are in the file X. How to write parameters of logging is described in the Python manual at http://docs.python.org/library/logging.html , see also an example on http://docs.python.org/howto/logging.html#configuring-logging .

EXAMPLES

bittorrent2player --hash-file=/tmp/movie.torrent --save-path=/tmp

mplayer -cache 4096 -cache-min 40 http://127.0.0.1:17580/movie.avi

AUTHOR

This manual page was written by Roman Beslik <rabeslik@gmail.com>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Lesser General Public License, version 2.1 or any later version published by the Free Software Foundation