tw-video-scraper: Download fanart thumbnail for video

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
505
Posts:23
Joined:Mon Feb 01, 2010 2:23 pm
AV Hardware:Sheevaplug with TwonkyMedia server
tw-video-scraper: Download fanart thumbnail for video

Post by 505 » Fri Dec 09, 2011 10:42 pm

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/
Get nice thumbnails in Twonky with tw-video-scraper plugin

ceasar
Posts:8
Joined:Tue Jan 04, 2011 10:50 pm
AV Hardware:LOEWE Connect 37 Media Full-HD+ 100 DR+
Qnap TS-109 PRO - TwonkyMedia 5.XXX
TwonkyServer, TwonkyManager und TwonkyBeam on PC
TwonkyServer Mobile and Twonky Mobile on SE x10mini Pro

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

Post by ceasar » Mon Jan 23, 2012 12:38 am

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

505
Posts:23
Joined:Mon Feb 01, 2010 2:23 pm
AV Hardware:Sheevaplug with TwonkyMedia server

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

Post by 505 » Tue Jan 24, 2012 10:16 am

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.
Get nice thumbnails in Twonky with tw-video-scraper plugin

505
Posts:23
Joined:Mon Feb 01, 2010 2:23 pm
AV Hardware:Sheevaplug with TwonkyMedia server

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

Post by 505 » Thu Mar 08, 2012 2:51 pm

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
Get nice thumbnails in Twonky with tw-video-scraper plugin

RayX9500
Posts:16
Joined:Sat Jun 19, 2010 7:54 pm
AV Hardware:3XKISS 1600
4X Windows 7 laptops
1X Atom D510 7 X64 server with Twonky Server 6

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

Post by RayX9500 » Thu Mar 08, 2012 4:43 pm

The best solution is to use embedded posters in the files metadata

505
Posts:23
Joined:Mon Feb 01, 2010 2:23 pm
AV Hardware:Sheevaplug with TwonkyMedia server

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

Post by 505 » Thu Mar 08, 2012 4:53 pm

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.
Get nice thumbnails in Twonky with tw-video-scraper plugin

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

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

Post by phibertron » Wed Mar 14, 2012 5:09 am

@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!
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Locked