Jump to content

Recommended Posts

Movie and TV Show Search

Search for movies or tv shows and get general info and ratings from various sites.

 

example.gif

 

Features

  • Get movie/tv show runtime, genre, MPAA rating
  • Get ratings from IMDb, Rotten Tomatoes, Metacritic (if available)
  • Show a link to a trailer (if available)
  • Show a few credits

 

Download

Get the workflow from Packal or GitHub.

 

Usage

  • Type 'movie' and the title you'd like to search for. Select item (ENTER) to get movie info.
  • Type 'tv' and the title you'd like to search for. Select item (ENTER) to get show info.

 

Thanks

 

Changelog

For more recent changes, see the GitHub releases page.

 

2.6 (2017-11-27)
Big thanks to @vitor for implementing the following enhancements:
- Add support for OneUpdater
- Move OMDb API key to workflow environment variables

 

2.5 (2017-11-27)

- Added free OMDb API key

 

2.3 (2015-07-30)

- Add RottenTomatoes audience score

 

2.2 (2015-05-01)

- Open YouTube trailer (if available) when choosing to search all rating sites

- Friendly message when internet connection isn't working properly
 

2.1 (2015-01-28)

- added menu item to search all rating sites at once
- added script behaviour queue delay (requires Alfred 2.6 or higher)
- fixed rotten tomatoes search
 

2.0 (2015-01-20)

- added tv show search

