Skip to content

Commit

Permalink
Don't crash on "t.me" without path
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Sep 26, 2024
1 parent cb4b770 commit b664183
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/telegram/search_telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ async def gather_posts(self, client, queries, max_items, min_date, max_date):
if crawl_via_links:
# t.me links
all_links = ural.urls_from_text(serialized_message["message"])
all_links = [link.split("t.me/")[1] for link in all_links if ural.get_hostname(link) == "t.me"]
all_links = [link.split("t.me/")[1] for link in all_links if ural.get_hostname(link) == "t.me" and len(link.split("t.me/")) > 1]
for link in all_links:
if link.startswith("+"):
# invite links
Expand Down

0 comments on commit b664183

Please sign in to comment.