ID3 tags and/or meta info from audio streams

Hello,

 

I build a channel for mp3 audio streams. I use it for online radiostations.

I know there are many other channels like shoutcast, but none of them was covering up official stations.

 

One example is egoFM with this stream: http://edge.live.mp3.mdn.newmedia.nacamar.net/ps-egofm_192/livestream.mp3

When you open this stream in Winamp or VLC, you see that the artist and title information are not related to the stream but to the actual title that is playing.

No I thought to myself, it would be nice if not only the station name would be shown in my mediabar while playing but also the title related information.

 

I tried the following:

url='http://edge.live.mp3.mdn.newmedia.nacamar.net/ps-egofm_192/livestream.mp3'
rq = MetadataObjectForURL(url)

no luck

 

also this:

url='http://edge.live.mp3.mdn.newmedia.nacamar.net/ps-egofm_192/livestream.mp3'
rq = MediaObjectForURL(url)

no chance, it seems to have no Media nor Metadata

 
 
So I thought about a regular HTTP Request:
rq = HTTP.Request(url, values=None, headers={}, cacheTime=None, encoding=None, errors=None, timeout=5, immediate=False, sleep=0, data=None)
headers = rq.headers

also no chance.

 

I know that there is metadata for streams, but how to get it?

 

thanks and best regards! :)

 

I'm not aware of a way to access that metadata. I'm sure there is a way but I doubt it's worth the effort to track down. There's no way to use it as designed from within a Plex channel. Since these are live streams, as far as Plex is concerned, there is no break between "tracks". There is no way to notify the Plex player that a new "track" has started in the live stream and that the title of the new track is "x".

I thought about an interval to update the track information like once every 10 seconds.

is there an API command to update the name of the current track playing in the plex webplayer?

I also found this code:

#!/usr/bin/env python
import urllib2
stream_url = 'http://pub1.di.fm/di_classictrance'
request = urllib2.Request(stream_url)
try:
    request.add_header('Icy-MetaData', 1)
    response = urllib2.urlopen(request)
    icy_metaint_header = response.headers.get('icy-metaint')
    if icy_metaint_header is not None:
        metaint = int(icy_metaint_header)
        read_buffer = metaint+255
        content = response.read(read_buffer)
        title = content[metaint:].split("'")[1]
        print title
except:
    print 'Error'
 

I know that I shall not use urllib2. Can I use HTTP the same way like urllib2?

is there an API command to update the name of the current track playing in the plex webplayer?

There is no way to notify the Plex player that a new "track" has started in the live stream and that the title of the new track is "x".

sorry, got it now