吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1891|回复: 1
收起左侧

[讨论] 昨天看某人爬52的表情包,一位给了jsdata,我手痒re了一下

[复制链接]
fanvalen 发表于 2020-5-12 16:06
[Python] 纯文本查看 复制代码
import re

js='''
var smthumb = '30';var smilies_type = new Array();

smilies_type['_1'] = ['默认表情', 'default'];

smilies_type['_301'] = ['老虎', 'laohu'];

smilies_type['_17'] = ['蘑菇点点', 'mogu'];

smilies_type['_300'] = ['粉粉猪', 'fenfenzhu'];

var smilies_array = new Array();
var smilies_fast = new Array();
smilies_array[1] = new Array();

smilies_array[1][1] = [

['937', '{:1_937:}','9.gif','28','28','28'],
['911', '{:1_911:}','33.gif','28','28','28'],
['909', '{:1_909:}','31.gif','28','28','28'],
['908', '{:1_908:}','30.gif','28','28','28'],
['907', '{:1_907:}','3.gif','28','28','28'],
['905', '{:1_905:}','28.gif','28','28','28'],
['904', '{:1_904:}','27.gif','28','28','28'],
['901', '{:1_901:}','24.gif','28','28','28'],
['899', '{:1_899:}','22.gif','28','28','28'],
['896', '{:1_896:}','2.gif','28','28','28'],
['893', '{:1_893:}','17.gif','28','28','28'],
['913', '{:1_913:}','35.gif','28','28','28'],
['918', '{:1_918:}','4.gif','28','28','28'],
['936', '{:1_936:}','8.gif','28','28','28'],
['935', '{:1_935:}','7.gif','28','28','28'],
['929', '{:1_929:}','5.gif','28','28','28'],
['927', '{:1_927:}','48.gif','28','28','28'],
['926', '{:1_926:}','47.gif','28','28','28'],
['925', '{:1_925:}','46.gif','28','28','28'],
['924', '{:1_924:}','45.gif','28','28','28'],
['923', '{:1_923:}','44.gif','28','28','28'],
['921', '{:1_921:}','42.gif','28','28','28'],
['919', '{:1_919:}','40.gif','28','28','28'],
['889', '{:1_889:}','13.gif','28','28','28'],
['887', '{:1_887:}','11.gif','28','28','28'],
['14', ':victory:','victory.gif','28','28','28'],
['12', ':lol','lol.gif','28','28','28'],
['11', ':wwqwq','mad.gif','28','28','28'],
['10', ':rggrg','sweat.gif','28','28','28'],
['9', ';www','titter.gif','28','28','28'],
['8', ':$qqq','shy.gif','28','28','28'],
['7', ':keai','tongue.gif','28','28','28'],
['6', ':eee','shocked.gif','28','28','28'],
['5', ':@','huffy.gif','28','28','28'],
['4', ':\'(weeqw','cry.gif','28','28','28'],
['3', ':Dweeqw','biggrin.gif','28','28','28'],
['2', ':(eew','sad.gif','28','28','28'],
['16', ':kiss:','kiss.gif','28','28','28'],
['17', ':handshake','handshake.gif','28','28','28'],
['28', ':loveliness:','loveliness.gif','28','28','28']];


smilies_array[1][2] = 
[['886', '{:1_886:}','10.gif','28','28','28'],
['885', '{:1_885:}','1.gif','28','28','28'],
['865', ':sleepy:','sleepy.gif','28','28','28'],
['864', ':shutup:','shutup.gif','28','28','28'],
['863', ':dizzy:','dizzy.gif','28','28','28'],
['29', ':funk:eweqw','funk.gif','28','28','28'],
['862', ':curse:','curse.gif','28','28','28'],
['1', '{:1_1:}','smile.gif','28','28','28'],
['890', '{:1_890:}','14.gif','24','24','24'],
['894', '{:1_894:}','18.gif','20','20','20'],
['900', '{:1_900:}','23.gif','24','24','24'],
['906', '{:1_906:}','29.gif','20','20','20'],
['892', '{:1_892:}','16.gif','30','30','30'],
['932', '{:1_932:}','52.gif','30','30','50'],
['933', '{:1_933:}','53.gif','30','13','50']];




smilies_array[301] = new Array();smilies_array[301][1] = [


['971', '{:301_971:}','laohu1.gif','30','30','50'],
['999', '{:301_999:}','laohu35.gif','30','30','50'],
['998', '{:301_998:}','laohu34.gif','30','30','50'],
['997', '{:301_997:}','laohu33.gif','30','30','50'],
['996', '{:301_996:}','laohu32.gif','30','30','50'],
['995', '{:301_995:}','laohu31.gif','30','30','50'],
['994', '{:301_994:}','laohu30.gif','30','30','50'],
['993', '{:301_993:}','laohu3.gif','30','30','50'],
['992', '{:301_992:}','laohu29.gif','30','30','50'],
['1000', '{:301_1000:}','laohu36.gif','30','30','50'],
['1001', '{:301_1001:}','laohu37.gif','30','30','50'],
['1009', '{:301_1009:}','laohu8.gif','30','30','50'],
['1008', '{:301_1008:}','laohu7.gif','30','30','50'],
['1007', '{:301_1007:}','laohu6.gif','30','30','50'],
['1006', '{:301_1006:}','laohu5.gif','30','30','50'],
['1005', '{:301_1005:}','laohu40.gif','30','30','50'],
['1004', '{:301_1004:}','laohu4.gif','30','30','50'],
['1003', '{:301_1003:}','laohu39.gif','30','30','50'],
['1002', '{:301_1002:}','laohu38.gif','30','30','50'],
['991', '{:301_991:}','laohu28.gif','30','30','50'],
['990', '{:301_990:}','laohu27.gif','30','30','50'],
['979', '{:301_979:}','laohu17.gif','30','30','50'],
['978', '{:301_978:}','laohu16.gif','30','30','50'],
['977', '{:301_977:}','laohu15.gif','30','30','50'],
['976', '{:301_976:}','laohu14.gif','30','30','50'],
['975', '{:301_975:}','laohu13.gif','30','30','50'],
['974', '{:301_974:}','laohu12.gif','30','30','50'],
['973', '{:301_973:}','laohu11.gif','30','30','50'],
['972', '{:301_972:}','laohu10.gif','30','30','50'],
['980', '{:301_980:}','laohu18.gif','30','30','50'],
['981', '{:301_981:}','laohu19.gif','30','30','50'],
['989', '{:301_989:}','laohu26.gif','30','30','50'],
['988', '{:301_988:}','laohu25.gif','30','30','50'],
['987', '{:301_987:}','laohu24.gif','30','30','50'],
['986', '{:301_986:}','laohu23.gif','30','30','50'],
['985', '{:301_985:}','laohu22.gif','30','30','50'],
['984', '{:301_984:}','laohu21.gif','30','30','50'],
['983', '{:301_983:}','laohu20.gif','30','30','50'],
['982', '{:301_982:}','laohu2.gif','30','30','50'],
['1010', '{:301_1010:}','laohu9.gif','30','30','50']];


smilies_array[17] = new Array();smilies_array[17][1] = [

['1089', '{:17_1089:}','hrhr.gif','30','30','50'],
['1061', '{:17_1061:}','okl.gif','30','30','50'],
['1062', '{:17_1062:}','oll.gif','30','30','50'],
['1063', '{:17_1063:}','xz.gif','30','30','50'],
['1064', '{:17_1064:}','leng.gif','30','30','50'],
['1065', '{:17_1065:}','sh.gif','30','30','50'],
['1066', '{:17_1066:}','Hi.gif','30','30','50'],
['1067', '{:17_1067:}','rjhx.gif','30','30','50'],
['1068', '{:17_1068:}','hh.gif','30','30','50'],
['1060', '{:17_1060:}','slyj.gif','30','30','50'],
['1059', '{:17_1059:}','rwxx.gif','30','30','50'],
['1051', '{:17_1051:}','nu.gif','30','30','50'],
['1052', '{:17_1052:}','hcc.gif','30','30','50'],
['1053', '{:17_1053:}','ch.gif','30','30','50'],
['1054', '{:17_1054:}','xzl.gif','30','30','50'],
['1055', '{:17_1055:}','55555.gif','30','30','50'],
['1056', '{:17_1056:}','dj.gif','30','30','50'],
['1057', '{:17_1057:}','hx.gif','30','30','50'],
['1058', '{:17_1058:}','luguo.gif','30','30','50'],
['1069', '{:17_1069:}','Love.gif','30','30','50'],
['1070', '{:17_1070:}','lx.gif','30','30','50'],
['1081', '{:17_1081:}','qfo.gif','30','30','50'],
['1082', '{:17_1082:}','wsz.gif','30','30','50'],
['1083', '{:17_1083:}','lbt.gif','30','30','50'],
['1084', '{:17_1084:}','wk.gif','30','30','50'],
['1085', '{:17_1085:}','bya.gif','30','30','50'],
['1086', '{:17_1086:}','td.gif','30','30','50'],
['1087', '{:17_1087:}','en.gif','30','30','50'],
['1088', '{:17_1088:}','HOHO.gif','30','30','50'],
['1080', '{:17_1080:}','sm.gif','30','30','50'],
['1079', '{:17_1079:}','c.gif','30','30','50'],
['1071', '{:17_1071:}','y.gif','30','30','50'],
['1072', '{:17_1072:}','zzn.gif','30','30','50'],
['1073', '{:17_1073:}','lh.gif','30','30','50'],
['1074', '{:17_1074:}','dyj.gif','30','30','50'],
['1075', '{:17_1075:}','ddxx.gif','30','30','50'],
['1076', '{:17_1076:}','wbs.gif','30','30','50'],
['1077', '{:17_1077:}','xdl.gif','30','30','50'],
['1078', '{:17_1078:}','xx.gif','30','30','50'],
['1050', '{:17_1050:}','lg.gif','30','30','50']];


smilies_array[300] = new Array();smilies_array[300][1] = [

['938', '{:300_938:}','fenfenzhu1.gif','30','28','50'],
['956', '{:300_956:}','fenfenzhu26.gif','24','30','40'],
['957', '{:300_957:}','fenfenzhu27.gif','27','30','45'],
['958', '{:300_958:}','fenfenzhu28.gif','30','28','50'],
['959', '{:300_959:}','fenfenzhu29.gif','30','30','50'],
['960', '{:300_960:}','fenfenzhu3.gif','30','25','50'],
['961', '{:300_961:}','fenfenzhu30.gif','30','28','50'],
['962', '{:300_962:}','fenfenzhu31.gif','30','16','50'],
['963', '{:300_963:}','fenfenzhu32.gif','30','30','50'],
['964', '{:300_964:}','fenfenzhu33.gif','30','30','50'],
['965', '{:300_965:}','fenfenzhu4.gif','27','30','45'],
['966', '{:300_966:}','fenfenzhu5.gif','30','25','50'],
['967', '{:300_967:}','fenfenzhu6.gif','30','28','50'],
['968', '{:300_968:}','fenfenzhu7.gif','30','30','50'],
['969', '{:300_969:}','fenfenzhu8.gif','30','30','50'],
['955', '{:300_955:}','fenfenzhu25.gif','19','30','32'],
['954', '{:300_954:}','fenfenzhu24.gif','30','28','50'],
['953', '{:300_953:}','fenfenzhu23.gif','30','28','50'],
['939', '{:300_939:}','fenfenzhu10.gif','30','25','50'],
['940', '{:300_940:}','fenfenzhu11.gif','30','27','50'],
['941', '{:300_941:}','fenfenzhu12.gif','30','30','50'],
['942', '{:300_942:}','fenfenzhu13.gif','30','30','50'],
['943', '{:300_943:}','fenfenzhu14.gif','25','30','41'],
['944', '{:300_944:}','fenfenzhu15.gif','23','30','38'],
['945', '{:300_945:}','fenfenzhu16.gif','25','30','41'],
['946', '{:300_946:}','fenfenzhu17.gif','30','30','50'],
['947', '{:300_947:}','fenfenzhu18.gif','28','30','46'],
['948', '{:300_948:}','fenfenzhu19.gif','30','26','50'],
['949', '{:300_949:}','fenfenzhu2.gif','30','22','50'],
['950', '{:300_950:}','fenfenzhu20.gif','30','29','50'],
['951', '{:300_951:}','fenfenzhu21.gif','30','26','50'],
['952', '{:300_952:}','fenfenzhu22.gif','30','26','50'],
['970', '{:300_970:}','fenfenzhu9.gif','23','30','38']];v



ar smilies_fast=[

['1','1','25'],
['1','1','26'],
['1','1','27'],
['1','1','28'],
['1','1','29'],
['1','1','30'],
['1','1','31'],
['1','1','33'],
['1','1','34'],
['1','1','35'],
['1','1','36'],
['1','1','37'],
['1','2','7'],
['1','2','8'],
['1','2','9'],
['1','2','10'],
['1','2','11'],
['1','2','12'],
['1','2','13'],
['1','2','14']];

'''

