dennis-tra / alfred-dict.cc-workflow

🌍 Alfred 4/5 workflow to get translations from dict.cc
137 stars 4 forks source link

Error in workflow 'universal.dict.cc' #6

Closed maxfeulner closed 3 years ago

maxfeulner commented 3 years ago

Hi Guys, yesterday I noticed that my dict.cc workflow is no longer working, since I use it almost daily, I would be grateful if someone can help me. I am using Mac OS 10.14.6 and alfred 4.5.1. The following error message is always displayed.

Bildschirmfoto 2021-10-05 um 09 25 51
dennis-tra commented 3 years ago

Hi @maxfeulner, this looks like a temporary problem on dict.cc's side :/ do you still see the error? I can't reproduce the problem.

maxfeulner commented 3 years ago

Hi @dennis-tra, the error still exists. I have also reinstalled the workflow but still the same. Do i need any homebrew formulae running in the background?

thank you for your quick feedback

dennis-tra commented 3 years ago

Do i need any homebrew formulae running in the background? That's not necessary.

What happens when you browse to https://www.dict.cc/ ? Does your browser also show a warning message? The workflow is basically just requesting the content of that site and parses the HTML. So I would assume that the browser should also show a warning if the workflow shows a warning.

maxfeulner commented 3 years ago

What happens when you browse to https://www.dict.cc/ ? Does your browser also show a warning message?

The browsers are opening the site without any error.

dennis-tra commented 3 years ago

Hmm, I actually don't know what could be wrong there tbh :/ Maybe the debug output will provide useful information

Screenshot 2021-10-07 at 12 58 11

?

You can see the bottom output when you click on the bug in the top right corner.

maxfeulner commented 3 years ago

Maybe the debug output will provide useful information

Hi Dennis, here are the informations

Bildschirmfoto 2021-10-07 um 13 26 03
klangfuchs commented 3 years ago

I have the same error on macOS High Sierra. Strangely on Big Sur this error did not happen.

Maybe it has something to do with older python versions of macOS not handling SSL certificates?

I found this advice in another alfred workflow topic on github:

WARNING: As this module is based on Python 2's standard HTTP libraries, on old versions of OS X/Python, it does not validate SSL certificates when making HTTPS connections. If your workflow uses sensitive passwords/API keys, you should strongly consider using the requests library upon which the web.py API is based.

https://github.com/deanishe/alfred-workflow

klangfuchs commented 3 years ago

I found a solution by installing the latest python2.7 on High Sierra: https://www.python.org/downloads/release/python-2718/ and then changing the script filter of the Dict.cc workflow to the path of this new python version:

Bildschirmfoto 2021-10-27 um 16 37 59

QUERY=$(iconv -f UTF8-MAC <<<'{query}') /usr/local/bin/pythonw dictcc_workflow.py $QUERY

I found this path in the preferences of the python launcher app:

Bildschirmfoto 2021-10-27 um 16 35 50

I'm no coder, so maybe there is even a simpler solution or you can even use the newer python 3 to execute the dict.cc workflow...

maxfeulner commented 3 years ago

I found a solution by installing the latest python2.7 on High Sierra: https://www.python.org/downloads/release/python-2718/ and then changing the script filter of the Dict.cc workflow to the path of this new python version: Bildschirmfoto 2021-10-27 um 16 37 59

QUERY=$(iconv -f UTF8-MAC <<<'{query}') /usr/local/bin/pythonw dictcc_workflow.py $QUERY

Yes great this is working. thank you @klangfuchs :)

klangfuchs commented 3 years ago

Nice! I think you can close the issue then :)