- fixed issue with quick look not working for some items
- removed tiny poster icon (didn't like the squishing and there was an issue with caching the icon in Alfred)
 

1.3 (2015-01-16)

- removed argparse reference (and setting personal TMDb API key functionality)

- updated alfred-workflow library to latest (v1.11.0)

- fix/tidy up string encoding issues

- error handling fixes

 

1.2 (2015-01-11)

- show tiny poster in movie details listing

- generate sexy html file for when first item in details listing is selected

- add fallback search item (must be added manually in Alfred preferences > Features > Default Results > Setup fallback results)

 

1.1 (2015-01-10)

- Add default TMDb API key

 

1.0 (2015-01-10)

- Initial release

 

This workflow is released under the MIT Licence.

Edited by tone
New version
Link to comment

This looks really good and for a moment I was excited to see it, thinking even I could retire my own workflow to check Rotten Tomatoes. Especially since, like you, I’d like a workflow that would check ratings in Rotten Tomatoes, IMDB, and Metacritic.

 

I realise it’s a long shot, but I’d like to ask if you’d release this workflow with an embedded API key, though. Their API key form is ludicrous on the same level of Rotten Tomatoes’ one. Not only is the amount of information they want on you borderline unreasonable, I can’t even apply with a perfectly valid address, because they claim it isn’t.

 

Like I said, this does look really good, but however good or fast it is means absolutely nothing if we can’t actually use it.

Link to comment

Hi Vitor,

 

It's been so long since I got my API key from TMDb. I went to see for myself and I see what you mean - the amount of info they want is crazy. Don't think I had to fill all that back when I signed up.

 

I've uploaded a new version of the workflow with my TMDb API key baked in.

Link to comment

Thank you very much, tone, I greatly appreciate it.

I’ve already tried it on a couple of movies, and it is indeed crazy fast. Great work! Over time I’ve used a bunch of workflows for getting movie ratings, and I can say this one is hands down my favourite, by a long shot.

Again, thank you.

Link to comment

Vitor, Thank you for your kind words.

 

And thank you for all that you've contributed to this community. This is my first workflow that I threw together and I couldn't have done it without using your (and others') workflows as examples of how it's done.

Link to comment

The python in Snow Leopard is 2.6, while the one in Yosemite is 2.7. I suspect therein lies the problem. This may be something you don’t even have much control over, tone, as the restriction might be in deanishe’s library.

I recommend, Shouthgirl, that you install homebrew1 (find the command at the bottom of the page, that you’ll have to paste into a terminal and run), and install python (brew install python in that same terminal). After that, go into the workflow and on the movies node change python to /usr/local/python. It should then work, if indeed the problem is the version. There are other ways to do it, but this should be the most straightforward and safest way.

——————————

1 Not sure it works on Snow Leopard, anymore.

Link to comment

Hi Southgirl, I'm afraid I've only tested with 10.10 (and I don't have access to a 10.6 system to test on). I'm not too knowledgable in Python, but perhaps if you debug the workflow in Alfred preferences and paste the results here, I might be able to figure out how to fix the issue. Thanks.

 

Just downloaded it. As soon as I type the first letter of the title, I get the standard Google search instead. Any idea why? I'm on 10.6.

 

 

Awesome workflow!

 

Alfred-Workflow should work on Python 2.6 (I don't think I used any 2.7+ features), however the argparse library used by the workflow isn't available by default in 2.6. This is probably why the workflow is failing silently for Southgirl: the import statement is outside the call to Workflow.run(), which is supposed to catch, log and display errors.

 

Even installing 2.7 via homebrew or bundling argparse with the workflow won't fix the workflow, however, as the keychain API it uses to store API keys (Workflow.save_password() and Workflow.get_password()) don't work on 10.7 and earlier because the security CLI program doesn't support the required options on those systems.

 

Sorry :(

Edited by deanishe
Link to comment

I've been having a poke around the code and have a couple of observations:

  • In line 77 of movies.py, don't do urllib.quote(query). All the parameters will be quoted for you by web.get(), but more importantly, query is a Unicode string and urllib.quote() chokes on Unicode (yay Python!). If you enter a non-ASCII query, say, "Amélie", you get an error. If you just pass query, instead of quoting it, everything works properly.
  • The workflow mixes encoded and Unicode strings a lot. Everything you get from Alfred-Workflow (in particular wf.args and data from web.Response.json()) will be Unicode, but almost all the literal strings in the source are ASCII strings. I don't think it's likely to cause any issues in this workflow, but you should try to avoid mixing Unicode and byte strings. As you say you're not too familiar with Python, this might be helpful.
  • In extract_popularity(result), you can shorten the whole if-key-exists-return-value-else-return-X thing to result.get('popularity', '0').
Link to comment

Thanks deanishe! Very valuable info (your documentation is excellent). I appreciate you looking through the code. I've made the various changes you've suggested and will include it in the next release.

 

Apart from people building super-cool workflow with the library (obviously), it's comments like this that make it all worth doing. Thanks very much, and I'm very glad to hear the docs are useful.

Edited by deanishe
Link to comment

FWIW, the latest version of Alfred-Workflow (1.11.0) should fully support Python 2.6 and OS X 10.6+ (including Keychain).

 

If you want the workflow to run on Snow Leopard, there's still the argparse issue. You could include it with your workflow. I'm a big fan of docopt for command-line arguments. argparse is better for some situations, however.

Link to comment

FWIW, the latest version of Alfred-Workflow (1.11.0) should fully support Python 2.6 and OS X 10.6+ (including Keychain).

Nice! I'll update Alfred-Workflow to the latest version.

 

If you want the workflow to run on Snow Leopard, there's still the argparse issue. You could include it with your workflow. I'm a big fan of docopt for command-line arguments. argparse is better for some situations, however.

I'll remove argparse as this was only used for setting a personal TMDb API key (something I doubt anyone will do).

 

Hopefully these changes will allow the workflow to be run on 10.6. Thanks again for your tips/help!

Edited by tone
Link to comment

This is a great workflow.   Very similar to another one but I like the Rotten Tomatoes and Metacritic fields.  However it would be nice if this one included the plot field that the other workflow included.  

Edited by mikedvzo
Link to comment

This is a great workflow.   Very similar to another one but I like the Rotten Tomatoes and Metacritic fields.  However it would be nice if this one included the plot field that the other workflow included.  

 

 

Hi mikedvzo, You can get to the plot fairly quickly by pressing shift (quick look) on the top item. This will show a custom html file with the movie details (along with a poster/background art if available).

Link to comment

Nice! I'll update Alfred-Workflow to the latest version.

 

I'll remove argparse as this was only used for setting a personal TMDb API key (something I doubt anyone will do).

 

Hopefully these changes will allow the workflow to be run on 10.6. Thanks again for your tips/help!

 

Thank you so much to everyone who replied to me. I just downloaded the latest update and it's working wonderfully on 10.6.

 

I do have a question, tone, this workflow does not work with TV series, right?

Link to comment

Thank you so much to everyone who replied to me. I just downloaded the latest update and it's working wonderfully on 10.6.

 

I do have a question, tone, this workflow does not work with TV series, right?

Glad it's working for you now!

 

This workflow is for searching movies only. It shouldn't be too difficult to do something similar for TV shows. Stay tuned.  :)

Link to comment

Hi smarg19. I like the idea! Thanks. A few questions/comments:

- Any examples of how to use the Viewer app in a workflow? I've tried some things using an Applescript action, but I wasn't able to get it to work.

- Is GateKeeper an issue when the viewer app is first run from an Alfred script?

- I kind of like the current quick-look functionality (SHIFT key) because Alfred remains active.

Link to comment

Hi smarg19. I like the idea! Thanks. A few questions/comments:

- Any examples of how to use the Viewer app in a workflow? I've tried some things using an Applescript action, but I wasn't able to get it to work.

- Is GateKeeper an issue when the viewer app is first run from an Alfred script?

- I kind of like the current quick-look functionality (SHIFT key) because Alfred remains active.

My Spritzr workflow uses it extensively. But I can't get the Shift key thing to work right I guess. I have to press Shift + Enter and then Safari loads the HTML file. In this mode, Alfred dies. Is there some way to do it differently?

Link to comment

My Spritzr workflow uses it extensively. But I can't get the Shift key thing to work right I guess. I have to press Shift + Enter and then Safari loads the HTML file. In this mode, Alfred dies. Is there some way to do it differently?

Thanks for pointing me to Spritzr. Cool workflow!

 

Not sure why the Shift quick-look functionality isn't working. If you go to the workflow folder in finder and find the movie.html file, are you able to quick-look it from there (using the spacebar)? Also, what version of OS X are you using?

 

I seem to have some mixed results as well with quick look and urls. For example, I can use it on the top result (for the custom movie.html file), IMDb, Metacritic and YouTube but for some reason, I can't get it to show up for Rotten Tomatoes.

Link to comment

You can simply press (not ⇧↩, just ) or ⌘Y on the top item (the name of the movie, with the poster), smarg19. It’s the standard Alfred quicklook feature. No need to complicate it with other apps.

On another note, found a small bug, tone. If you search for multiple movies without dismissing the Alfred window between queries, the movie poster image (on the first result) gets stuck on the first one. All the other information seems to be updated correctly, though, including the html page.

xeRJTxn.gif

Link to comment

You can simply press (not ⇧↩, just ) or ⌘Y on the top item (the name of the movie, with the poster), smarg19. It’s the standard Alfred quicklook feature. No need to complicate it with other apps.

On another note, found a small bug, tone. If you search for multiple movies without dismissing the Alfred window between queries, the movie poster image (on the first result) gets stuck on the first one. All the other information seems to be updated correctly, though, including the html page.

 

 

I agree. I'd like to keep things simple with this workflow. It seems that smarg19 is having issues with the standard quicklook feature. I'll look into this a bit more to see if I can figure anything out.

 

Thanks for the bug report. I actually found this and fixed it. It'll be fixed in the next release. To fix it, I actually removed the poster icon. I didn't really like how it was squished anyway.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...