add random string generator helper function

This commit is contained in:
simon 2022-04-05 21:51:10 +07:00
parent 738b083a7f
commit bace7d41af
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,12 @@ def ignore_filelist(filelist):
return cleaned
def randomizor(length):
"""generate random alpha numeric string"""
pool = string.digits + string.ascii_letters
return "".join(random.choice(pool) for i in range(length))
def requests_headers():
"""build header with random user agent for requests outside of yt-dlp"""