init: profile

This commit is contained in:
2023-11-03 22:22:24 +01:00
parent 06e95b9751
commit 4938e05c4a
4 changed files with 34 additions and 2 deletions

14
src/Profile.py Normal file
View File

@ -0,0 +1,14 @@
import urls
import Client
from requests import Response
class Profile:
def __init__(self, client, user_id: int):
response: Response = client._get(urls.profiles_page + str(user_id))
if (response.content == b'Profile Not Found'):
return None
content: dict = eval(response.content)
self.username = content['username']
self.password = content['password']