Page 1 of 1

Help With a Script

Posted: 17 Oct 2014, 22:35
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

Re: Help With a Script

Posted: 18 Oct 2014, 05:52
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.

Re: Help With a Script

Posted: 18 Oct 2014, 15:33
by rafasilv
How can i make a script to get the original back when the subtitle is missed?
Please help me out

Re: Help With a Script

Posted: 18 Oct 2014, 16:18
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.

Re: Help With a Script

Posted: 18 Oct 2014, 17:14
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.

Re: Help With a Script

Posted: 18 Oct 2014, 17:32
by rednoah
Yes. Just pass in your own format expression.

Re: Help With a Script

Posted: 18 Oct 2014, 23:15
by rafasilv
what if cut the last line of the script, it will keep the original name of the file?