Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 07fc11b

Browse files
committed
Provider arts culture
1 parent 32aaae1 commit 07fc11b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ TELEGRAM_PROFILELESS_API_SESSION=<string>
4646

4747
Provider | Source
4848
--- | ---
49+
arts-culture | https://source.unsplash.com/featured/?arts-culture
4950
cat-fake | https://thiscatdoesnotexist.com
5051
human-fake | https://thispersondoesnotexist.com/image
5152
space | https://source.unsplash.com/featured/?space

src/updater.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from telethon.tl.functions.account import UpdateProfileRequest
1010
from telethon.tl.functions.photos import DeletePhotosRequest, UploadProfilePhotoRequest
1111

12+
PROVIDER_ARTS_CULTURE = 'arts-culture'
1213
PROVIDER_CAT_FAKE = 'cat-fake'
1314
PROVIDER_HUMAN_FAKE = 'human-fake'
1415
PROVIDER_SPACE = 'space'
@@ -23,6 +24,18 @@ class Profile:
2324
about: str = None
2425

2526

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+
2639
async def create_profile_cat_fake() -> Profile:
2740
async with ClientSession() as session:
2841
async with session.get(url='https://thiscatdoesnotexist.com') as response:
@@ -60,14 +73,17 @@ async def create_profile_space() -> Profile:
6073

6174

6275
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:
6479
return await create_profile_cat_fake()
6580
elif provider == PROVIDER_HUMAN_FAKE:
6681
return await create_profile_human_fake()
6782
elif provider == PROVIDER_SPACE:
6883
return await create_profile_space()
6984
elif provider == PROVIDER_RANDOM:
7085
return await create_profile(random.choice([
86+
PROVIDER_ARTS_CULTURE,
7187
PROVIDER_CAT_FAKE,
7288
PROVIDER_HUMAN_FAKE,
7389
PROVIDER_SPACE,

0 commit comments

Comments
 (0)