tmcknight / Movie-and-TV-Show-Search-Alfred-Workflow

An Alfred workflow to search for a movie (or TV show) and get a few ratings
MIT License
95 stars 7 forks source link

stops searching after a couple of letters #19

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi,

I have noticed that the workflow now always changes from "Movie" or "TV" to "Google/Amazon/Wikipedia" after the first letter of the TV show or movie is entered. I am not sure what has changed to cause this. I have Python 3,9 installed and I am on a Mac mini with MacOS 12.3

[edit] I have just noticed that it says I don't have usr/bin/python installed so will check that out first...

ghost commented 2 years ago

OK, so the bug logger thingy (?) shows this as I type "movie M"

[09:05:09.342] Logging Started...
[09:05:18.182] Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E6962A89C-AE02-4EED-9E16-D2E74C1CD9C5)] Queuing argument ''
[09:05:18.276] Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E6962A89C-AE02-4EED-9E16-D2E74C1CD9C5)] Script with argv '' finished
[09:05:28.061] Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E90677662-35FF-41CB-93F4-6758357932B1)] Queuing argument 'm'
[09:05:28.082] Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E90677662-35FF-41CB-93F4-6758357932B1)] Script with argv 'm' finished
[09:05:28.082] ERROR: Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E90677662-35FF-41CB-93F4-6758357932B1)] Code 127: /Users/jameshenderson/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/5632E114-4E72-4D58-9CC6-B11A300448C4:1: command not found: python
ghost commented 2 years ago

OK, so If I change python to //usr/local/bin/python3 the error changes to:

 [09:12:28.948] ERROR: Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E90677662-35FF-41CB-93F4-6758357932B1)] Code 1: File "/Users/jameshenderson/Documents/apps/data/Alfred/Alfred.alfredpreferences/workflows/user.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0/media.py", line 44
    except AttributeError, e:
                         ^
SyntaxError: invalid syntax
ghost commented 2 years ago

or, if I change python to//usr/bin/python3 I get this error:

[09:18:12.739] ERROR: Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.65DF8A86-FB08-49D5-BE06-CA433DEE2DB0%3E90677662-35FF-41CB-93F4-6758357932B1)] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
tmcknight commented 2 years ago

Hi @jchhenderson, Thanks for the bug report. Looks like this could be related to macOS 12.3 removing python 2. I'll need to get the workflow updated for python 3 support.

In the meantime, you may be able to get it working again with these instructions: https://github.com/alfredapp/updated-third-party-python2-workflows.

vitorgalvao commented 2 years ago

Looks like this could be related to macOS 12.3 removing python 2.

It is. I was under the impression you were already aware of the Python 2 deprecation.

you may be able to get it working again with these instructions

Yep. This Workflow is already included in the list as a stop gap.

tmcknight commented 2 years ago

Appreciate it @vitorgalvao! I'm a python noob. At one point, I think I updated some syntax to work for python 3 but it broke the workflow on older macOS versions.

Are other workflow devs leaving behind python 2 support?

ghost commented 2 years ago

thanks, @tmcknight however the updated workflow does not work for mew (same problem).

vitorgalvao commented 2 years ago

Are other workflow devs leaving behind python 2 support?

No choice, really. Python 2 has reached end of life over two years ago. It is dead. Homebrew doesn’t support it, Apple doesn’t support it. The choice is to either abandon Python 2 or abandon what you’ve built.

the updated workflow does not work for mew (same problem).

You can’t simply install the Workflow, you have to follow the instructions in the repo and reinstall Python 2.

tmcknight commented 2 years ago

No choice, really. Python 2 has reached end of life over two years ago. It is dead. Homebrew doesn’t support it, Apple doesn’t support it. The choice is to either abandon Python 2 or abandon what you’ve built.

Makes sense. Looks like my dependency on alfred-workflow is the hurdle now. I'm open to removing the dependency or migrating to a better language for this workflow - just gotta find some time. I appreciate any advice you can share.

ghost commented 2 years ago

You can’t simply install the Workflow, you have to follow the instructions in the repo and reinstall Python 2.

agh sorry - I just saw a download link and didn't read the instructions - my bad.

vitorgalvao commented 2 years ago

I appreciate any advice you can share.

If you have specific questions, I’m open to answering them.

I'm open to removing the dependency or migrating to a better language for this workflow

Removing the dependency might be necessary, though there is a fork for Python 3 you may wish to try.

On your own code, you may start with 2to3 then manually fix what’s missing.

As far as alternative languages go, if you know JavaScript you can probably replicate this with JXA. That one is unlikely to be removed from macOS anytime soon, since it’s made by Apple (even if they seemingly don’t update it anymore).

LeEcHeR123 commented 2 years ago

Same problem here. Updated to the latest mac software on my Macbook Air M1 and your workflow stopped working. :-/

vitorgalvao commented 2 years ago

@LeEcHeR123 https://github.com/tmcknight/Movie-and-TV-Show-Search-Alfred-Workflow/issues/19#issuecomment-1069168759

ghost commented 2 years ago

Hi - appreciate the update but it still doesn't work for me. [07:43:39.579] ERROR: Movie and TV Show Search[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.AE636322-7A64-4DE1-A8A6-CB3067353EE2%3EB8455555-F05D-4969-83C9-5DE09914B79D)] Code 1: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

vitorgalvao commented 2 years ago

@jchhenderson That’s an issue you have locally. Try xcode-select --reset to fix it.

ghost commented 2 years ago

cheers. I actually needed: xcode-select --install