Jump to content
targumanu

IMDb Search with Ratings

Recommended Posts

Search IMDb in Alfred with movie and TV show ratings shown as results' icons.

 
Features:
  • See movie and TV show ratings right in search results
  • When viewing indivial persons or titles, pressing Enter while the second result is selected (the one with a title's or person's name) will open a corresponding IMDb page in your default browser
  • Items with an ellipsis in their title (e.g. “Director...”) are active: Pressing Enter when they are selected will perform corresponding actions (like showing the information about a movie's director or the list of actors starring in that movie)
  • Items with “Press ⇧ to view” in their subtitles (Plot and Poster for movies and Biograghy and Photo for persons) can be viewed right in Alfred: Press Shift (the Quick Look feature must be enabled in Alfred's preferences) to Quick Look them
  • Infinite browsing. For example, you could view info about a movie, then view info about its director, open the list of movies they are known for, select one of them, see the list of actors starring in that movie... and then go back all the way to your initial search results using the “Back” option
  • Icon themes to match both light and dark Alfred themes
  • Support for search term delimiters to increase performance by waiting for user to finish typing and add a predefined character to the end of the query (disabled by default, go to workflow preferences to enable)
 
IMDb%20Search%20Screen%201.png
IMDb%20Search%20Screen%202.png
IMDb%20Search%20Screen%203.png
IMDb%20Search%20Screen%204.png
Edited by targumanu

Share this post


Link to post

Great improvements of other imdb workflows! I'm not sure if it's a bug or not - i just don't see the ratings of anything and it's a bit slow (1,5s) between searches. Amazing workflows you've shared today! 

 

I got it off Packal, btw.

 

Mavericks 10.9.4

Edited by Arthur

Share this post


Link to post

Great improvements of other imdb workflows! I'm not sure if it's a bug or not - i just don't see the ratings of anything and it's a bit slow (1,5s) between searches. Amazing workflows you've shared today! 

 

I got it off Packal, btw.

 

Mavericks 10.9.4

 

My workflow uses multiple concurrent HTML requests to get ratings, so delayed response is normal.

 

Do you get no icons at all (even for persons)? Are ratings absent only for certain titles or for all of them?

 

Could you open the Console and look for error messages for “IMDBSearch” and tell me what queries you used, so that I can reproduce the error?

Share this post


Link to post

I do get icons and occasionally a N/A icon. For persons i get a basic face-icon. 

 

So, i'm typing "i transformers" and the first result is ALWAYS a list of actors starting with T (Tori Spelling i.e.) and after a couple seconds (4-5s) it shows the results i want.

 

In my console i do a search for IMDBSearch and nothing really comes up. Anything else i can do to help you?

 

The iprefs keyword seems a bit inconsistent as well. 2/3 of the time it does a fallback search. Not sure if my mac is broken? ;)

Edited by Arthur

Share this post


Link to post

I've updated the workflow (v1.2)

 

The rating icons and workflow preferences should always appear now.

 

(The “N/A” icon means that the movie or TV show hasn't been rated yet.)

 

So, i'm typing "i transformers" and the first result is ALWAYS a list of actors starting with T (Tori Spelling i.e.) and after a couple seconds (4-5s) it shows the results i want.

 

This is the downside of multiple HTML requests: When you start typing, the workflow immediately starts searching for the first letter you entered, and Alfred waits for it to return the results. Only after the results for “T” have appeared, Alfred accepts the results for “transformers” (which you finished typing by that time) from the second instance of the workflow's command line app.

 

Unfortunately, this will always happen.

 

To avoid such behavior, you could paste the query, or add a hotkey to my workflow that would get OS X selection as the argument.

Edited by targumanu

Share this post


Link to post

Okay, that makes sense. 

 

The update fixed the ratings in the main search but there is still no rating when i action a search result (i ttxxxx..) just blank. 

 

The hotkey did the trick!

Share this post


Link to post

 

This is the downside of multiple HTML requests: When you start typing, the workflow immediately starts searching for the first letter you entered, and Alfred waits for it to return the results. Only after the results for “T” have appeared, Alfred accepts the results for “transformers” (which you finished typing by that time) from the second instance of the workflow's command line app.

 

Unfortunately, this will always happen.

 

One possible way is to use the logic implemented in this workflow http://www.alfredforum.com/topic/4636-libgen-search-and-download-pdfs-and-ebooks-from-the-library-genesis-project/#entry28261

 

It requires the user to type a period (.) after the query in order to initiate the search.

 

I think it could make sense to use same logic in all (awesome) workflows you released (this one + all the MAS/iBook/iTunes searches)

 

Just a thought

 

Thanks!

Share this post


Link to post

One possible way is to use the logic implemented in this workflow http://www.alfredforum.com/topic/4636-libgen-search-and-download-pdfs-and-ebooks-from-the-library-genesis-project/#entry28261

 

It requires the user to type a period (.) after the query in order to initiate the search.

 

Awesome idea!

 

I've updated the workflow to add support for user-defined search term delimiters (disabled by default, go to workflow preferences to enable)

Share this post


Link to post

It wouldn't work at all for me. I tried deleting the --escaped argument, and now it does.

 

Is there a reason you're not using Alfred's Escaping options? Normally for bash, you'd want Backquotes, Double Quotes, Backslashes and Dollars.

Share this post


Link to post

It wouldn't work at all for me. I tried deleting the --escaped argument, and now it does.

 

Is there a reason you're not using Alfred's Escaping options? Normally for bash, you'd want Backquotes, Double Quotes, Backslashes and Dollars.

 

 

This is a different kind of escaping. (Frankly, I'm not even sure if I should call it that :) )

"--escaped" means that, if a delimiter is set by the user, the workflow will wait for the user to enter it at the end of their query, and will not perform any searches unless the delimiter is present. I've done this to improve the workflow's performance (see previous messages in this thread).

 

Most probably, the workflow didn't work for you because of an omission in my code that prevented the workflow to properly handle situations when settings.plist used by the workflow is missing (i.e. when the user haven't changed any default settings). I've updated the workflow to fix that (v1.4.3). Please, re-download from Packal.

Share this post


Link to post

Got you. Working fine now. Great work.

 

You should probably think about using Alfred's Escape options: if someone enters a query with ", $, ` or \ in it, the workflow won't work properly.

Share this post


Link to post
You don't need to check everything. Only the options specified here.

 

No point escaping spaces in a string enclosed in quotes.

 

That said, it seems to work just fine. Great work!

Edited by deanishe

Share this post


Link to post

This is really cool. I was looking into making a better search tool for IMDB and was getting ready to use TMDB to shoe horn my way in or write a scraper.

 

Only thing I can't figure out is what does 'ii' do that 'i' doesnt?

And can I switch the keyword to 'imdb' (disabling native search too) instead of i?

Share this post


Link to post

This is really cool. I was looking into making a better search tool for IMDB and was getting ready to use TMDB to shoe horn my way in or write a scraper.

 

Only thing I can't figure out is what does 'ii' do that 'i' doesnt?

And can I switch the keyword to 'imdb' (disabling native search too) instead of i?

 

 

'ii' will search for your query right away. E.g. if you want to search for "Prometheus" and start typing, Alfred will trigger HTML requests for each letter you type, like "p", then "pr", and so on. This usually slows the things down.

 

'i' on the other hand, waits for a delimiter at the end of your query, like "/" or "." (set in the preferences), and starts a search only after you type it.

 

And yes, you can change 'i' to anything you like. (Preferably, not to 'ii' or 'iprefs', of course.)

Share this post


Link to post

Hi, hopefully someone can help me.  I can't get the workflow to work at all, and once I enabled debugging I see the following error/stack dump.  Any ideas?

 

Starting debug for 'IMDb Search'

 
[ERROR: alfred.workflow.input.scriptfilter] Code 6: 2015-01-07 11:36:54.329 IMDBSearch[58242:4864476] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff979cb64c __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x00007fff97dec6de objc_exception_throw + 43
2   CoreFoundation                      0x00007fff978a474e -[__NSArrayI objectAtIndex:] + 190
3   IMDBSearch                          0x0000000107597560 -[MMParser sectionsFrom:] + 128
4   IMDBSearch                          0x00000001075aba31 -[MMManager searchFor:] + 721
5   IMDBSearch                          0x00000001075a693e -[MMManager process:delimited:] + 686
6   IMDBSearch                          0x00000001075a36f2 main + 2850
7   libdyld.dylib                       0x00007fff940625c9 start + 1
8   ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Share this post


Link to post

 

Hi, hopefully someone can help me.  I can't get the workflow to work at all, and once I enabled debugging I see the following error/stack dump.  Any ideas?

Please, try the "escaped" version of the workflow:

  • Go to the workflow's preferences (default keyword: iprefs)
  • Set the preferred delimiter (non-alphabetic characters like "/" or "." recommended)
  • Use the keyword for the workflow block that contains "--escaped" in its code (default keyword: i)
  • Type your query followed by the delimiter (e.g. "alien/")

Give the workflow some time to return the results. (It uses multiple HTTP requests to fetch detailed info for each search result, so it will take some time depending on your Mac's performance and the speed of your Internet connection.)

Share this post


Link to post

Sadly, same problem.  I did a screen capture that may hopefully give some clues.  See http://www.screencast.com/t/pnK5DNnynZx

 

Stack trace generated during screen capture session:

 

Starting debug for 'IMDb Search'

 
[ERROR: alfred.workflow.input.scriptfilter] Code 6: 2015-01-12 20:49:24.418 IMDBSearch[22329:3059601] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff9887064c __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x00007fff98c916de objc_exception_throw + 43
2   CoreFoundation                      0x00007fff9874974e -[__NSArrayI objectAtIndex:] + 190
3   IMDBSearch                          0x000000010af03c99 -[MMParser detailedInfoForTitle:] + 569
4   IMDBSearch                          0x000000010af0cf5b __23-[MMParser titlesFrom:]_block_invoke + 2203
5   CoreFoundation                      0x00007fff987a5516 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 70
6   libdispatch.dylib                   0x00007fff91cac344 _dispatch_client_callout2 + 8
7   libdispatch.dylib                   0x00007fff91cac293 _dispatch_apply_invoke + 87
8   libdispatch.dylib                   0x00007fff91ca0c13 _dispatch_client_callout + 8
9   libdispatch.dylib                   0x00007fff91ca388f _dispatch_root_queue_drain + 935
10  libdispatch.dylib                   0x00007fff91cb1fe4 _dispatch_worker_thread3 + 91
11  libsystem_pthread.dylib             0x00007fff94dcd6cb _pthread_wqthread + 729
12  libsystem_pthread.dylib             0x00007fff94dcb4a1 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Share this post


Link to post

 

Sadly, same problem.  I did a screen capture that may hopefully give some clues.  See http://www.screencast.com/t/pnK5DNnynZx

 

Stack trace generated during screen capture session:

 

Starting debug for 'IMDb Search'

 
[ERROR: alfred.workflow.input.scriptfilter] Code 6: 2015-01-12 20:49:24.418 IMDBSearch[22329:3059601] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff9887064c __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x00007fff98c916de objc_exception_throw + 43
2   CoreFoundation                      0x00007fff9874974e -[__NSArrayI objectAtIndex:] + 190
3   IMDBSearch                          0x000000010af03c99 -[MMParser detailedInfoForTitle:] + 569
4   IMDBSearch                          0x000000010af0cf5b __23-[MMParser titlesFrom:]_block_invoke + 2203
5   CoreFoundation                      0x00007fff987a5516 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 70
6   libdispatch.dylib                   0x00007fff91cac344 _dispatch_client_callout2 + 8
7   libdispatch.dylib                   0x00007fff91cac293 _dispatch_apply_invoke + 87
8   libdispatch.dylib                   0x00007fff91ca0c13 _dispatch_client_callout + 8
9   libdispatch.dylib                   0x00007fff91ca388f _dispatch_root_queue_drain + 935
10  libdispatch.dylib                   0x00007fff91cb1fe4 _dispatch_worker_thread3 + 91
11  libsystem_pthread.dylib             0x00007fff94dcd6cb _pthread_wqthread + 729
12  libsystem_pthread.dylib             0x00007fff94dcb4a1 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

 

 

 

I was able to reproduce this error in the "non-delimited" mode. (Although in my case, the workflow was able to recover and return search results after a couple seconds.)

 

I thought I'd eliminated all issues with MMParser crashing when a movie's page lacks some data (e.g. poster or director info), but apparently, there's still work to do. I'll try to fix it when I have some free time.

 

Meanwhile, please, remove the workflow from Alfred, and re-download it from Packal (to make sure that you have the latest version with most MMParser issues fixed).

Edited by targumanu

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...