Create tvshow.nfo with a python script (get around needing tv show dirs)
#1
I like to download scene releases to ~/path/tv, which clearly will not work with XBMC's scrapers, as it seems to always assume the parent directory of a tv show is the show name. If the directory is named "Parks.and.Recreation.S05E01.720p.HDTV.X264-DIMENSION", the scraper will fail to look up the show via thetvdb. Since I use torrents, I don't want to have to rename or make a copy of my data to keep seeding. I also don't want to manually create directories before I download, since most of my downloading is automated.

So, I came up with a little python script that solves the issue for me. It gets the show name from the scene release name, looks it up on TVDB, and adds the url to tvshow.nfo in the directory. This seems to be enough to get the scraper working, and my girlfriend is less mad at me for canceling the cable subscription. Since it's been nice for me, I figured I'd share it, as I'm sure there's others in my boat - don't want to rename, don't want to copy, too lazy to curate a collection in any way.

Here's the script:
http://pastebin.com/99MG72R4

This should be ran when new downloads finish - it's easy to do in rtorrent, and I suspect easy in other clients, but I don't use them. If this helps, or doesn't work, or I'm an idiot, please let me know. I tried to explain everything in the script so it can be modified easily as needed by people without much python knowledge.

Oh - there's also a small bash script to get the tvshow.nfo's for the "backlog" that you already have downloaded, just fill in some variables, chmod +x it, and run it:

Code:
#!/bin/bash
# I don't know bash, this is dirty...
tv_dir='/path/to/dir/with/scene/released/tv/shows'

IFS=$'\n'

for dir in `find ${tv_dir} -maxdepth 1 -type d`
do
    IFS=$'/'
    x=( $dir )
    torrent_name=${x[5]} #Change '5' to whatever position the release name is in!
    echo $torrent_name
    create_tvshow_nfo.py '/path/to/dir/with/scene/released/tv/shows' ${torrent_name}
done
Reply

Logout Mark Read Team Forum Stats Members Help
Create tvshow.nfo with a python script (get around needing tv show dirs)1