Skip to content

Commit d255788

Browse files
authored
Merge pull request #100 from ovchynnikov/dev
fix: remove username from url only for insta
2 parents b42f098 + 5ee6bc2 commit d255788

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ def clean_url(message_text: str) -> str:
123123
# Split by space and take the first part (the URL)
124124
url = url.split()[0]
125125

126-
# Remove any @username from the end of the URL
127-
url = url.split('@')[0]
126+
# Remove any @username from the end of the URL only if it's an Instagram URL
127+
if "instagram.com" in url:
128+
url = url.split('@')[0]
128129

129130
return url
130131

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ python-telegram-bot[ext]==22.0
22
python-dotenv==1.1.0
33
yt-dlp==2025.3.31
44
gallery-dl==1.29.4
5-
aiohttp==3.9.3
5+
aiohttp==3.11.18

0 commit comments

Comments
 (0)