Slated employs many different techniques to protect the site from hacking, but by far the most important is vigilance, and that means paying close attention to things like logs.
Like many sites, Slated is under constant attack, mostly from bots running on compromised Windows machines, but most of those attacks are purely opportunistic and random, or in other words aren't actually targeting Slated for any particular reason. But every now and then I discover something in the server logs that suggests otherwise.
Today was one of those days.
Rather than just provide a script, I've decided to present this solution as a sort of informal thesis, so hopefully it will help others to reinterpret it for their own purposes. As of 10th Dec 2011 this article is still a work in progress, so if it seems incomplete then please have patience, and come back later.
Objective: Transcode video from any source to MPEG-4 ASP (note: this is DivX 4/5, not MPEG-4 AVC/H.264), for playback on most standalone devices, keeping the file size reasonable, whilst retaining as much quality as possible, but without any regard to transcoding time or CPU utilisation. In this case I'm also going to hardsub (render subtitles directly onto the output video) a SRT subtitles file previously ripped from the source's forced subs (subtitles that only appear when foreign language is spoken, in a soundtrack that is otherwise in your locale's language). You can rip your own subtitles files using SubRip (Windows, also works under Wine) or Avidemux (multi-platform), or just download them from places like opensubtitles.org.
Note: The method used here is extremely CPU intensive, which may cause your PC to die of exhaustion, and you to die of boredom. You have been warned. :) However, the result is worth it IMHO, as the video quality is exceptional. H.264 generally produces better results at lower bitrates (or so Messiah Jobs keeps telling us), but unfortunately it's not compatible with nearly as many devices as DivX/XviD (e.g. most Smart TVs will play MPEG-4 ASP DivX/XviD files, but not MPEG-4 AVC H.264 files, mainly because H.264 is infested with a ton of nasty patents that make it difficult and expensive for manufacturers to implement). Also for compatibility reasons I've chosen the AVI 2.0 container format, and forced the FourCC from FMP4 to DX50.
One of the best things about the Internet is the fact that not only is it a tremendous source of information, but it also provides us with a very fine-grained control over that information. For example, unlike broadcast and print media, we can automatically filter out adverts and other nasties, using indispensable software like AdBlock Plus and NoScript.
But there's another type of "nasty" that isn't so easy to filter out ... media hacks with an unsavoury political bent (putting it politely).
Take El Reg for example. Most of its articles are informative, entertaining and have a decidedly liberal leaning, but there are a few exceptions, most of which seem to be penned by a particularly unpleasant character by the name of Andrew Orlowski.