Advertisement
y2kbug

telegram passport code 1

May 29th, 2019
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. def passport_handler(bot, update):
  2. # If we received any passport data
  3. passport_data = update.message.passport_data
  4. if passport_data:
  5. # If our nonce doesn't match what we think, this Update did not originate from us
  6. # Ideally you would randomize the nonce on the server
  7. # if passport_data.decrypted_credentials.nonce != '123456':
  8. # return
  9.  
  10. # Print the decrypted credential data
  11. # For all elements
  12. # Print their decrypted data
  13. # Files will be downloaded to current directory
  14. for data in passport_data.decrypted_data: # This is where the data gets decrypted
  15. if data.type == 'phone_number':
  16. print('Phone: ', data.phone_number)
  17. elif data.type == 'email':
  18. print('Email: ', data.email)
  19. if data.type in ('personal_details', 'passport', 'driver_license', 'identity_card',
  20. 'internal_passport', 'address'):
  21. print(data.type, data.data)
  22. if data.type in ('utility_bill', 'bank_statement', 'rental_agreement',
  23. 'passport_registration', 'temporary_registration'):
  24. print(data.type, len(data.files), 'files')
  25. for file in data.files:
  26. actual_file = file.get_file()
  27. print(actual_file)
  28. actual_file.download()
  29. if data.type in ('passport', 'driver_license', 'identity_card',
  30. 'internal_passport'):
  31. if data.front_side:
  32. file = data.front_side.get_file()
  33. print(data.type, file)
  34. file.download()
  35. if data.type in ('driver_license' and 'identity_card'):
  36. if data.reverse_side:
  37. file = data.reverse_side.get_file()
  38. print(data.type, file)
  39. file.download()
  40. if data.type in ('passport', 'driver_license', 'identity_card',
  41. 'internal_passport'):
  42. if data.selfie:
  43. file = data.selfie.get_file()
  44. print(data.type, file)
  45. file.download()
  46. if data.type in ('passport', 'driver_license', 'identity_card',
  47. 'internal_passport', 'utility_bill', 'bank_statement',
  48. 'rental_agreement', 'passport_registration',
  49. 'temporary_registration'):
  50. print(data.type, len(data.translation), 'translation')
  51. for file in data.translation:
  52. actual_file = file.get_file()
  53. print(actual_file)
  54. actual_file.download()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement