don't fetch private urls*
This commit is contained in:
parent
617d5c6a98
commit
07793f71b1
1 changed files with 7 additions and 3 deletions
10
main.py
10
main.py
|
|
@ -119,10 +119,14 @@ class AngelBot(ClientXMPP):
|
||||||
netloc = uri.netloc
|
netloc = uri.netloc
|
||||||
if self.invidious_instances and netloc in (self.youtube_links + [youtube_link]):
|
if self.invidious_instances and netloc in (self.youtube_links + [youtube_link]):
|
||||||
self.send_youtube_info(uri, sender, mtype)
|
self.send_youtube_info(uri, sender, mtype)
|
||||||
elif ipaddress.ip_address(netloc.split(":")[0]).is_private:
|
|
||||||
return
|
return
|
||||||
else:
|
try:
|
||||||
await self.process_link(uri, sender, mtype)
|
if ipaddress.ip_address(netloc.split(":")[0]).is_private:
|
||||||
|
return
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
await self.process_link(uri, sender, mtype)
|
||||||
|
|
||||||
async def process_link(self, uri, sender, mtype):
|
async def process_link(self, uri, sender, mtype):
|
||||||
"""Process a link and send the result to the sender."""
|
"""Process a link and send the result to the sender."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue