more logging

This commit is contained in:
bakatrouble 2023-11-03 15:51:41 +03:00
parent 1821645b88
commit 006b1bdaa8

View File

@ -1,3 +1,5 @@
import json
import logging
from dataclasses import dataclass from dataclasses import dataclass
from dataclasses_json import dataclass_json from dataclasses_json import dataclass_json
from enum import Enum from enum import Enum
@ -136,6 +138,7 @@ class E621:
async def get_posts(self, tags='', page=1, limit=320) -> List[E621Post]: async def get_posts(self, tags='', page=1, limit=320) -> 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))
return [E621Post.from_dict(p) for p in r['posts']] return [E621Post.from_dict(p) for p in r['posts']]
async def get_post(self, post_id: str) -> E621Post: async def get_post(self, post_id: str) -> E621Post: