Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Issue #4

Open
StarLordRammi opened this issue Mar 1, 2021 · 9 comments
Open

# Issue #4

StarLordRammi opened this issue Mar 1, 2021 · 9 comments

Comments

@StarLordRammi
Copy link

if a link has "#" in it, that links doesnt work correctly.

@ryanthom139
Copy link

change the regex on lines 64 and 70 to "(?:(?:https?|ftp)://)?[\w/-?=%.#&+]+.[\w/-?=%.#&+]+"

@pedrorq
Copy link

pedrorq commented Mar 2, 2021

Better, but now it cuts links on "-"

"(?:(?:https?|ftp)://)?[\w/-?=%.#&+-]+.[\w/-?=%.#&+-]+" would fix this I think

@StarLordRammi
Copy link
Author

that worked, thank you.
instead of making new thread, i wanted to ask if its possible to add permanenet keywords? or load them form a file instead of typing them everytime when the script is ran?

@pedrorq
Copy link

pedrorq commented Mar 4, 2021

You should be able to replace

keywords = list(map(str,input("Enter keywords seperated by space: ").split()))

with

keywords = ['keyword1','keyword2','keyword 3 4 5']

@StarLordRammi
Copy link
Author

You should be able to replace

keywords = list(map(str,input("Enter keywords seperated by space: ").split()))

with

keywords = ['keyword1','keyword2','keyword 3 4 5']

thanks again.
what about if you dont want any blocklist and wanna skip it?

@pedrorq
Copy link

pedrorq commented Apr 9, 2021

You should be able to replace
keywords = list(map(str,input("Enter keywords seperated by space: ").split()))
with
keywords = ['keyword1','keyword2','keyword 3 4 5']

thanks again.
what about if you dont want any blocklist and wanna skip it?

You can just remove this line:

blacklist = list(map(str,input("Enter blacklisted keywords seperated by space: ").split()))

And then replace

if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):

with

if any(x in url.lower() for x in keywords):

@StarLordRammi
Copy link
Author

getting this error

Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\xxx\Desktop\open.py", line 54, in on_message
    if len(blacklist) > 0:

@StarLordRammi
Copy link
Author

You should be able to replace
keywords = list(map(str,input("Enter keywords seperated by space: ").split()))
with
keywords = ['keyword1','keyword2','keyword 3 4 5']

thanks again.
what about if you dont want any blocklist and wanna skip it?

You can just remove this line:

blacklist = list(map(str,input("Enter blacklisted keywords seperated by space: ").split()))

And then replace

if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):

with

if any(x in url.lower() for x in keywords):

the following also needed removing

if len(blacklist) > 0: print('Ignoring keywords {}.\n'.format(', '.join(blacklist))) else: print('No keywords currently blacklisted.\n')

@StarLordRammi
Copy link
Author

Better, but now it cuts links on "-"

"(?:(?:https?|ftp)://)?[\w/-?=%.#&+-]+.[\w/-?=%.#&+-]+" would fix this I think

this does not open the following link correctly:
https://www.cclonline.com/product/336566/ZT-A30800F-10P/Graphics-Cards/ZOTAC-GAMING-GeForce-RTX-3080-AMP-Holo-10GB-Graphics-Card/VGA5974/

above links opens as
https://www.cclonline.com/product/336566/ZT-A30800F-10P/
and that gives page not found error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants