Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #68510
| From | Jabba Laci <jabba.laci@gmail.com> |
|---|---|
| Date | 2014-03-18 18:03 +0100 |
| Subject | extract stream title from the output of mplayer |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.8254.1395162230.18130.python-list@python.org> (permalink) |
Hi, I have a simple command-line radio player and I want to extract song titles from the output of mplayer. Example: $ mplayer http://relay2.slayradio.org:8000/ It produces a streamed output of this form: MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory ... ICY Info: StreamTitle='Alexander 'Taxim' Nev - Unsound minds feat. SAM';StreamUrl='http://www.SLAYRadio.org/'; ... At the end it shows a progress indicator, thus the output is streamed. The problem is I can't get this output in a string. My idea is to launch mplayer with a timeout of 2 seconds for instance, get the produced output and find the line that starts with "ICY Info". But when I kill the process after the timeout, I don't know how to fetch the output produced so far. Thanks, Laszlo
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
extract stream title from the output of mplayer Jabba Laci <jabba.laci@gmail.com> - 2014-03-18 18:03 +0100
csiph-web