Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Using Python to verify streaming tv/radio station links

Reply
Thread Tools

Using Python to verify streaming tv/radio station links

 
 
donnyf@gmail.com
Guest
Posts: n/a
 
      04-29-2008
Hi guys. I've put together a website ( http://worldwidemediaproject.com
) that is a database of internet streaming tv/radio stations from
around the world. I have built the site with all users in mind. The
site should be Linux, Unix, Mac, Win, etc friendly as I do not hide
the actual stream link or force the user to use an embedded player to
view/listen to the streams. In fact, you can even download the streams
you like as a playlist that you can load into your player of choice
(and even a few PVR software plugins).

In building the site, I have enabled the user to report stations that
are nonfunctional. In addition to this, I would like to automate the
checking of the links in the database as well as any user submitted
links. What I am wanting to do is to script this with a simple for
loop which would loop through a file containing the station stream
link as well as the station id. I'd like to pass each through some
kind of verification function and if a connection is made then the
stream is good and move on to the next. If the connection fails then
the stream is bad, I would like to add the station id to a file
containing all 'nonfunctional' streams that I can later automate to
flag the stations.

Is there an easy way to use python to verify a stream exists? I've
done a little experimenting with sockets and was able to connect to my
usenet server and talk to it, but I don't really know what's involved
with connecting to streaming windows media, real media and winamp
servers or what to expect as far as connection status messages. I am
not unfamiliar with python, but I am far from an expert. If anyone
could give me a hand with this or give me a push in the right
direction I would greatly appreciate it!

Many thanks!
 
Reply With Quote
 
 
 
 
alexelder@gmail.com
Guest
Posts: n/a
 
      04-29-2008
On Apr 29, 1:52 pm, (E-Mail Removed) wrote:
> Hi guys. I've put together a website (http://worldwidemediaproject.com
> ) that is a database of internet streaming tv/radio stations from
> around the world. I have built the site with all users in mind. The
> site should be Linux, Unix, Mac, Win, etc friendly as I do not hide
> the actual stream link or force the user to use an embedded player to
> view/listen to the streams. In fact, you can even download the streams
> you like as a playlist that you can load into your player of choice
> (and even a few PVR software plugins).
>
> In building the site, I have enabled the user to report stations that
> are nonfunctional. In addition to this, I would like to automate the
> checking of the links in the database as well as any user submitted
> links. What I am wanting to do is to script this with a simple for
> loop which would loop through a file containing the station stream
> link as well as the station id. I'd like to pass each through some
> kind of verification function and if a connection is made then the
> stream is good and move on to the next. If the connection fails then
> the stream is bad, I would like to add the station id to a file
> containing all 'nonfunctional' streams that I can later automate to
> flag the stations.
>
> Is there an easy way to use python to verify a stream exists? I've
> done a little experimenting with sockets and was able to connect to my
> usenet server and talk to it, but I don't really know what's involved
> with connecting to streaming windows media, real media and winamp
> servers or what to expect as far as connection status messages. I am
> not unfamiliar with python, but I am far from an expert. If anyone
> could give me a hand with this or give me a push in the right
> direction I would greatly appreciate it!
>
> Many thanks!


Hey!

With regards checking feeds, look into urllib (maybe) and the httplib
(definitely). They /could/ offer some sort of information regarding
the activity of your feeds. Without knowing anything about the
streaming protocols I wouldn't suggest my methods to necessarily be
the most helpful. You could, at least [maybe], establish whether a
feed is active if it can return a HTTP 200 response. If that's a
sufficient check I would suggest that httplib is the place to start.

Alex.
 
Reply With Quote
 
 
 
 
donnyf@gmail.com
Guest
Posts: n/a
 
      05-09-2008
On Apr 29, 10:11 am, (E-Mail Removed) wrote:
> Hey!
>
> With regards checking feeds, look into urllib (maybe) and the httplib
> (definitely). They /could/ offer some sort of information regarding
> the activity of your feeds. Without knowing anything about the
> streaming protocols I wouldn't suggest my methods to necessarily be
> the most helpful. You could, at least [maybe], establish whether a
> feed is active if it can return a HTTP 200 response. If that's a
> sufficient check I would suggest that httplib is the place to start.
>
> Alex.


Thanks for the reply. I'm not so sure that httplib is going to work
as most of these are not http urls. Here's a handful of examples that
maybe someone could use to give me an idea of how to accomplish what
I'm trying to do.

Here's a list of the various types of media links I have in my
database (all working):

http://www.dradio.de/streaming/dkultur_hq_ogg.m3u
http://200.29.92.21/ucvtv
http://www.ampmedia.org/asx/marina25.asx
http://www.jazz.fm/streaming/JAZZFM91.pls
mms://144.122.56.15/ODTU-TV
rtsp://200.79.7.137/broadcast/tv.rm

The httplib approach may work the http urls, but what about the mms
and rsp 'protocols'?

Please remember that I only know enough to be dangerous and that I'm
much more a hacker than I am a programmer. As always, any help is
greatly appreciated!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
verify whether "str" is still callable in Python 2.5.1 Ge Chunyuan Python 3 08-13-2007 09:21 AM
Wireless using Apple Base Station and Windows 02befree Wireless Networking 0 03-17-2007 06:36 PM
Wireless using Apple Base Station and Windows 02befree Computer Support 0 03-17-2007 06:36 PM
Verify python-list@python.org for yngvi@cs.ualberta.ca Yngvi Bjornsson Python 0 09-28-2005 09:57 AM



Advertisments