9
9
from telethon .tl .functions .account import UpdateProfileRequest
10
10
from telethon .tl .functions .photos import DeletePhotosRequest , UploadProfilePhotoRequest
11
11
12
+ PROVIDER_ARTS_CULTURE = 'arts-culture'
12
13
PROVIDER_CAT_FAKE = 'cat-fake'
13
14
PROVIDER_HUMAN_FAKE = 'human-fake'
14
15
PROVIDER_SPACE = 'space'
@@ -23,6 +24,18 @@ class Profile:
23
24
about : str = None
24
25
25
26
27
+ async def create_profile_arts_culture () -> Profile :
28
+ async with ClientSession () as session :
29
+ async with session .get (url = 'https://source.unsplash.com/featured/?arts-culture' ) as response :
30
+ image = await response .read ()
31
+
32
+ return Profile (
33
+ image = image ,
34
+ first_name = get_first_name (),
35
+ last_name = get_last_name (),
36
+ )
37
+
38
+
26
39
async def create_profile_cat_fake () -> Profile :
27
40
async with ClientSession () as session :
28
41
async with session .get (url = 'https://thiscatdoesnotexist.com' ) as response :
@@ -60,14 +73,17 @@ async def create_profile_space() -> Profile:
60
73
61
74
62
75
async def create_profile (provider : str ) -> Profile :
63
- if provider == PROVIDER_CAT_FAKE :
76
+ if provider == PROVIDER_ARTS_CULTURE :
77
+ return await create_profile_arts_culture ()
78
+ elif provider == PROVIDER_CAT_FAKE :
64
79
return await create_profile_cat_fake ()
65
80
elif provider == PROVIDER_HUMAN_FAKE :
66
81
return await create_profile_human_fake ()
67
82
elif provider == PROVIDER_SPACE :
68
83
return await create_profile_space ()
69
84
elif provider == PROVIDER_RANDOM :
70
85
return await create_profile (random .choice ([
86
+ PROVIDER_ARTS_CULTURE ,
71
87
PROVIDER_CAT_FAKE ,
72
88
PROVIDER_HUMAN_FAKE ,
73
89
PROVIDER_SPACE ,
0 commit comments