-
Notifications
You must be signed in to change notification settings - Fork 0
/
百度图片链接解码测试.py
66 lines (63 loc) · 1.33 KB
/
百度图片链接解码测试.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- coding: utf-8 -*-
# @Author : Silas9187
# @Email : silas9187@gmail.com
# @blogsite :https://blog.csdn.net/acarsar
# @GitHub :https://github.com/silas9187
a ='ippr_z2C$qAzdH3FAzdH3Ffb_z&e3Bftgwt42_z&e3BvgAzdH3F4omlaAzdH3FaamK8iwuzy0kbFPb4D1d0&mla'
# a = '_z2C$q'
str_table = {
'_z2C$q': ':',
'_z&e3B': '.',
'AzdH3F': '/',
}
"""
char_table = {
'w': 'a',
'k': 'b',
'v': 'c',
'1': 'd',
'j': 'e',
'u': 'f',
'2': 'g',
'i': 'h',
't': 'i',
'3': 'j',
'h': 'k',
's': 'l',
'4': 'm',
'g': 'n',
'5': 'o',
'r': 'p',
'q': 'q',
'6': 'r',
'f': 's',
'p': 't',
'7': 'u',
'e': 'v',
'o': 'w',
'8': '1',
'd': '2',
'n': '3',
'9': '4',
'c': '5',
'm': '6',
'0': '7',
'b': '8',
'l': '9',
'a': '0'
}
"""
# char_table = {ord(key): ord(value) for key, value in char_table.items()}
in_table = '0123456789abcdefghijklmnopqrstuvw'
out_table = '7dgjmoru140852vsnkheb963wtqplifca'
# 将in和out中每个字符转化为各自的ascii码,返回一个字典(dict)
char_table = str.maketrans(in_table, out_table)
print('char_table:',char_table)
# for t in a:
#解码
if True:
for key, value in str_table.items():
a = a.replace(key, value)
print(a)
a = a.translate(char_table)
print(a,end='')