Python爬虫七麦APP榜单

2020-05-12 18:12:50 浏览数 (1)

效果图

核心是加密函数

代码语言:javascript复制
#!/usr/bin/env python3

import time
import json
import base64
import requests
from urllib.parse import urlencode


headers = {
    "Accept": "application/json, text/plain, */*",
    "Referer": "https://www.qimai.cn/rank",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/59.0"
}

params = {
    "brand": "all",
    "country": "cn",
    "date": "2018-05-14",
    "device": "iphone",
    "genre": "36",
    "page": 1
}


# 自定义加密函数
def encrypt(a):
    e = '00000008d78d46a'
    t = len(e)
    n = len(a)
    a = list(a)
    for s in range(n):
        a[s] = chr(ord(a[s]) ^ ord(e[(s   10) % t]))
    return ''.join(a)

def main():
    # iPhone 免费榜单
    #

0 人点赞