add infoq topic

This commit is contained in:
hillerliao
2020-04-18 11:18:10 +08:00
parent 24a4b8f0dd
commit 434fdf3c67
4 changed files with 41 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ def parse(post):
def ctx():
DEFAULT_HEADERS.update({'Referer': 'https://www.infoq.cn'}) # 必须设置Referer不然会451错误
import json
posts = requests.post(f'{domain}/public/v1/my/recommond', data={'size': 20}, headers=DEFAULT_HEADERS)
posts = requests.post(f'{domain}/public/v1/my/recommond', json={'size': 20}, headers=DEFAULT_HEADERS)
posts = json.loads(posts.text)['data']
return {
'title': 'infoq',