I have a wmv file at a particular url that I want to grab and save as a file using Python. My script uses urllib2 to authenticate and read the bytes and save them locally in chunks. However, once I open the file, no video player recognizes it. When I download the wmv manually from a browser, the file plays fine, but oddly enough ends up being about 500kb smaller than the file I end up with using Python. What's going on? Is there header information I need to somehow exclude?
What Transfer-Encoding is the server sending back? I would bet it is sending back Transfer-Encoding: chunked, which is ending up in your data.
http://en.wikipedia.org/wiki/Chunked_transfer_encoding