Open devNostyle opened 3 years ago
@devNostyle I just had this issue.
The script has a hardcoded directory which assumes that the user is running a 32-bit version of Chrome installed to the program files directory.
Find out where your chrome directory is and modify the code accordingly.. eg mine is
webbrowser.get("C:/Program Files/Google/Chrome/Application/chrome.exe %s").open(url)
@devNostyle I just had this issue.
The script has a hardcoded directory which assumes that the user is running a 32-bit version of Chrome installed to the program files directory.
Find out where your chrome directory is and modify the code accordingly.. eg mine is
webbrowser.get("C:/Program Files/Google/Chrome/Application/chrome.exe %s").open(url)
not help ... hmm rly idk how fix them.
@devNostyle I just had this issue.
The script has a hardcoded directory which assumes that the user is running a 32-bit version of Chrome installed to the program files directory.
Find out where your chrome directory is and modify the code accordingly.. eg mine is
webbrowser.get("C:/Program Files/Google/Chrome/Application/chrome.exe %s").open(url)
Already tried this solution too and it still doesn't work.
It worked for me with chrome (64bit) with the following 2 lines:
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
webbrowser.get(chrome_path).open(url)
or Firefox:
webbrowser.register('firefox', None, webbrowser.GenericBrowser('C:\Program Files\Mozilla Firefox\firefox.exe'))
webbrowser.get('firefox').open(url)
But the URL identifier code seems to be corrupt. It does not find the Amazon Associate URL in a message and sends me to an empty website with C:/Users.../Amazon Associate.
In CMD it shows me the correct URL followed by message title and channel ID: Opened https:// ...', message title | <@&CHANNEL ID>
with the following lines:
else:
if message.channel.id in channels:
if message.embeds:
for embed in message.embeds:
toembed = embed.to_dict()
if str(toembed['type']).lower() != 'link':
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',toembed['title'])
if urls:
await check_urls(urls)
try:
urls2 = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',toembed['description'])
if urls2:
await check_urls(urls2)
except:
pass
try:
for field in toembed['fields']:
urls3 = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',str(field))
if urls3:
await check_urls(urls3)
except:
pass
if message.content != '':
print(message.content)
urls4 = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',message.content)
if urls4:
await check_urls(urls4)
client.run(token,bot=False)
But in the browser I get: C:/Users.../Amazon Associate.
New messages after this come without the Opened https:// and only title + Channel ID in CMD
Seems some issue, Using PYTHON 3.7.X
Almost work, msg coming like :
but chrome not open link ... hwo fix this ? or how try use this script on firefox ? im type pip install etc.