This is a fork of rutorrent-stream-plugin to add a couple of features viz.
- Better streaming support for Apache
- Stream In-Browser
- Directly open the file in VLC.
-
Properly configured RuTorrent
-
mod_xsendfile
apache module installed and enabled.
For Ubuntu 12.04,mod_xsendfile
can be installed with:sudo apt-get install libapache2-mod-xsendfile sudo a2enmod xsendfile
-
Copy the
stream
directory toplugins/
directory of RuTorrent installation. -
Whitelist your download location(s) for
XSendFile
by adding the following lines toapache.conf
ORhttpd.conf
file:XSendFilePath /path/to/download/location1 XSendFilePath /path/to/download/location2
For Ubuntu 12.04, you would need to edit the
/etc/apache2/apache2.conf
file.
This will get the In-Browser stream working.
This requires the in-browser stream to be working.
Initially, the plugin generates the following URI:
vlc://http://localhost/rutorrent/stream.php?f=%2fmedia%2fVideo.mp4
Let's break it down:
vlc://
: Your own custom protocol handler. Mind you, VLC DOES NOT understand it by default. It can be anything, as long as you make the necessary changes in the following steps.http://
: The actual protocol on which the file will be served../stream.php
: The path on the webserver leading tostream.php
. This file actually streams the data to the client.f=%2fmedia..
: The absolute location of the download file. In this case it's/media/Video.mp4
being passed as a GET value forf
.
When the browser tries to open this URL, it doesn't understand how vlc://
protocol is to be handled and relies on xdg-open
to deal with it.
So, all we need to do is
- implement a handler which strips the leading
vlc://
- passes the stripped string to VLC as a command-line argument.
- Register this handler with
xdg-open
usingxdg-mime
.
The following steps are for Ubuntu 12.04. Should work on all the latest Ubuntu versions.
-
Copy
resources/vlcstream
to any location in$PATH
. Make sure it's exeutable. -
Copy
resources/vlc-stream.desktop
to~/.local/share/applications/
-
Execute:
xdg-mime default vlc-stream.desktop x-scheme-handler/vlc
##Copyright and License
Released under MIT License.
Copyright : 2013 Jitesh Kamble