Search code examples
mp3bsd

Are there any BSD Libraries that will find the length of an mp3?


I would like any BSD libraries I would prefer python but any language is great.


Solution

  • 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()