change default limit

This commit is contained in:
bakatrouble 2023-11-03 15:54:33 +03:00
parent 006b1bdaa8
commit 6cb3948fa5

View File

@ -136,7 +136,7 @@ class E621:
def __init__(self): def __init__(self):
self.client = httpx.AsyncClient(headers={'user-agent': 'bot/1.0 (bakatrouble)'}, base_url='https://e621.net') self.client = httpx.AsyncClient(headers={'user-agent': 'bot/1.0 (bakatrouble)'}, base_url='https://e621.net')
async def get_posts(self, tags='', page=1, limit=320) -> List[E621Post]: async def get_posts(self, tags='', page=1, limit=100) -> List[E621Post]:
r = (await self.client.get('/posts.json', params={'tags': tags, 'page': page, 'limit': limit})).json() r = (await self.client.get('/posts.json', params={'tags': tags, 'page': page, 'limit': limit})).json()
logging.warning(json.dumps(r)) logging.warning(json.dumps(r))
return [E621Post.from_dict(p) for p in r['posts']] return [E621Post.from_dict(p) for p in r['posts']]