In order to generate the IDs used in Youtube the following serves as an potential example. It uses the datetime class to generate ID which should be unique if the code runs on a single system.