HowTo: Lookup movie name on IMDB from Thunar

Post Reply
Message
Author
1john8989
Posts: 10
Joined: Tue May 22, 2018 4:37 pm

HowTo: Lookup movie name on IMDB from Thunar

#1 Post by 1john8989 »

Going back and forth from thunar to firefox is just a PITA. So I was able to make a 'custom action' (App) that calls a script that loops through all the submitted filenames and shows each movie in a separate IMDB browser tab(if you use tabs)(you should use tabs).

WARNING: I use the following file-naming convention in Thunar. It must be followed for this App to work! Note that everything after the Movie.Name.Name.Name is dropped for searching IMDB. That includes .[year][genre][source].(or anything you want) and the extension.

Code: Select all

Movie.Name.[year][genre][source].mkv
----------

Install surfraw and surfraw-extra.

Code: Select all

$ sudo apt-get install surfraw surfraw-extra
The default settings are fine and should open your default browser window(tab). But, you can configure surfraw to open a different browser. Surfraw is pretty powerful, check out the website. That Julian Assange, who is still living in someone's embassy, used it in his exploits.
----------

Create the script (<path to bin>/imdball.sh):

Code: Select all

#!/bin/bash

# imdball.sh
# assigns the variable from Thunar custom action 'IMDB search '

m=$(basename "$1")

# loops through each filename
# renames file so it drops .[ and after, including file extension.
# surfraw does the actual terminal lookup on imdb.  Install surfraw, surfraw-extra and configure as needed (https://www.ostechnix.com/surfraw-commandline-interface-popular-search-engines-100-websites/)

for m
do
  name="${m%.[*}"
  surfraw imdb "$name"
done  
Make the script executable
----------

Create the Custom Action:

Thunar > Edit > 'Create Custom Action' and click '+' button to create a new custom action.

---Basic TAB---
Name: IMDB search
Description: Searches IMDB for submitted movies
Command: <path to bin>/imdball.sh %N
Icon: up to you, choose one, I used a faded out VLC icon down near the bottom.

---Appearance Conditions TAB---
File Pattern: *
Enable Video Files checkbox

Click OK Button to save/exit

If done correctly, you will now have the 'IMDB search' option available when you right-click any number of selected movie filenames in Thunar.
----------

UR DONE!!! Choose your file(s), right-click and choose the IMDB search option from the menu.
Last edited by 1john8989 on Tue Mar 19, 2019 3:20 pm, edited 2 times in total.

User avatar
Jerry3904
Administrator
Posts: 21881
Joined: Wed Jul 19, 2006 6:13 am

Re: HowTo: Lookup movie name on IMDB from Thunar

#2 Post by Jerry3904 »

Nice one! Gotta try that out...
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

1john8989
Posts: 10
Joined: Tue May 22, 2018 4:37 pm

Re: HowTo: Lookup movie name on IMDB from Thunar

#3 Post by 1john8989 »

That's great, Jerry, I hope it works for you. All feedback is welcome! I have searched thirty movies (files) at once with zero problems as each opens in it own Firefox tab.

I'm basically using Thunar as my movie manager. As I learn more coding I'm gonna be adding to create a suite of tools.

Post Reply

Return to “XFCE Desktop Environment”