| 24 | |
| 25 | |
| 26 | def get_data(): |
| 27 | url = f'https://www.toutiao.com/api/pc/list/user/feed?category=pc_profile_article&token=MS4wLjABAAAAaezOXkHVr0_i2JvWXprb4zLGpRInnKStptFm5WsXHKU&max_behot_time=0&aid=24&app_name=toutiao_web&_signature=_02B4Z6wo00901jX7xswAAIDBoS2dwKwE.CY138JAAOmFBlrVvdYYaavNGiUZREHfSlDHQ-tGNOiTj80g8jbG-5JTFFcyjtQh5fvKgSWNGN.OQiteat6QTmwOdY72nzDzCusvav9BGM11zF1506' |
| 28 | response = requests.get(url, headers=headers).json() |
| 29 | # print(response) |
| 30 | max_bottom_time = response['next']['max_behot_time'] |
| 31 | data = f'/api/pc/list/feed?category=pc_profile_article&token=MS4wLjABAAAAaezOXkHVr0_i2JvWXprb4zLGpRInnKStptFm5WsXHKU&max_behot_time={max_bottom_time}&aid=24&app_name=toutiao_web' |
| 32 | with open('./js_signature/todays_signature.js', 'r', encoding='utf-8') as f: |
| 33 | js = f.read() |
| 34 | sign = execjs.compile(js).call('get_sign', data) |
| 35 | # print(sign) |
| 36 | next_url = f'https://www.toutiao.com{data}&_signature={sign}' |
| 37 | print(next_url) |
| 38 | |
| 39 | |
| 40 | if __name__ == '__main__': |