vcrypt: fix wstream

This commit is contained in:
marco
2020-09-11 17:28:09 +02:00
parent a2e25a27e9
commit 0e1cd140f4
+6 -4
View File
@@ -516,16 +516,18 @@ class UnshortenIt(object):
else: else:
if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri: if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri:
import datetime, hashlib import datetime, hashlib
from base64 import b64encode
ip = urlopen('https://api.ipify.org/').read() ip = urlopen('https://api.ipify.org/').read()
day = datetime.date.today().strftime('%Y%m%d') day = datetime.date.today().strftime('%Y%m%d')
if PY3: day = day.encode() if PY3: day = day.encode()
headers = { headers = {
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1" "Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
} }
uri = uri.replace('sb/', 'sb1/') spl = uri.split('/')
uri = uri.replace('akv/', 'akv1/') spl[3] += '1'
uri = uri.replace('wss/', 'wss1/') if spl[3] == 'wss1':
uri = uri.replace('wsd/', 'wsd1/') spl[4] = b64encode(spl[4])
uri = '/'.join(spl)
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False) r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
if 'Wait 1 hour' in r.data: if 'Wait 1 hour' in r.data:
uri = '' uri = ''