init: profile
This commit is contained in:
14
src/Profile.py
Normal file
14
src/Profile.py
Normal 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']
|
||||
Reference in New Issue
Block a user