Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Progressive download with Urllib2.

Thread Tools

Progressive download with Urllib2.

Posts: n/a
Hi There,

I am trying to download some video with python but have run aground on
the rocky shores of pseudostreaming. Fingers crossed someone else here
has some experience with this! Here's what I've done so far...

The initial link is foo.asx so I download that with...

handle = urllib2.urlopen( '' )
mime_type ="Content-Type","")
data =

It comes back with mime type of 'video/x-ms-asf' and the content...

I then used the same code again to grab the URL (ditching the 'ASF '
bit) and this time it comes back with a mime type of 'video/x-ms-wvx'
and two URLs...


The latter is no use as it's on a private LAN and the second is the same
URL as last time, just with a different mime type and naturally it
returns the same thing if I use Urllib2 open and read to fetch it with
or without the '?MSWMExt=.asf' part. So...

I fired up wireshark and spotted these lines coming back in the headers:

Server: Cougar/



I suspected for a second that meant I have to connect with a MS media
player or something but the same URL works fine when I paste it into
Firefox and the video starts pseudostreaming away so...

How can I get their server to give me the video data? Do I need to ask
for the file with some other protocol? RTSP? or change my user_agent
string and pretend to be Windows Media Player?? Do I need another
module as opposed to urllib2? and if so which one? I've had a search but
drawn a blank.

I guess I'll plug on in wireshark and see what some other programs do
but I'd appreciate it if anyone can put me out of my misery!

Yours stuck,

Roger Heathcote.
Reply With Quote

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
Progressive download in urllib2 Jon Python 0 09-11-2009 09:58 PM
convert progressive jpg to non-progressive jpg Sniper Abandon Ruby 0 05-15-2009 10:42 AM
How to output progressive video from a video card to a progressive CRT TV? DVD Video 4 09-13-2006 07:22 AM
Progressive scan dvd's on a non-progressive scan tv jack lift DVD Video 7 12-09-2003 06:01 PM