You are not logged in.

#1 2009-04-08 08:47:00

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

shoutcast-search

Hi everyone,

I've put together a small CLI tool to search shoutcast.com radio stations. I use it in verbose mode to browse around, specifically for artists that I like. In normal mode, I use it do automate station selection. For example, I start my day with the following command to launch a random station with decent quality playing Chill music.

   $ shoutcast-search -n 1 -g chill -l ">50" -b ">127" -r | xargs vlc

Partly as a learning experience, I've added the shoutcast-search package to AUR. Not only is this my first AUR package, it is also my first source code contribution to the Open Source world. I appreciate any comments or pointers.

See man page for documentation. Source code at github.

Cheers,
halhen

PS

Also first time poster, though long time lurker. Lots of firsts today. Yay!

DS


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#2 2009-04-12 09:37:15

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

Re: shoutcast-search

0.2 is out. You now have more options to sort and prune the results to, for example, get the top ten stations ordered by bitrate. I also added a quick write-up on what it does and how it can be used on http://code.k2h.se.

Tip for using: add the following function to .bashrc (change to fit your player)

radio() {
    killall mpg123; shoutcast-search -n 1 -t mpeg -b ">63" --sort=ln10r $* | xargs mpg123 -q -@ &
}

For example, to start a random top-10 chill stream:

$ radio chill

Comments are welcome.

Last edited by halhen (2009-04-12 18:25:09)


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#3 2009-04-15 21:03:42

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

Re: shoutcast-search

0.3 is out and is in AUR. Not a huge list of news, but some; partly based on requests:

* separated library-friendly parts to a python module. Will end up on PyPI, possibly tonight.
* --list-genres option to fetch a list of musical genres according to shoutcast.com.
* -f FORMAT, --format=FORMAT lets you specify what information to print and how, which can be quite useful. For example

shoutcast-search -n 3 -f "%l\t%s" country

gives you a list of the number of listeners and names of the three top country stations:

2390    181.FM - Kickin' Country - Today's BEST Country!
1001     1.FM - Absolutely Country Hits
753      .977 The Country Channel

Documentation and examples on http://code.k2h.se.

I'm beginning to feel quite happy with this tool now, or am at least running out of ideas of what to add. I've been thinking about some interactive front-end that would let you scroll through the found list and press enter on the one you want to listen to. Would that be useful to anyone?

Please keep sending feature requests / bug reports or just drop me a line to let me know you use it.

Last edited by halhen (2009-04-15 21:06:35)


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#4 2009-06-03 09:57:37

wujaklija
Member
From: /Serbia/Ruma
Registered: 2009-02-14
Posts: 55

Re: shoutcast-search

i like it ... i was looking something like this ... and already using it smile ...

radio() {
    shoutcast-search -n 1 -t mpeg -b ">63" --sort=ln10r $* | xargs wget -q -O .shoutcast.pls && mocp -T wujaklija-theme /home/wuja/.shoutcast.pls    
}

Offline

#5 2009-08-08 22:22:02

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: shoutcast-search

This is a great little app... it does what the name suggests. There don't seem to be many other Shoutcast search apps/plugins. I wish it could be integrated in Sonata/mpc. B.t.w. the PKGBUILD is missing a dependency: makedepends="setuptools"

Last edited by rwd (2009-08-08 22:33:47)

Offline

#6 2009-11-12 21:42:13

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: shoutcast-search

Very useful, thank you!

I also have the desire to integrate this somehow into mpd, especially Sonata, any ideas?


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#7 2009-11-20 13:33:19

wujaklija
Member
From: /Serbia/Ruma
Registered: 2009-02-14
Posts: 55

Re: shoutcast-search

SanskritFritz wrote:

Very useful, thank you!

I also have the desire to integrate this somehow into mpd, especially Sonata, any ideas?

Only this idea :
in .bashrc

 radio() {
    shoutcast-search -n 1 -t mpeg -b ">63" --sort=ln10r $* | xargs wget -q -O .shoutcast.pls && ~/.skripte/./mpc-radio.sh ~/.shoutcast.pls    
}

where mpc-radio.sh is :

#!/bin/bash


export MPD_HOST=127.0.0.1
export MPD_PORT=6600

if echo $1 | grep -i pls; then
    mpc clear
    grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
    mpc play
elif echo $1 | grep -i m3u; then
    mpc clear
    cat $1 | mpc add
    mpc play 
else
    mpc clear
    echo $1 | mpc add
    mpc play
fi
exit

you need to have mpc installed...
so just type in terminal , for examle :radio rock

Offline

#8 2009-11-20 14:18:58

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: shoutcast-search

wujaklija wrote:
SanskritFritz wrote:

Very useful, thank you!

I also have the desire to integrate this somehow into mpd, especially Sonata, any ideas?

Only this idea :
in .bashrc

 radio() {
    shoutcast-search -n 1 -t mpeg -b ">63" --sort=ln10r $* | xargs wget -q -O .shoutcast.pls && ~/.skripte/./mpc-radio.sh ~/.shoutcast.pls    
}

where mpc-radio.sh is :

#!/bin/bash


export MPD_HOST=127.0.0.1
export MPD_PORT=6600

if echo $1 | grep -i pls; then
    mpc clear
    grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
    mpc play
elif echo $1 | grep -i m3u; then
    mpc clear
    cat $1 | mpc add
    mpc play 
else
    mpc clear
    echo $1 | mpc add
    mpc play
fi
exit

you need to have mpc installed...
so just type in terminal , for examle :radio rock

this is very useful, you could clean it up a bit though:

mpc clear

case $1 in
  *.pls) grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add ;;
  *.m3u) cat $1 | mpc add ;;
  *)     echo $1 | mpc add ;;
esac

mpc play

just a suggestion, obviously if it works it works smile.

Offline

#9 2009-11-23 23:18:45

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: shoutcast-search

Nice idea, thanks!


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#10 2010-01-22 14:10:02

mitzekotze
Member
Registered: 2009-09-14
Posts: 5

Re: shoutcast-search

Awesome program, exactly what I searched for. Thank you for that.


Try walking in my shoes.

Offline

#11 2010-02-08 14:13:04

cf8
Member
From: Russia
Registered: 2008-10-21
Posts: 83

Re: shoutcast-search

Here is 5 cents:

radio() {
        mpc clear; shoutcast-search -n 1 -g "$1" -t mpeg -b ">63" --sort=ln10r $* | xargs w3m -dump | grep -i file | cut -d'=' -f2 |head     -n 1 |xargs mpc add; mpc toggle
}

It adds radio stream of the requested genre to the mpd playlist and plays it.

Offline

#12 2010-07-30 22:26:43

peterkosov
Member
From: Russia
Registered: 2010-07-30
Posts: 6

Re: shoutcast-search

Thanks you man

Offline

#13 2011-01-08 22:12:27

halhen
Member
From: Gothenburg, Sweden
Registered: 2009-04-08
Posts: 56
Website

Re: shoutcast-search

Due to the new AOL licensing terms for the SHOUTcast service, I've decided to put shoutcast-search on hold in its current, non-functioning state. I encourage you to let AOL know what you think about this.

https://bbs.archlinux.org/viewtopic.php?pid=876091


statnot - status text manager and notification-daemon for dwm, wmii and the like
shic - SHellscript Irc Client

Offline

#14 2011-01-09 15:21:05

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: shoutcast-search

\would it be an idea to turn it into an icecast search tool?

Offline

Board footer

Powered by FluxBB