Page 1 of 1

Calling mplayer from flashgot - params problem

Posted: Sat Apr 25, 2009 9:13 pm
by ticket
I want to use flashgot to start up mplayer.
Ideally I would like place "[URL]" in flashgot's download manager command line arguments template, so mplayer gets called like this:

Code: Select all

mplayer "[URL]"
The quotes are needed to stop the bash shell from interpreting the URL string.
(for some reason bash breaks the string at every '&' character in the URL, and youtube URLs have a lot of '&' in them).
Unfortunately flashgot prevents the user typing in quotes, so a shell script is needed to do the job.
But if I try:

Code: Select all

#!/bin/bash
mplayer "$1"
bash still breaks up the string [URL] being passed to mplayer. What is the right way to do this?

Given the solution to the above, there is still some work to do - the URL contains a comment string near its end, beginning with '#'. The # and all what follows it needs to be stripped off, otherwise mplayer complains. Something like sed ought to be able to do this.

Re: Calling mplayer from flashgot - params problem

Posted: Sat Apr 25, 2009 9:43 pm
by therube

Re: Calling mplayer from flashgot - params problem

Posted: Sun Apr 26, 2009 2:08 pm
by ticket
Thanks theRube, (you rock!), the advice in that link worked fine, ie.

Code: Select all

 toggle the Preference item, [b]flashgot.media.guessName[/b] (to false)
I can now fire up mplayer this way:

Code: Select all

mplayer  [URL]
no need for quotes!

Two questions remain:

(1) Is there a reason why the setting of flashgot.media.guessName isn't set to false by default?

(2) Back to the original problem of firing up a script to run mplayer - how to get the [URL] not be broken by bash?
(but I appreciate this last question is more a linux command thing than a flashgot thing).

Re: Calling mplayer from flashgot - params problem

Posted: Sun Apr 26, 2009 2:16 pm
by therube
1) i suppose cause its "prettier" to get a file named "Guru Josh Project - Infinity 2008.flv" rather then "video.flv". and it works for most, most of the time.

Re: Calling mplayer from flashgot - params problem

Posted: Sun Apr 26, 2009 6:12 pm
by ticket
Well, having 'guess name' true or false fails on this site when calling mplayer:

http://www.youtube.com/watch?v=4jTA42vYijs

when 'guess' is false (the setting that normally works), mplayer complains with :

LAF_header: AV_find_stream_info() failed

I am not sure if this is because of the URL it gets or if the stream that is found is an old flv format it can't render.
Curiously, if I enable greasemonkey with a script that finds the mp4 source in the web page, then flashgot provides two URLs, the second being the mp4 feed and mplayer is happy with the mp4 feed.

Is there a fix for flashgot to detect the mp4 stream on this sort of site?

Re: Calling mplayer from flashgot - params problem

Posted: Sun Apr 26, 2009 6:39 pm
by ticket
That youtube video appears to produce a flv steam unsupported by mplayer.
If I past the URL directly into a command line window, mplayer complains with:

[flv @ 0x8837aa8]Unsupported video codec (7)

Somewhat surprising for the universal mplayer!

Still, it would be nice if flashgot could somehow detect the presence of the mp4 stream (which appears to be the same resolution as the flv stream).

Re: Calling mplayer from flashgot - params problem

Posted: Sun Apr 26, 2009 6:41 pm
by therube
FlashGot doesn't see the MP4 till its "there", but it can see it - Feature request: download mp4 from YouTube.

That FLV is using H.264. MPlayer can play it, but you may need a more recent build. I've been using this (Windows) of late & it plays it no problem, Kovensky's MPlayer - MPlayer builds for Windows.