Difference between revisions of "Tmdb.pl"

From MythTV Official Wiki
Jump to: navigation, search
(Recommended copy/pasting directly to a terminal window.)
(Update instructions to include configuration for MythWeb (now that #6390 has been committed))
Line 2: Line 2:
  
 
= What is tmdb.pl =
 
= What is tmdb.pl =
This perl script is intended to perform movie data lookups based on the themoviedb.org website
+
This perl script is intended to perform movie data lookups based on the themoviedb.org website.
  
  
Line 13: Line 13:
 
pushd tmdb &&
 
pushd tmdb &&
 
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/tmdb.pl > tmdb.pl &&
 
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/tmdb.pl > tmdb.pl &&
 +
echo "Successfully downloaded tmdb.pl." &&
 
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV/MythVideoCommon.pm > MythTV/MythVideoCommon.pm &&
 
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV/MythVideoCommon.pm > MythTV/MythVideoCommon.pm &&
 +
echo "Successfully downloaded MythVideoCommon.pm." &&
 
chmod 755 ./tmdb.pl ./MythTV/MythVideoCommon.pm &&
 
chmod 755 ./tmdb.pl ./MythTV/MythVideoCommon.pm &&
 
popd
 
popd
Line 29: Line 31:
 
else
 
else
 
   echo "Unable to find script directory.  Please install tmdb.pl manually."
 
   echo "Unable to find script directory.  Please install tmdb.pl manually."
fi
+
fi  
 
sudo cp -Rv tmdb/* ${SCRIPTDIR} &&
 
sudo cp -Rv tmdb/* ${SCRIPTDIR} &&
 
if [ -e ${SCRIPTDIR}/tmdb.pl ]; then
 
if [ -e ${SCRIPTDIR}/tmdb.pl ]; then
 
   echo "Successfully installed tmdb.pl script to:"
 
   echo "Successfully installed tmdb.pl script to:"
   echo "  ${SCRIPTDIR}."
+
   echo "  ${SCRIPTDIR}"
   unset SCRIPTDIR
+
  if [ -e ${SCRIPTDIR}/imdb.pl ]; then
 +
    sudo mv ${SCRIPTDIR}/imdb.pl{,-orig}
 +
  fi
 +
  sudo ln -s tmdb.pl ${SCRIPTDIR}/imdb.pl &&
 +
  if [ -L ${SCRIPTDIR}/imdb.pl ]; then
 +
    echo "Successfully configured MythVideo and MythWeb to use tmdb.pl."
 +
   else
 +
    echo "Unable to configure MythVideo and MythWeb to use tmdb.pl."
 +
    echo "Please create a symlink called imdb.pl that refers to tmdb.pl in"
 +
    echo "  ${SCRIPTDIR}"
 +
  fi
 
else
 
else
 
   echo "Unable to install tmdb.pl script.  Please install tmdb.pl manually."
 
   echo "Unable to install tmdb.pl script.  Please install tmdb.pl manually."
 
fi
 
fi
 +
unset SCRIPTDIR
 
</pre>
 
</pre>
  
Line 44: Line 57:
 
<pre>
 
<pre>
 
rm -r tmdb
 
rm -r tmdb
</pre>
 
 
= Configuring MythVideo 0.21-fixes to use tmdb.pl =
 
 
Change the MythVideo settings to use the new script, replacing <code>imdb.pl</code> with <code>tmdb.pl</code> and removing <code>tv=no;video=no</code> from the <code>Command to search for movie listings:</code>.
 
 
Using the default menu theme, you can find the settings in <code>Utilities/Setup|Setup|Media Settings|Videos Settings|General Settings</code> on page 4/7.  After making the changes, the settings should look like:
 
 
<pre>
 
Command to search for movie listings: /usr/share/mythtv/mythvideo/scripts/tmdb.pl -M
 
Command to search for movie posters: /usr/share/mythtv/mythvideo/scripts/tmdb.pl -P
 
Command to extract data for movies: /usr/share/mythtv/mythvideo/scripts/tmdb.pl -D
 
 
</pre>
 
</pre>

Revision as of 20:27, 4 April 2009

Important.png Note: The correct title of this article is tmdb.pl. It appears incorrectly here due to technical restrictions.


What is tmdb.pl

This perl script is intended to perform movie data lookups based on the themoviedb.org website.


Downloading tmdb.pl

If you're using MythTV 0.21-fixes, tmdb.pl does not ship with MythTV, so you will need to download the script (as a non-root user in a normal directory, such as the user's HOME directory). Do so by copying/pasting the following commands directly into a terminal window:

install -d tmdb/MythTV &&
pushd tmdb &&
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/tmdb.pl > tmdb.pl &&
echo "Successfully downloaded tmdb.pl." &&
svn cat http://svn.mythtv.org/svn/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV/MythVideoCommon.pm > MythTV/MythVideoCommon.pm &&
echo "Successfully downloaded MythVideoCommon.pm." &&
chmod 755 ./tmdb.pl ./MythTV/MythVideoCommon.pm &&
popd

Installing tmdb.pl

The MythVideo scripts are typically installed in /usr/share/mythtv/mythvideo/scripts/ or /usr/local/share/mythtv/scripts/. The following code assumes they are installed in one of those two directories. If not, adjust the SCRIPTDIR as appropriate (and skip the if conditional that tries to set it automatically). To use the code below, copy/paste the following commands directly into the same terminal window you used for downloading the script, above:

if [ -d /usr/share/mythtv/mythvideo/scripts ]; then
  SCRIPTDIR=/usr/share/mythtv/mythvideo/scripts
elif [ -d /usr/local/share/mythtv/mythvideo/scripts ]; then
  SCRIPTDIR=/usr/local/share/mythtv/mythvideo/scripts
else
  echo "Unable to find script directory.  Please install tmdb.pl manually."
fi 
sudo cp -Rv tmdb/* ${SCRIPTDIR} &&
if [ -e ${SCRIPTDIR}/tmdb.pl ]; then
  echo "Successfully installed tmdb.pl script to:"
  echo "  ${SCRIPTDIR}"
  if [ -e ${SCRIPTDIR}/imdb.pl ]; then
    sudo mv ${SCRIPTDIR}/imdb.pl{,-orig}
  fi 
  sudo ln -s tmdb.pl ${SCRIPTDIR}/imdb.pl &&
  if [ -L ${SCRIPTDIR}/imdb.pl ]; then
    echo "Successfully configured MythVideo and MythWeb to use tmdb.pl."
  else
    echo "Unable to configure MythVideo and MythWeb to use tmdb.pl."
    echo "Please create a symlink called imdb.pl that refers to tmdb.pl in"
    echo "  ${SCRIPTDIR}"
  fi 
else
  echo "Unable to install tmdb.pl script.  Please install tmdb.pl manually."
fi
unset SCRIPTDIR

When you're done with the temporary copy made when downloading the scripts, you may delete the tmdb directory:

rm -r tmdb