From 0e1cd140f4d19cdf9b67599ced141e3a101caaf3 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 11 Sep 2020 17:28:09 +0200 Subject: [PATCH] vcrypt: fix wstream --- lib/unshortenit.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/unshortenit.py b/lib/unshortenit.py index e817ff8c..93947025 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -516,16 +516,18 @@ class UnshortenIt(object): else: if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri: import datetime, hashlib + from base64 import b64encode ip = urlopen('https://api.ipify.org/').read() day = datetime.date.today().strftime('%Y%m%d') if PY3: day = day.encode() headers = { "Cookie": hashlib.md5(ip+day).hexdigest() + "=1" } - uri = uri.replace('sb/', 'sb1/') - uri = uri.replace('akv/', 'akv1/') - uri = uri.replace('wss/', 'wss1/') - uri = uri.replace('wsd/', 'wsd1/') + spl = uri.split('/') + spl[3] += '1' + if spl[3] == 'wss1': + spl[4] = b64encode(spl[4]) + uri = '/'.join(spl) r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False) if 'Wait 1 hour' in r.data: uri = ''