Mikubill / pixivpy-async

Pure Python 3 Async Pixiv API
The Unlicense
149 stars 18 forks source link

illust_recommended请求下一页时返回“不正なリクエストです。” #23

Closed ssttkkl closed 3 years ago

ssttkkl commented 3 years ago

复现代码:

import asyncio

from pixivpy_async import *

async def _main():
    async with PixivClient(proxy="socks5://127.0.0.1:7890") as client:
        api = AppPixivAPI(client=client)
        api.set_auth(access_token="access_token",
                     refresh_token="refresh_token")

        result = await api.illust_recommended()
        next_qs = api.parse_qs(result["next_url"])
        result = await api.illust_recommended(**next_qs)
        print(result)

def main():
    loop = asyncio.get_event_loop()
    loop.run_until_complete(_main())

if __name__ == '__main__':
    main()

对比pixivpy3和pixivpy-async的代码发现pixivpy3的illust_recommended并未在请求中添加viewed参数,将next_qs中viewed参数删去后工作正常。

Mikubill commented 3 years ago

viewed[]的问题,已修复。