Generate a random video ID like YouTube using Python

import random

characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'
result = ''
for i in range(0, 11):
    result += random.choice(characters)
youtubeurl= "https://www.youtube.com?v=" + result
print(youtubeurl)

Leave a Reply

Your email address will not be published. Required fields are marked *