views:

262

answers:

3

I'm doing some crawling with Python, and would like to be able to identify (however imperfectly) the flash I come across - is it a video, an ad, a game, or whatever.

I assume I would have to decompile the swf, which seems doable. But what sort of processing would I do with the decompiled Actionscript to figure out what it's purpose is?

Edit: or any better ideas would be most welcome also.

+4  A: 

I think your best bet would be to check the context where you see the swf file

usually they're embedded within web pages so if that page has 100 occurences of the word "game", then it might be a game, as an example

To detect an ad it might be trickier but i think that checking the domainname where the swf is hosted might do the trick, also html tags around the swf will be of great use

Eric
+2  A: 

It might help to look at the arguments passed to the Flash movie. If there's reference to an FLV file then there's a good chance the SWF is being used to play a movie.

The path to the SWF might help too. If it's under, say an /ads directory then it's probably just a banner ad. Or if it's under /games then it's probably a game.

Other than using heuristics like this there's probably not much you can do. SWFs can be used for a lot of different things, and there's really nothing in the SWF itself that would tell you what "type" it is.

Herms
A: 

Tough one. I guess you should try find a scope for a swf context. As you said, swfs can be: ads,games, video players, they can also contain experimental art. who knows. Once you know what exactly your after, it should be easier to figure out how to look for that kind of data.

I think it would be easier to get started with commercial websites. Those need promotion, so if they might promotional ria's setup with a little bit of SEO in mind so look for things like swfobject, swfaddress and tracking stuff ( omniture and who knows what else ). They should have keywords in the embedding html.

Google and Yahoo are working with Adobe as far as I know to make SWFs indexable. There is something mentioned about a custom FlashPlayer used for Flash indexing in the Flash Internals presentation from Adobe MAX. Hope it helps.

George Profenza