Help With a Script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
rafasilv
Posts: 13
Joined: 17 Oct 2014, 22:22

Help With a Script

Post by rafasilv »

I use sabnzbd (usenet client) post-script to rename my downloads:
#!/bin/bash

# SABnzbd Post Processing Script - www.Filebot.net "AMC" Script

FILE_PATH=$1
FILE_NAME=$3

filebot -script \
fn:amc \
--output "/media/DADOS/Media" \
--log-file amc.log \
--action move \
--conflict override -non-strict \
--def music=n \
--def xbmc=127.0.0.1 \
--def plex=127.0.0.1 \
--def pushover= \
--def artwork=y \
--def subtitles=pb \
--def clean=y \
--def "exts=jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2" \
--def "terms=sample|trailer|etc" \
--def "ut_dir=$FILE_PATH" \
--def "ut_kind=multi" \
--def "ut_title=$FILE_NAME"
Sometimes I cannot find the subtitle and I have to revert to the original name of the file ( filebot -script fn:revert --action rename /path/to/files) to search for the subtitle in another site (like www.legendas.tv)

Is it possible to add something at sabnzbd post-script to automatic revert the file to the original name when the subtitle is missed?

Thanks
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help With a Script

Post by rednoah »

No, there is no support for this. Though, FileBot stores the original filename as xattr so you could write a script for that yourself quite easily.
:idea: Please read the FAQ and How to Request Help.
rafasilv
Posts: 13
Joined: 17 Oct 2014, 22:22

Re: Help With a Script

Post by rafasilv »

How can i make a script to get the original back when the subtitle is missed?
Please help me out
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help With a Script

Post by rednoah »

Pseudo code:

Code: Select all

Find all media files that don't have subtitles
for each file
   check xattr for the original name
   rename file to the original name
You understand that this will require a certain level of coding, right? Feel free to check the scripts section for examples.
:idea: Please read the FAQ and How to Request Help.
rafasilv
Posts: 13
Joined: 17 Oct 2014, 22:22

Re: Help With a Script

Post by rafasilv »

At this script i already use, is it possible to keep the original name of the file?
What matters to me is trhe folder in organized structure.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help With a Script

Post by rednoah »

Yes. Just pass in your own format expression.
:idea: Please read the FAQ and How to Request Help.
rafasilv
Posts: 13
Joined: 17 Oct 2014, 22:22

Re: Help With a Script

Post by rafasilv »

what if cut the last line of the script, it will keep the original name of the file?
Post Reply