Just a heads up, the OP wants to know HOW they do it, what code/script whaever they use, because maybe he is working on something similar.
''Filehosts have there ways of working out things.'' is not a really a helpful reply.
I dont know the answer, i just replied to avoid getting other replies with no sense.