From 4ef6fc18c4710659c43039ad50a0b4c663727c40 Mon Sep 17 00:00:00 2001 From: DoctorEenot <47860375+DoctorEenot@users.noreply.github.com> Date: Wed, 5 Feb 2020 17:03:55 +0200 Subject: [PATCH] Update signatures.py --- signatures.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/signatures.py b/signatures.py index 01df790..5e986bb 100644 --- a/signatures.py +++ b/signatures.py @@ -4,16 +4,23 @@ import urllib RANDOMISE_CNONCE = True + + +def actual_cnonce(): + buf = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' + cnonce = '' + length = random.randint(0,19) + 30 + for i in range(length): + cnonce += random.choice(buf) + return cnonce + +DEFAULT_CNONCE = actual_cnonce() def get_cnonce() -> str: if RANDOMISE_CNONCE: - buf = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' - cnonce = '' - length = random.randint(0,19) + 30 - for i in range(length): - cnonce += random.choice(buf) + cnonce = actual_cnonce() else: - cnonce = 'o5oorrrlBlbWKHRVuH7lBQdVCQEVKeXeTkAyA9H6FY8DT904sq' + cnonce = DEFAULT_CNONCE return cnonce