#先匹配type
pat=r"smilies_type\['_(.*?)'\] = \['(.*?)', '(.*?)'\];"
imgtpye=re.findall(pattern=pat,string=js)

#匹配gif名字
pat2=r"\[.*?:(.*?)_.*?,\'(.*?)\',.*?\]"
gif=re.findall(pattern=pat2,string=js)

for i in range(len(imgtpye)):
    #print(imgtpye)
    b=imgtpye[i]
    sz=b[0]
    cname=b[1]
    ename=b[2]

    print(sz,cname,ename)
    #打印同类gif名字
    for n in range(len(gif)):
        c=gif[n]
        sz2=c[0]
        name=c[1]
        #print(sz2,name)
        if sz==sz2:
            print(name)

        else:
            #print("不相符")
            pass

#匹配特殊几个
pat3=r"\[.*?:(.*?):\',\'(.*?)\',.*?\]|\[.*?, \':(.*?)\',\'(.*?)\',.*?\]"
gif2=re.findall(pattern=pat3,string=js)


#print(gif2)
for x in range(len(gif2)):
    ts=gif2[x]
    if len(ts[0])>0:
        print(ts[0:2])
    else:
        print(ts[2:4])


以上是给示列,有问题请指出
本人小白只有用已会的模块来处理问题,也比较懒 规则贪婪匹配模式。



免费评分

参与人数 2吾爱币 +2 热心值 +2 收起 理由
王星星 + 1 + 1 谢谢@Thanks!
xiaovssha + 1 + 1 说的是我,哈哈

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

深爱我的女孩 发表于 2020-5-12 16:33
支持一下,表示一下都看懂不懂
zhangxu888 发表于 2020-5-12 16:50
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 17:45

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表