I would like any BSD libraries I would prefer python but any language is great.
Asked
Active
Viewed 353 times
-5
-
Dupe? http://stackoverflow.com/questions/1214005/is-there-a-good-non-gpl-python-libraries-for-finding-the-length-of-an-mp3 – UnkwnTech Jul 31 '09 at 18:30
-
Do you mean length in bytes or length in time units (i.e. seconds)? – automatic Jul 31 '09 at 18:40
-
If you 'prefer python', why do you specify 'BSD'? – William Pursell Jul 31 '09 at 19:51
1 Answers
-2
Good question guaranteed to depend on host config (could be custom or fake descriptions) while one mentioned way is use HTTP HEAD
#Call HTTP HEAD in Python
import httplib
conn=httplib.HTTPConnection("www.abc.com")
conn.request("HEAD", "/dir/file1.mp3")
res=conn.getresponse()
fileSize=res.getheader('content-length')
#or res.getheaders() for all headers
conn.close()

Niklas Rosencrantz
- 25,640
- 75
- 229
- 424