Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68511 > unrolled thread

Re: extract stream title from the output of mplayer

Started byChris Angelico <rosuav@gmail.com>
First post2014-03-19 04:12 +1100
Last post2014-03-19 04:12 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: extract stream title from the output of mplayer Chris Angelico <rosuav@gmail.com> - 2014-03-19 04:12 +1100

#68511 — Re: extract stream title from the output of mplayer

FromChris Angelico <rosuav@gmail.com>
Date2014-03-19 04:12 +1100
SubjectRe: extract stream title from the output of mplayer
Message-ID<mailman.8255.1395162773.18130.python-list@python.org>
On Wed, Mar 19, 2014 at 4:03 AM, Jabba Laci <jabba.laci@gmail.com> wrote:
> I have a simple command-line radio player and I want to extract song
> titles from the output of mplayer.
>
> 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.

My first recommendation would be to see what you can get directly,
rather than calling on mplayer. But otherwise, what you want to do is
redirect the output somewhere. Are you using the Python subprocess
module to do this? You haven't shown any code, but since you posted
this to python-list I'm guessing that you probably are talking about
Python. (Or s/guess/hop/ if you prefer!) There are many ways this
could be done; what have you tried, what partly worked, what did
something unexpected?

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web