Closed pank closed 11 years ago
Hi, I don't think greg should be doing the playing. It probably should be able to output a path to a file, though, so that you can pipe that on to a player. Let me think about it.
greg
wouldn't play. It would select and download the right audio file, download it to $tmp
and tell mplayer
about the path. Of course, much of this is solvable with a path output and some additional scripting.
greg download
accepts now a --downloadhandler
flag, which allows the user to specify a custom download handler. I think the following might be what you are looking for:
greg download 0 -dh "mplayer {link}"
(read the new greg.conf for info on the syntax here) This allows you to stream the podcast to mplayer directly, which is, I gather, what you were after. You can also maybe write a little script:
#!/bin/sh
greg download $1 -dh "mplayer {link}"
and save it as gregplay
, so that gregplay 0
would do what you wanted.
Please install the tip of the development branch, and let me know what you think.
manolomartinez notifications@github.com writes:
greg download
accepts now a--downloadhandler
flag, which allows the user to specify a custom download handler. I think the following might be what you are looking for:greg download 0 -dh "mplayer {link}"
[...] Please install the tip of the development branch, and let me know what you think.
Sounds great!
I'll check it out and let you know!
–Rasmus
And let me remind you also that moderation in the pursuit of justice is no virtue
For the record: here is the script I'm using:
#!/bin/bash
episode=${2:-0}
url=${1}
[[ $1 == *http* ]] && handle="-u" || handle="-f"
greg check $handle $1 > /dev/null 2>&1 &
greg download $episode -dh "mplayer {link}"
usage gregplay philosophybite will play the latest philosophy bite episode. gregplay philosophybite 3 will play the third episode found by greg check. . .
I might also make a dmenu script when time permits (e.g. just a script that would list feeds, check 'em and let me press RET on the episode I want to listen to)
PS: Maybe making download path argument would make sense, e.g. if one wants to use greg for both downloading podcasts for an mp3 player (which goes to somewhere in /home/$USERNAME
and instantaneously played files which goes to /tmp
.
That's neat, thanks. I was thinking that it might be useful to have a directory here with scripts and examples of things one can do with Greg. I'll add yours, if that's OK.
Do let me know if you end up writing that dmenu script.
Re the downloadpath argument, I guess it makes sense to have a command-line option for everything one can permanently change in the config file. I'll see to it. In any case, your script does not download the podcast episode anywhere, I think: mplayer
simply streams it and leaves no file behind.
That's neat, thanks. I was thinking that it might be useful to have a directory here with scripts and examples of things one can do with Greg. I'll add yours, if that's OK.
Sure.
Do let me know if you end up writing that dmenu script.
I will look into it, but at the moment I have an awful lot of time-consuming "statistics-stuff" to do (step 0: figure out what it entails). . . I have one for radio, but it's a slightly different format.
Re the downloadpath argument, I guess it makes sense to have a command-line option for everything one can permanently change in the config file. I'll see to it. In any case, your script does not download the podcast episode anywhere, I think:
mplayer
simply streams it and leaves no file behind.
You are of course right! Now I feel stupid. In my head greg
would
download the file to PATH
and mplayer
would somehow "stream" it
from PATH
. . .
Thanks, Rasmus
PS: Mostly out of (user) cleanness, it might be nice to be able to
specify alternative names to feed names. E.g. I listen to a program
called "X and Y". Clearly, "XandY" is too long, but sometimes I want to
call greg check X
and sometimes greg check Y
. So perhaps in the
data
file I could specify an alternative name?
I.e. in the data file.
url = http://...
synonym = Y ```
or
[X,Y] url = http://....```
On the other hand it might make the code less clean and one could simply do
url = http://....
[Y]
url = http://....```
--
If you can mix business and politics wonderful things can happen!
An initial and quite crappy version of greg-dmenu
is available here:
https://bitbucket.org/pank/greg-utils/src/tip/greg-dmenu
A lot of things are still rather poor:
greg.py
for some reason; this is bad.greg.py
greg
is python3 it might make sense to write greg-dmenu
in python3Anyway, it works on my system for now.
That's very cool, thanks. I'll take a look at it, and see if I can help you improve it.
One question: I'm about to merge the development version back into master. Have you had any problems these days with Greg?
Thanks again. M
That's very cool, thanks. I'll take a look at it, and see if I can help you improve it.
I appreciate it.
One question: I'm about to merge the development version back into master. Have you had any problems these days with Greg?
No stability issues. I'd have no concern with this.
In terms of the handler there might still be things that could be improved such as exporting getting the pid, but these are minor things.
–Rasmus
Hvor meget poesi tror De kommer ud af et glas isvand?
Hi, Some times I really just want to listen to the newest podcast without too much fuzz. For instance it would be great just to be able to say
greg play PhilosophyBites latest
orgreg play PhilosophyBites 0
or perhaps I want to play the episode 8 conditional on the list of episodes (greg check
).This would give Greg more a feel of an on-demand radio, which I at least often need.
Customization could be player program (defaulting to mplayer of ffplay or something else) and temporary download directory (probably /tmp).