Page 1 of 1

tw-video-scraper: Download fanart thumbnail for video

Posted: Fri Dec 09, 2011 10:42 pm
by 505
In an earlier post I explained how to set up thumbnail generation using ffmpeg. However, one of the problems of using ffmpeg is that it takes a snapshot of the video file at a fixed time, for example at 30 seconds. For both movies and series this can be a problem. If there are opening credits, the thumbnail will display that. This might not be a very meaningful thumbnail for the video file.

For a lot of movies and series there is fan art on the internet. tw-video-scraper is a Python script that tries to get the fan art thumbnail for a video file. If no thumbnail can be found, ffmpeg is used to generate a thumbnail.

For series, a screenshot thumbnail is downloaded from TheTVDB.com
For movies, the movie poster is downloaded from TheMovieDB.org

tw-video-scraper is a script that is placed in Twonky's cgi-bin directory. Twonky will call the script automatically to try to download the thumbnail. This script completely replaces the ffmpeg script that is shipped with Twonky. That script should be disabled.

The script is fully working, but I hope to improve it further. I also invite others to submit improvements.
If you find any bug, or want to request new features, please use the GitHub bug tracker.

The script can be downloaded from the GitHub page: https://github.com/danielvijge/tw-video-scraper
Detailed information and set up instruction can be found at the project homepage: http://server.vijge.net/tw-video-scraper/

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Mon Jan 23, 2012 12:38 am
by ceasar
could you explain how to get this working on windows 7?

i copied the files and made them executable but im guessing there is more work to be done before its starts working

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Tue Jan 24, 2012 10:16 am
by 505
It was more or less written for my Debian/Linux server, so all the file location are set to the Linux defaults. My work laptop is Windows 7, so I just tried it, and could get it working. There is some editing of the files required. Sorry, not a one-click install for this one. Here are the the instructions to get it working. I'll update my site to include these instructions.
  1. Install Python. Although this is an older version of Python, it is closest to the version on Debian. If you already have a newer version, that one might work too.
  2. If you also want to generate thumbnails if no thumbnail could be found, install ffmpeg too.
  3. Download the script from the project page. On the left, click on the ZIP button to download everything at once.
  4. Extract from the zip file the files python-tw-video-scraper.desc, python.location, and tw-video-scraper.py to a temporary location, e.g. your desktop.
  5. Open the file python.location and change it to the path where Python is installed. In the default case C:/Python27 This should just be the directory, NOT the whole path name including python.exe.
  6. Open the file 'python-tw-video-scraper.desc' and change /usr/local/twonkymedia/cgi-bin/tw-video-scraper.py to "C:\Program Files (x86)\TwonkyMedia\cgi-bin\tw-video-scraper.py" (with quotes around it, because the path contains a space; replace the path if Twonky is installed somewhere else).
  7. Open the file tw-video-scraper.py and make some changes there:
    • Change the location of the database to c:\tmp\tw-video-scraper\tw-video-scraper.db. You can choose any directory you want, just make sure the script has write access.
    • Change the location of the tmpdir to c:\tmp\tw-video-scraper\. Again, you can choose any directory.
    • Change the location of the generatecommand. Replace ffmpeg with the full path to ffmpeg, e.g. "C:\Program Files (x86)\ffmpeg\bin\ffmpeg.exe"
  8. Make sure Twonky is stopped
  9. Copy the three files to C:\Program Files (x86)\TwonkyMedia\cgi-bin
  10. Restart Twonky
  11. Browse using the Flash browser, or using a television that supports thumbnails.
That should be enough to get it working. If, during editing of a file in Notepad, you see everything on one line, get a better text editor. I recommend Notepad++, although the with Windows included WordPad also works.

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Thu Mar 08, 2012 2:51 pm
by 505
I updated the script a little. It's now easier to set up under Windows, and works both with Python 2.7.x and Python 3.2.x. See my site or Github for instructions. At Github, you can download the latest version.

If you haven't seen it, below two screen shots from the Flash browser with downloaded thumbnails:
Image
Image

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Thu Mar 08, 2012 4:43 pm
by RayX9500
The best solution is to use embedded posters in the files metadata

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Thu Mar 08, 2012 4:53 pm
by 505
RayX9500 wrote:The best solution is to use embedded posters in the files metadata
I actually tend to disagree with that. First of all, when embedding media in the file, you have to embed it in every file. For a music album, this takes up extra space, and makes changing the art work less easy then just replacing an external file. And second, I do not want a script to automatically update any media file I have. There is always a chance that something goes wrong, and the file becomes corrupt.

My script is completely automated, and the original files are not touched, so no risks. And the things I download do not have embedded media, so it would mean manual work.

Re: tw-video-scraper: Download fanart thumbnail for video

Posted: Wed Mar 14, 2012 5:09 am
by phibertron
@505

You know that is a valid point, in that it is possible to introduce file corruption, with tagging etc
Which is why I so wish that the use of NFO style tagging etc was adopted more widely
Keeping the media untainted is a good policy
As all it takes is one bad app update of you tagging program to ruin you whole year!