import base64
base64.b64decode(a) # a为base64格式的字符串
import base64 a = "eyJmaWxsIjpbWzAsWzI1NSwyNTUsMjU1LDBdLCIwIl0sWzY1NTM1LFsyNTUsMjU1LDI1NSwwXSwiNjU1MzUiXV0sInNpbmdsZSI6W10sInJhbmdlIjpbXSwiZ3JhZGllbnQiOltbMCxbMCwwLDIwNCwxXSwiMCJdLFsxLFs0MSwxMDAsMjU1LDFdLCIiXSxbMixbOTMsMTc4LDI1NSwxXSwiMiJdLFszLFsxMzYsMjE4LDI1NSwxXSwiIl0sWzQsWzE3MCwyNDMsMjU1LDFdLCI0Il0sWzUsWzIyNSwyNTMsMTg0LDFdLCIiXSxbNixbMjU1LDIzNCw0LDFdLCI2Il0sWzcsWzI1NSwxNjQsMCwxXSwiIl0sWzgsWzI1NSw1OCwwLDFdLCI4Il0sWzksWzIxOSwwLDAsMV0sIiJdLFsxMCxbMTI4LDAsMCwxXSwiMTAiXV0sInNsb3BlIjoxLCJ1bml0IjoiIiwidWlkIjoiZ3Vlc3QiLCJjbk5hbWUiOiLlpKfmsJTmub/luqblu5Pnur9fNzAwIiwiZW5OYW1lIjoiQUhQXzcwMCIsImlzRGVmYXVsdCI6IjEifQ==" b = base64.b64decode(a) print("-----------------------") print(b)
输出结果: