zoukankan      html  css  js  c++  java
  • 大众点评字体加密

    大众点评一共有601个加密字体,通用性加密,根据数据的类型更改加密字符,例如,地址加密使用address 的加密字体, 电话使用num 字体加密。

    加密字典

    {"unif27d": "1", "unie8f9": "2", "unie4a6": "3", "unif22f": "4", "unif510": "5", "unie0fc": "6", "uniebda": "7", "unif21e": "8", "unif2d3": "9", "unie9d6": "0", "unie67d": "店", "unie79a": "中", "unie623": "美", "unie498": "家", "unie902": "馆", "unie835": "小", "unif82e": "车", "unie2d2": "大", "uniebfe": "市", "unie161": "公", "unif4ea": "酒", "unif814": "行", "unie38b": "国", "uniec5c": "品", "unie9ab": "发", "unif766": "电", "unif686": "金", "unif338": "心", "unie8de": "业", "uniee2a": "商", "unie120": "司", "unie808": "超", "unie977": "生", "unie931": "装", "unieac1": "园", "uniebf9": "场", "unie7d3": "食", "unie14a": "有", "unif60e": "新", "unie3c9": "限", "unie7d4": "天", "unie228": "面", "uniebca": "工", "unif4b2": "服", "uniefdd": "海", "uniee34": "华", "unie96d": "水", "unie7a8": "房", "unif2a3": "饰", "uniefc1": "城", "unie3ff": "乐", "unieabf": "汽", "uniea54": "香", "unie9b5": "部", "unie84c": "利", "uniee20": "子", "unieba6": "老", "unif54f": "艺", "unied5a": "花", "unie97a": "专", "unif534": "东", "unif2fa": "肉", "unif17d": "菜", "uniea71": "学", "unif1cc": "福", "unie356": "饭", "unif426": "人", "unif4d8": "百", "unif6e6": "餐", "unif068": "茶", "unie5a7": "务", "unif32a": "通", "unif5c6": "味", "unie040": "所", "unie58a": "山", "unif2f3": "区", "unieecd": "门", "unie141": "药", "unif7a2": "银", "unif51f": "农", "unie4f7": "龙", "uniec49": "停", "unif8ba": "尚", "unif82f": "安", "unif28e": "广", "unie6d9": "鑫", "unie08e": "一", "unif466": "容", "unieb7c": "动", "unie1d4": "南", "unif19d": "具", "unif8d0": "源", "unie8c7": "兴", "uniec26": "鲜", "uniee23": "记", "uniec7c": "时", "unif3f2": "机", "unie6d7": "烤", "unie639": "文", "unif51e": "康", "unif5fc": "信", "unif683": "果", "unif134": "阳", "unie658": "理", "unif1ed": "锅", "unif5b5": "宝", "unie5e0": "达", "uniee8b": "地", "unif4b0": "儿", "unif8cb": "衣", "unie13a": "特", "unif5e8": "产", "unie38e": "西", "unie159": "批", "uniedb6": "坊", "unif49b": "州", "unie2a6": "牛", "unif61f": "佳", "unif8b4": "化", "uniec6c": "五", "unie266": "米", "unif798": "修", "unif7e0": "爱", "unif368": "北", "unif212": "养", "unie82a": "卖", "unieed3": "建", "unif32e": "材", "unie55a": "三", "unif733": "会", "unif25d": "鸡", "unif6a5": "室", "unieb44": "红", "unif8f7": "站", "uniefa4": "德", "unie643": "王", "unie6bc": "光", "unie03b": "名", "uniefd6": "丽", "unie048": "油", "unie645": "院", "unied4a": "堂", "unif7f5": "烧", "unie37e": "江", "unief11": "社", "unie29a": "合", "unie7b9": "星", "uniea5f": "货", "unied39": "型", "unie117": "村", "unief89": "自", "unie006": "科", "uniee36": "快", "unif3dc": "便", "unif189": "日", "unif43d": "民", "unif692": "营", "unif16e": "和", "unif08d": "活", "uniebf3": "童", "unie504": "明", "unie75f": "器", "unie6cd": "烟", "unif71b": "育", "unif1fa": "宾", "unif883": "精", "unieca4": "屋", "unif40d": "经", "unieba1": "居", "unif602": "庄", "unif6a4": "石", "uniea02": "顺", "unieb9e": "林", "unief0d": "尔", "unif1ec": "县", "uniea64": "手", "unied7a": "厅", "unieed0": "销", "unie1e3": "用", "unied36": "好", "unie83c": "客", "unif723": "火", "unied18": "雅", "unif122": "盛", "unied07": "体", "unie5ad": "旅", "uniefe9": "之", "unif68c": "鞋", "unieddb": "辣", "unie890": "作", "unie0dc": "粉", "unif18c": "包", "unif183": "楼", "uniec48": "校", "unif471": "鱼", "unie7a4": "平", "unif306": "彩", "uniedb4": "上", "unif64e": "吧", "unie410": "保", "unif417": "永", "uniec00": "万", "uniebc5": "物", "unif078": "教", "unif2bf": "吃", "unie65b": "设", "unieeb7": "医", "unieccd": "正", "unif378": "造", "unif8f4": "丰", "unif035": "健", "unied29": "点", "unie36c": "汤", "unif132": "网", "unied9b": "庆", "unif293": "技", "unie61c": "斯", "unif5a8": "洗", "uniecd5": "料", "unif109": "配", "unie959": "汇", "unif18e": "木", "unieef9": "缘", "unie163": "加", "unif886": "麻", "unie869": "联", "uniec1e": "卫", "unif8b5": "川", "unieda8": "泰", "unie324": "色", "unie3cc": "世", "unie261": "方", "unie3a0": "寓", "unif324": "风", "uniee1a": "幼", "unie934": "羊", "unie8ee": "烫", "unif752": "来", "unieb1d": "高", "unief48": "厂", "unif23b": "兰", "unif5bf": "阿", "unie04f": "贝", "unif045": "皮", "uniedff": "全", "unif166": "女", "unie82d": "拉", "unif58b": "成", "unif344": "云", "unif824": "维", "unie1f4": "贸", "unie21c": "道", "unif7d0": "术", "uniecc4": "运", "unif236": "都", "unie1f9": "口", "unif1d8": "博", "unif7ce": "河", "uniefcc": "瑞", "unie2c1": "宏", "unif270": "京", "unif49a": "际", "unif581": "路", "unif62c": "祥", "unif7e6": "青", "unie108": "镇", "unief01": "厨", "unie431": "培", "unieceb": "力", "unie5eb": "惠", "unif34e": "连", "unie07e": "马", "unie0d2": "鸿", "unie18e": "钢", "unie257": "训", "unie36a": "影", "unie7c5": "甲", "unie0f1": "助", "unie6d1": "窗", "unie136": "布", "unif864": "富", "unied19": "牌", "unif64f": "头", "uniecaa": "四", "unif0f7": "多", "unief57": "妆", "unie178": "吉", "unie6ce": "苑", "unif603": "沙", "unie4fb": "恒", "unie09f": "隆", "unieb0d": "春", "unif739": "干", "uniee46": "饼", "unif211": "氏", "unif562": "里", "unif29d": "二", "unie2bb": "管", "uniea72": "诚", "unie9d4": "制", "unif519": "售", "unie9b3": "嘉", "unif35d": "长", "unif2a6": "轩", "unieafe": "杂", "unie01e": "副", "unif219": "清", "unif770": "计", "unif095": "黄", "unie282": "讯", "unif1e8": "太", "unie7b7": "鸭", "unieb83": "号", "unif1f0": "街", "unie192": "交", "unie236": "与", "unie8ad": "叉", "uniefd9": "附", "unif504": "近", "unif0f5": "层", "unieadd": "旁", "unif1d1": "对", "uniec75": "巷", "uniea1e": "栋", "unif461": "环", "unie5f5": "省", "unif22e": "桥", "unie0d3": "段", "unie837": "乡", "unif420": "厦", "unie64d": "府", "unie9d1": "于", "unie229": "铺", "unie003": "内", "unie06a": "侧", "unie133": "元", "unie933": "购", "unie647": "前", "uniee14": "幢", "unie089": "滨", "unie4ad": "处", "unif26b": "向", "unif2e7": "座", "unieb1b": "下", "unif828": "鼎", "unie923": "凤", "unif2cf": "港", "unif87e": "开", "uniea48": "关", "unie524": "景", "unied41": "泉", "unif33c": "塘", "unie295": "放", "unif6ff": "昌", "unie88f": "线", "unif3b5": "湾", "unief5f": "政", "unie09a": "步", "unif480": "宁", "unif020": "解", "unif832": "白", "unie73f": "田", "unif0d8": "町", "unie8ae": "溪", "unif769": "十", "uniec6e": "八", "unie08a": "古", "unif431": "双", "unif494": "胜", "unie5de": "本", "unie179": "单", "unie069": "同", "unif19b": "九", "unif20e": "迎", "unif1b1": "第", "uniee9f": "台", "unie2d3": "玉", "unif810": "锦", "unie7ab": "底", "uniecce": "后", "unie05d": "七", "unieaa9": "斜", "unie7cb": "期", "unif2e3": "武", "unie242": "岭", "unif5c8": "松", "uniee7a": "角", "uniee60": "纪", "unif545": "朝", "unif71d": "峰", "unie794": "六", "unie376": "振", "unif42b": "珠", "unie708": "局", "unie8a0": "岗", "unif5be": "洲", "unie87e": "横", "uniea15": "边", "unif0f1": "济", "unif1da": "井", "unie9bc": "办", "unie194": "汉", "unieb1e": "代", "unif1f8": "临", "unied3f": "弄", "unif124": "团", "unie9b4": "外", "unie7e0": "塔", "unif20d": "杨", "unif7aa": "铁", "unif24f": "浦", "uniea8c": "字", "unie143": "年", "unieb02": "岛", "uniea9b": "陵", "unif221": "原", "unie85e": "梅", "unieb88": "进", "unif5f4": "荣", "unie730": "友", "uniefe7": "虹", "uniec16": "央", "unie885": "桂", "unie95f": "沿", "unied1e": "事", "unif738": "津", "unie14b": "凯", "unie7c7": "莲", "unie618": "丁", "unie361": "秀", "unif28a": "柳", "unif5f8": "集", "uniebba": "紫", "unif538": "旗", "unie4fe": "张", "unie460": "谷", "uniedb2": "的", "unif7b7": "是", "unie00b": "不", "unif675": "了", "unieebf": "很", "unif2d0": "还", "uniea14": "个", "unie398": "也", "uniea17": "这", "unif02a": "我", "unieb35": "就", "unif4de": "在", "unie1cc": "以", "unie49f": "可", "unied1f": "到", "unie715": "错", "unif6e1": "没", "unie510": "去", "uniee04": "过", "unif5f7": "感", "unie05f": "次", "unied55": "要", "unief15": "比", "unif7a6": "觉", "uniefde": "看", "uniee9e": "得", "unie948": "说", "unie2ac": "常", "unie268": "真", "unie628": "们", "unif87f": "但", "unif6fc": "最", "unie3e9": "喜", "unie70e": "哈", "unif5d3": "么", "unif388": "别", "unie96f": "位", "unif69a": "能", "unie893": "较", "unie0f2": "境", "unie088": "非", "unif85f": "为", "uniee6c": "欢", "unif805": "然", "unie657": "他", "unie720": "挺", "unie4d9": "着", "unif179": "价", "uniec60": "那", "unie188": "意", "unif204": "种", "unif264": "想", "unif4a9": "出", "uniebbe": "员", "uniecf8": "两", "uniefd4": "推", "unie77d": "做", "unie033": "排", "unie70d": "实", "uniee41": "分", "unieff5": "间", "uniecde": "甜", "unif401": "度", "unie65e": "起", "unif835": "满", "unif3e7": "给", "unieea9": "热", "unif286": "完", "unif39c": "格", "unie355": "荐", "unie04b": "喝", "unif5fa": "等", "unif04b": "其", "uniece1": "再", "unif323": "几", "unieb67": "只", "unie7ef": "现", "unie251": "朋", "unieef2": "候", "unif88d": "样", "unieffd": "直", "unif133": "而", "unied88": "买", "unie3af": "于", "unie7bd": "般", "uniefd3": "豆", "unif2af": "量", "unie974": "选", "unie1d7": "奶", "unie126": "打", "unie47e": "每", "unie945": "评", "unie759": "少", "uniec63": "算", "unie4aa": "又", "uniec7d": "因", "unie183": "情", "unieb91": "找", "unief4a": "些", "unif54e": "份", "unif66f": "置", "unie57b": "适", "unieb2a": "什", "unif123": "蛋", "unif590": "师", "unif0d3": "气", "unie19f": "你", "uniedb0": "姐", "unieb8d": "棒", "unie76b": "试", "unie6b7": "总", "unie48d": "定", "unif3a0": "啊", "unief20": "足", "unief39": "级", "unif37d": "整", "unie8e7": "带", "unif81e": "虾", "unif638": "如", "unif0b6": "态", "uniefff": "且", "unif173": "尝", "unie004": "主", "unif155": "话", "unie28e": "强", "unif643": "当", "unie053": "更", "unie4b5": "板", "unie613": "知", "unie9c9": "己", "unie624": "无", "uniead9": "酸", "uniecfe": "让", "unie975": "入", "unif0f2": "啦", "unie4a0": "式", "unif02d": "笑", "unif3e5": "赞", "unif001": "片", "uniee2d": "酱", "unif40b": "差", "unie508": "像", "unie690": "提", "unie0c4": "队", "unie96b": "走", "unief9b": "嫩", "unif4ee": "才", "unieee5": "刚", "unieed7": "午", "unif280": "接", "uniec0d": "重", "uniebd4": "串", "unie608": "回", "unif030": "晚", "unie6e8": "微", "unie27b": "周", "unie7fc": "值", "unif082": "费", "unie14d": "性", "unie7db": "桌", "uniec36": "拍", "uniee7b": "跟", "uniec98": "块", "unief12": "调", "unie8ea": "糕"}
    这是加密字典 加密方式不一样但是字符串是一样的 一共601个字符
    

      

    字符串的顺序也是不变的,所以先获取加密的字体文件

    # -*- coding:UTF-8 -*-
    import requests
    from fontTools.ttLib import TTFont
    import json
    
    url = 'http://s3plus.meituan.net/v1/mss_73a511b8f91f43d0bdae92584ea6330b/font/4eda5444.woff'
    response = requests.get(url=url)
    with open('b.woff', 'wb')as f:
        f.write(response.content)
    font = TTFont("./b.woff")
    # 获取加密字符的顺序 font_names = font.getGlyphOrder()[2:]

    # 通过之前获取的加密字典生成新的加密字典 with open('font.json', 'r', encoding='utf8')as f: json_dict = json.loads(f.read()) json_values = json_dict.values() json_dict2 = {} for index, json_value in enumerate(json_values): json_dict2[font_names[index]] = json_value print(json_dict2) with open('hours.json', 'w', encoding='utf8')as f: f.write(json.dumps(json_dict2, ensure_ascii=False))

    生成新的加密字典 然后替换掉加密字符串

    # -*- coding:UTF-8 -*-
    import json
    import re
    
    import pandas
    import requests
    import urllib3
    from pyquery import PyQuery as pq
    from retry import retry
    
    
    class DianPing:
        def __init__(self):
            self.start_url = "http://www.dianping.com/zhengzhou/ch45/g150"
            self.headers = {
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
            }
            self.login_header = {
                'Proxy-Connection': 'keep-alive',
                'Cache-Control': 'max-age=0',
                'Upgrade-Insecure-Requests': '1',
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
                'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
                'Referer': 'http://www.dianping.com/zhengzhou/ch45/g33844r7462',
                'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
            }
            tunnel = "tps198.kdlapi.com:15818"
            username = "t10886694756492"
            password = "bjgfg7jn"
            self.proxies = {
                "http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel},
                "https": "https://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}
            }
            self.all_list = []
    
        def get_font_dict(self):
            path = "address_font.json"
            with open(path, 'r', encoding='utf8')as f:
                self.address_font = json.loads(f.read())
            business_hours_path = 'business_hours.json'
            with open(business_hours_path, 'r', encoding='utf8')as f:
                self.business_hours_font = json.loads(f.read())
            hours_path = 'hours.json'
            with open(hours_path, 'r', encoding='utf8')as f:
                self.hours_font = json.loads(f.read())
    
        def get_area(self):
            response = requests.get(url=self.start_url, headers=self.headers, proxies=self.proxies)
            doc = pq(response.content.decode())
            area_list = doc('#region-nav a').items()
            for area in area_list:
                area_url = area.attr('href')
                area_name = area('span').text()
                self.get_page_content(area_name, area_url)
    
        def get_page_content(self, area_name, area_url):
            response = requests.get(url=area_url, headers=self.headers, proxies=self.proxies)
            doc = pq(response.content.decode())
            ul = doc('#shop-all-list li').items()
            for li in ul:
                title = li('.tit h4').text()
                title_url = li('.tit a').attr('href')
                if title_url:
                    self.get_store_info(area_name, title, title_url)
            next = doc('.next')
            if next:
                next_url = next.attr('href')
                self.get_page_content(area_name, next_url)
    
        @retry()
        def get_store_info(self, area, title, title_url):
            store_dict = {}
            store_dict['名称'] = title
            store_dict['行政区'] = area
            urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
            response = requests.get(url=title_url, headers=self.login_header, verify=False, proxies=self.proxies)
            response_page = response.content.decode()
            address_info = re.findall('<span class="item" itemprop="street-address" id="address">(.*?)</span>', response_page)
            if address_info:
                address_info = address_info[0]
                result_address = re.findall('<e class="address">(.*?)</e>', address_info)
                for info in result_address:
                    info_key = info.replace('&#x', 'uni').replace(';', '')
                    info_value = self.address_font[info_key]
                    address_info = re.sub(f'<e class="address">{info}</e>', info_value, address_info)
                result_num = re.findall('<d class="num">(.*?)</d>', address_info)
                for num in result_num:
                    num_key = num.replace('&#x', 'uni').replace(';', '')
                    num_value = self.address_font[num_key]
                    address_info = re.sub(f'<d class="num">{num}</d>', num_value, address_info)
                address_doc = pq(address_info).text()
                store_dict['地址'] = address_doc
            phone = re.findall('<p class="expand-info tel">(.*?)</p>', response_page)
            if phone:
                phone_info = re.sub('<span class="info-name">电话:</span>', '', phone[0])
                result_num = re.findall('<d class="num">(.*?)</d>', phone_info)
                for num in result_num:
                    num_key = num.replace('&#x', 'uni').replace(';', '')
                    num_value = self.address_font[num_key]
                    phone_info = re.sub(f'<d class="num">{num}</d>', num_value, phone_info)
                phone_num = pq(phone_info).text()
                store_dict['电话'] = phone_num
            business_hours_html = re.findall('<p class="info info-indent">(.*?)</p>', response_page)
            if business_hours_html:
                business_hours_html = business_hours_html[0]
                svgmtsi = re.findall('<svgmtsi class="shopdesc">(.*?)</svgmtsi>', business_hours_html)
                for svg in svgmtsi:
                    svg_key = svg.replace('&#x', 'uni').replace(';', '')
                    svg_value = self.business_hours_font[svg_key]
                    business_hours_html = re.sub(f'<svgmtsi class="shopdesc">{svg}</svgmtsi>', svg_value, business_hours_html)
                result_num = re.findall('<svgmtsi class="hours">(.*?)</svgmtsi>', business_hours_html)
                for num in result_num:
                    num_key = num.replace('&#x', 'uni').replace(';', '')
                    num_value = self.hours_font[num_key]
                    business_hours_html = re.sub(f'<svgmtsi class="hours">{num}</svgmtsi>', num_value, business_hours_html)
                business_hours = pq(business_hours_html).text().replace('修改', '').replace('营业时间: ','')
                store_dict['营业时间'] = business_hours
            print(store_dict)
            self.all_list.append(store_dict)
    
        def run(self):
            self.get_font_dict()
            self.get_area()
            pandas.DataFrame(self.all_list).to_excel('体育场馆.xlsx', index=False)
    
    
    if __name__ == '__main__':
        DianPing().run()
    
    cookie 只需要登录即可 不限制ip
  • 相关阅读:
    springMVC-接收数据-参数绑定
    我的asp.net core目录
    我的IdentityServer目录
    win10安装mysql
    asp.net core webapi 生成导出excel
    Dapper, 批量插入,批量更新, 以及in, like
    asp.net core 依赖注入几种常见情况
    asp.net core 2.1 配置管理
    各个模式的accesstoken续期详解
    ResourceOwnerPassword模式使用数据库.
  • 原文地址:https://www.cnblogs.com/lqn404/p/14200637.html
Copyright © 2011-2022 走看看