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
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