AMC Script Help

Support for Ubuntu and other Desktop Linux distributions
Post Reply
darkcircuituk
Posts: 4
Joined: 26 Feb 2015, 13:06

AMC Script Help

Post by darkcircuituk »

Hey,

I've managed to get the following AMC script working in a large majority of scenarios when dealing with automating TV Series, however I'm hitting a snag in how it deals with a TV Show being both on thetvdb and themoviedb. As an example 'Top Gear Patagonia Special' should be matched as a TV special, but with my filebot script it is being matched as a Movie. Looking at the log file I can see that the file is correctly being picked up as existing on both sites, but the series is excluded and it is classified as a Movie.

My question is, is there some way I can set filebot to prefer thetvdb as the preferred source if it exists on both sites?

The script I am using is as follows:

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "/media/NAS" --log-file /home/dave/filebot.log --action test --conflict override -non-strict --def music=y artwork=n clean=y "seriesFormat=Videos/TV Shows/{n.replace(':','- ')} ({y})/Season {s}/{'S'+s.pad(2)}{'E'+e.pad(2)} - {t.replace(':','- ')}"  "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"
And the output from the log file when handling the Top Gear Special is as follows:

Code: Select all

Input: /media/NAS/Downloads/Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-FoV.[VTV].mp4
Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-FoV.[VTV].mp4 [series: Top Gear, movie: Top Gear: Patagonia Special (2014)]
Exclude Series: Top Gear
Group: [tvs:null, mov:top gear patagonia special 2014, anime:null] => [Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-FoV.[VTV].mp4]
Rename movies using [TheMovieDB]
Thanks for any help!
User avatar
rednoah
The Source
Posts: 19150
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script Help

Post by rednoah »

You'll need force series mode by passing --def ut_label=TV. See manual.
:idea: Please read the FAQ and How to Request Help.
darkcircuituk
Posts: 4
Joined: 26 Feb 2015, 13:06

Re: AMC Script Help

Post by darkcircuituk »

rednoah wrote:You'll need force series mode by passing --def ut_label=TV. See manual.
Hi Rednoah,

I appreciate your speedy response! I have actually been through the manual and I'm afraid I'm struggling to find a section that gives me the info I require. If I implement your fix does that mean that filebot will not be able to label movies any more? Ideally what I want to happen is that when labelling files thetvdb will always override everything else, if it doesn't exist in thetvdb then I would of course expect the app to look at other scrapers.

Sorry if I'm asking idiotic questions.
darkcircuituk
Posts: 4
Joined: 26 Feb 2015, 13:06

Re: AMC Script Help

Post by darkcircuituk »

I just gave your suggested fix a try rednoah and although it did force filebot to recognise the file as a TV Show it also caused the file to get mismatched with totally the wrong episode (see log below), is there something additional I need to put into my script?

Code: Select all

Parameter: ut_dir = /media/NAS/Downloads/Top_Gear.2014_Special.Patagonia_Part
_Two.HDTV_x264-FoV.[VTV].mp4
Parameter: ut_kind = multi
Parameter: ut_title = Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-FoV.[VTV].mp4                                                                    Parameter: ut_label = TV
Input: /media/NAS/Downloads/Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x26
4-FoV.[VTV].mp4
Group: [tvs:top gear] => [Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-
FoV.[VTV].mp4]                                                               Rename episodes using [TheTVDB]                                              Auto-detected query: [Top Gear]                                              Fetching episode data for [Top Gear]
Fetching episode data for [Top Gear (US)]
Fetching episode data for [Top Gear (1977)]
Fetching episode data for [Top Gear France]                                  Fetching episode data for [Top Gear Australia]                               [TEST] Rename [/media/NAS/Downloads/Top_Gear.2014_Special.Patagonia_Part_Two.HDTV_x264-FoV.[VTV].mp4] to [/media/NAS/Videos/TV Shows/Top Gear (2002)/Season 10/S10 - Series 10 Best of (4).mp4]
Processed 1 files
Done
User avatar
rednoah
The Source
Posts: 19150
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script Help

Post by rednoah »

1.
Search for "ut_label" in the page I linked.

2.
Ideally ut_label is passed along from your torrent client. So you can set label=TV in the torrent client for the downloads that you know to be TV shows.

3.
What's the correct match? Please provide a TheTVDB link to the correct data.
:idea: Please read the FAQ and How to Request Help.
darkcircuituk
Posts: 4
Joined: 26 Feb 2015, 13:06

Re: AMC Script Help

Post by darkcircuituk »

2. In the AMC manual it doesn't state that you can pass through a label in the deluge setup, are you aware of whether it is possible via deluge?

3. This is the episode it should be naming it to:

http://thetvdb.com/?tab=episode&seriesi ... 3693&lid=7
User avatar
rednoah
The Source
Posts: 19150
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script Help

Post by rednoah »

2.
I'm not sure if Deluge passes the label along by now as well. Better ask in the Deluge forums how to access the label in post-processing scripts.

3.
I see. Specials are tricky though. In this case the episode would have to be named "Patagonia Special" for it to work reliably. Fuzzy matching doesn't work well with shows that have many many specials and episodes.
:idea: Please read the FAQ and How to Request Help.
User avatar
ashfallen0
Power User
Posts: 32
Joined: 14 Jan 2012, 10:44

Re: AMC Script Help

Post by ashfallen0 »

IRT #2: I wrote a python script that pulls the label information and passes it to a shell script(the .sh calls filebot).

Code: Select all

#!/usr/bin/python

import sys
from deluge.ui.client import client
from twisted.internet import reactor

# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()

d = client.connect()

torrent_id = sys.argv[1]

def on_connect_success(result):
    def on_get_torrent_status(torrent):
        print torrent["label"]
        client.disconnect()
        reactor.stop()

    client.core.get_torrent_status(torrent_id, ["label"]).addCallback(on_get_torrent_status)

d.addCallback(on_connect_success)

def on_connect_fail(result):
        print result
        reactor.stop()

d.addErrback(on_connect_fail)

reactor.run()
You can also see my deluge how-to on the forums here.
Image PHPBB3 hates me.
Post Reply