cookie被我注释了,可以加上后运行
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# @Time : 2019/1/30 19:53
# @Author : Spareribs
# @File : 知识星球.py
# @Software : PyCharm
# @Description :
"""
import json
import re
import urllib
import requests
headers = {
'accept': "application/json, text/plain, */*",
'origin': "https://wx.zsxq.com",
'x-version': "1.10.14",
'user-agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
'x-request-id': "73d45154-0e02-14c7-245c-cbe1cc083ee9",
'referer': "https://wx.zsxq.com/dweb/",
'accept-encoding': "gzip, deflate, br",
'accept-language': "en,zh-CN;q=0.9,zh;q=0.8,zh-TW;q=0.7",
'cookie': "***********************",
}
def get_likes(headers):
url = "https://api.zsxq.com/v1.10/topics/544455541888154/likes"
querystring = {"count": "30"}
response = requests.request("GET", url, headers