swf format verification?

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Wed Feb 14 17:00:48 EST 2007


akonsu wrote:

> hello, can someone recommend a good library to verify whether a
> file is in swf format (and ideally flv as well)? i need it to
> enable file uploading on to my web site.

Look how GNU "file" does it:

#------------------------------------------------------------------------------
# flash:        file(1) magic for Macromedia Flash file format
#
# See
#
#       http://www.macromedia.com/software/flash/open/
#
0       string          FWS             Macromedia Flash data,
>3      byte            x               version %d
0       string          CWS             Macromedia Flash data (compressed),
>3      byte            x               version %d
# From: Cal Peake <cp at absolutedigital.net>
0       string          FLV             Macromedia Flash Video

#
# From Dave Wilson
0       string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document

Regards,


Björn

-- 
BOFH excuse #346:

Your/our computer(s) had suffered a memory leak, and we are waiting for them to be topped up.




More information about the Python-list mailing list