Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

73 lines (62 sloc) 2.52 kb
import com.chocolatey.pmsencoder.command.MPlayer
This protocol uses MPlayer as the downloader.
Only the following Navi-X output fields are supported:
url // required: media URL
agent // optional: HTTP user-agent
referer // optional: HTTP referrer
player // optional: currently ignored
Although most fields are optional, there is no point using this protocol unless
at least one optional field is supplied.
boolean values (none currently) can be set without a value e.g. navix://channel?url=http%3A//
values *must* be URL-encoded
keys are just alphanumeric, so don't need to be
init {
profile ('navix://') {
pattern {
protocol 'navix'
action {
def mplayerArgs = []
def pairs = http.getNameValuePairs(uri) // uses URLDecoder.decode to decode the name and value
def seenURL = false
for (pair in pairs) {
def name =
def value = pair.value
switch (name) {
case 'url':
if (value) {
// quote handling is built in for the URI
uri = value
seenURL = true
case 'referer':
if (value)
mplayerArgs << '-referrer' << quoteURI(value) // requires a recent (>= June 2010) mplayer
case 'agent':
if (value)
mplayerArgs << '-user-agent' << quoteURI(value)
case 'player':
if (value)"player option for navix:// protocol currently ignored: ${value}")
logger.warn("unsupported navix:// option: ${name}=${value}")
if (seenURL) {
downloader = new MPlayer()
args (downloader.args) {
} else {
logger.error("invalid navix:// URI: no url parameter supplied: ${uri}")
Jump to Line
Something went wrong with that request. Please try again.