ETkObject.py 701 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. @Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
  5. @AUTHOR: ASJRD018
  6. @NAME: AnsjerFormal
  7. @software: PyCharm
  8. @DATE: 2019/6/1 17:25
  9. @Version: python3.6
  10. @MODIFY DECORD:ansjer dev
  11. @file: ETkObject.py
  12. @Contact: chanjunkai@163.com
  13. """
  14. import base64
  15. import urllib.parse
  16. class ETkObject(object):
  17. def __init__(self, etk):
  18. self.uid = ''
  19. def parseUid(self, etk):
  20. c = base64.b64decode(etk)
  21. c = c[2:-2]
  22. c = urllib.parse.unquote(c.decode('utf-8'))
  23. c = base64.b64decode(c)
  24. uid = c.decode('utf-8')
  25. if len(uid):
  26. return uid
  27. else:
  28. return False