Skip to content

Commit f8a0128

Browse files
committed
fix: remove username from url only for instagram
1 parent b42f098 commit f8a0128

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
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

0 commit comments

Comments
 (0)