PDA

View Full Version : Auto Download Movie Trailers to Tivo


reneg
11-06-2009, 09:04 PM
I've been playing around with a python script (hdtrailers.py) to download movie trailers referenced in the RSS feed from hdtrailers.net for a couple weeks. I hope this script is stable enough for others. I'm sure there are some bugs lurking. I've only run this script on Windows with my Tivo HD.

Some more info from the script itself:
This script builds upon the auto_push.py script written by moyekj and published in the Tivo
community forums ( http://www.tivocommunity.com/tivo-vb/showthread.php?t=435477 )

Functionality:
In addition to auto pushing files from a watch directory on a PC to a Tivo, this script pulls
movie trailers from hd-trailers.net. Trailer video quality is configurable between 480p, 720p
and 1080p. If the requested quality is not available, the next lower video quality is selected.
After downloading trailers to the PC, a summary email can be sent to a specified address. Also,
movie trailers are then automatically pushed to a Tivo using pyTivo. Files in the auto download
directory can also be auto-pruned (ie. deleted) after a configurable amount of time.

Dependancies:
pyTivo - pyTivo needs to be installed and running so this script can communicate push requests to it.
feedparser - Parses RSS feeds. Download and install the feedparser script from www.feedparser.org

Install:
Place this script in your pyTivo directory

Examples:
Watch specific folders for new files and initiates pyTivo pushes for them automatically
NOTE: The specified folders are searched from top to bottom of folder hierarchy for video files

* Edit watchList below (in the Configure these section) to match your setup.
* You can have multiple comma separated entries
in following syntax:
{"tivo": "tivoName1", "path": "full_path1", "share": "share_name1"},
{"tivo": "tivoName2", "path": "full_path2", "share": "share_name2"}
...
NOTE: tivo is the Tivo you want to push to for files in that share.
* pyTivo.conf needs to have video shares matching each share name and path specified in watchList
* Set the proper path to your ffmpeg binary below (used to check if files are video files)

Example pyTivo setup
* In this sample script my pyTivo.conf has the video share setup to match my watchList setup:
[HDTrailers]
type=video
path=c:\hdtrailers.net

Example script setup
* To match the above pyTivo setup, this script should be configured as follows:
* Tivo in the watchList can be either the name of the Tivo or the TSN number
* RSSPath is the auto-download directory for movie trailers
* Share in the watchList matches the share name defined in the pyTivo.conf
RSSPath = "c:\\hdtrailers.net"
watchList = [
{"tivo": "Family Room", "path": RSSpath, "share": "HDTrailers"}
]

Even though Tivo is able to play some movie trailers without transcoding, At this time, I've found that
transcoding everything to be a simpler solution. Perhaps in the future, I'll incorporate better error
recovery when pushes fail, but for now, create a default metadata file in your auto-download directory
to force transcoding. Override the video code with a bogus value 'foo'

Example default.txt
Override_vCodec: foo

This script creates a tracking file in each watch directory to identify which files have previously
been pushed to the Tivo. The name of the file is HDTrailers-processedList.txt. A separate file is
maintained in the auto-download movie trailer directory, HDTrailers-downloadExclusions.txt, which
tracks which movie trailers have been downloaded already.

RUNNING THIS SCRIPT
* After everything is setup make sure pyTivo is running with proper config,
then run this script with python, such as:
c:\Python25\python.exe hdtrailers.py
* If you need to exit the script, control-c

reneg
12-17-2009, 02:29 PM
Back with an update to my wildly unpopular script to automatically download movie trailers referenced on hdtrailers.net and push them to Tivo. I've updated the script in the first post to fix a couple of bugs. I've been running this script for six weeks now and it is working very well.

Also attached to the first post, I modified the hdtrailers script to automatically download and push episodes of Cranky Geeks to Tivo. (crankygeeks.py)

jcthorne
12-18-2009, 10:11 AM
I would really like to see pytivo have the abiltiy to dl and transfer a movie trailer for movies I place on the tivo. Not sure how that would work but being able to see the trailer when browsing for a movie to watch would be great.

orangeboy
12-18-2009, 11:01 AM
Back with an update to my wildly unpopular script to automatically download movie trailers referenced on hdtrailers.net and push them to Tivo. I've updated the script in the first post to fix a couple of bugs. I've been running this script for six weeks now and it is working very well.

Also attached to the first post, I modified the hdtrailers script to automatically download and push episodes of Cranky Geeks to Tivo. (crankygeeks.py)

It would be nice to have a sticky with a list of all the applications/scripts/utilities that have been developed... Kind of a "one stop shop" for TiVo fans that like doing more!

fdbryant3
12-18-2009, 12:45 PM
What would be nice is to have this set up so we can easily subscribe to any feed, download, then delete after being pushed (the current holy grail I'm chasing after).

reneg
12-18-2009, 01:25 PM
I would really like to see pytivo have the abiltiy to dl and transfer a movie trailer for movies I place on the tivo. Not sure how that would work but being able to see the trailer when browsing for a movie to watch would be great.
Have to think about that one a bit. Would need a searchable db of movie trailers with d/l links.


What would be nice is to have this set up so we can easily subscribe to any feed, download, then delete after being pushed (the current holy grail I'm chasing after).

I've been thinking about making the support more generic to handle different feeds however, I've held off because it didn't appear there was much demand for this type of functionality. I scripted a couple feeds that I keep up with that I can't get season passes for on my Tivo. I like that they just show up on my Tivo like a season pass and don't clutter up my PC once I'm done with them.

I believe the webvideo plugin in pyTivo was intended to accomplish the first two steps you outlined, however I'm not sure whether that plugin is working or not in it's current form.

fdbryant3
12-22-2009, 09:51 PM
I've been thinking about making the support more generic to handle different feeds however, I've held off because it didn't appear there was much demand for this type of functionality. I scripted a couple feeds that I keep up with that I can't get season passes for on my Tivo. I like that they just show up on my Tivo like a season pass and don't clutter up my PC once I'm done with them.

I believe the webvideo plugin in pyTivo was intended to accomplish the first two steps you outlined, however I'm not sure whether that plugin is working or not in it's current form.

Well I can't speak for anyone else but obviously I would be interested. I suspect others would be as well. Part of the problem though is there really isn't a relatively well promoted "app store" for HME/HMO projects. So it makes things like this difficult to find.