simple thunder link parser
written by github/zhenggao2 with python
#!/usr/bin/python3
# -*- endocing: utf-8 -*-
import base64
import os
'''
example thunder link:
thunder://QUFodHRwOi8vbm5uLnh1bmxlaXppeXVhbi5uZXQvMTcxMi/lpKrnqbrmlZHmj7QuQkQxMjgw6auY5riF5Lit6Iux5Y+M5a2X54mILm1wNFpa
'''
def thunderLinkParser(s):
if not s.startswith('thunder://'):
print('ERROR: Thunder link should start with: "thunder://".')
return None
s = s.replace('thunder://', '')
while len(s) % 4 != 0:
s = s + '='
try:
link = base64.b64decode(s).decode('utf-8')
except Exception as e:
print('ERROR: Fail to decode b64 str: %s' % s)
return None
return link
if __name__ == '__main__':
print('**********************************')
pri