From bace7d41af3777580fc82e0bb20a67db702a79ce Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 5 Apr 2022 21:51:10 +0700 Subject: [PATCH] add random string generator helper function --- tubearchivist/home/src/ta/helper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tubearchivist/home/src/ta/helper.py b/tubearchivist/home/src/ta/helper.py index 31ba727..c572ccc 100644 --- a/tubearchivist/home/src/ta/helper.py +++ b/tubearchivist/home/src/ta/helper.py @@ -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"""