Question Regarding abs2sxe

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Question Regarding abs2sxe

Post by Corey3443 »

First of all Filebot has been a real lifesaver since i've found it. (Srs it has saved me days of work from what i was originally doing) anyways....

I quick question regarding the abs2sxe script, i've ran into a small issue when using the --format argument along with {group}, it comes up empty. I believe the group is not being passed on in pass 1 so i can not use it as part of my renaming formula. Is there a easy way for me to include this myself? (not much of a coder)

An Example of what i was using: filebot -script fn:abs2sxe "\path\to\folder" --format "{n.space('.')}.{s00e00}.{vf}.{group}"

This formula works fine just not using the script.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

Yeah, I guess you already got it right. The first internal temporary rename operation takes away {group} binding so it's not available at the final rename step.

If xattr is enabled and working then the original filename will be available in the metadata and {group} will work. If xattr is not working then the original filename information is lost and {group} won't work.
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

First off thank you for the prompt reply rednoah.

Sorry I have never heard of xattr... i do not know if this is relevant but i am running filebot on windows 7.
Can I simply change the stage1 line to include the group tag as part of the format formula? is there a way for me to make this conditional to use with a switch such as --group? and to substitute it with a default if one does not exist?

TV/Movies i don't care about the group, but for anime it has some relevance.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

On Windows xattr are called NTFS Extended Attributes, so if you do the abs2sxe on a local drive/filesystem it should work. But if you work with a remote folder reading/writing xattr won't work.

Changing the script might be the way to go, it's just a few lines. Make sure the {group} is in the stage1 format expression and that should do it.
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

rednoah,

Thank you, indeed adding that tag to the script did work; just one final question. Is there a way I can detect if the group does not exist and replace it with a predefined entry?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

Code: Select all

any{group}{'NOGRP'}
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

rednoah,

Thank you very much.... Ill be sure to donate to this awesome project =) I can tell alot of hardwork has gone into this.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

Appreciated. :) I tried hard to make it look easy though ;)
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

Just a few follow up question, (if this is not the correct place i will raise a new thread).

So i've got my final format string down to something like this:
{"Season ${s.pad(2)}"}/{n.space('.')}.{s00e00}.{vf}{'.'+source}{any{'.'+group}{'.Unknown'}}


Now I have a few final questions (spent abit of time over the weekend trying to understand the whole thing):
  • Is there alternative way than using source to procure if the file is from a DVD/BD if in the filename? BD / Blu-Ray doesn't seem to work.
  • For groups that contain a "-" is there a way to include the string after it? Example : Super-Subs only shows Super
  • Can you do a if statement to apply {t} if its Season 0 (specials?) without affecting the others?
  • Is it possible to use the Japanese name in english rather than the english translated name from tvdb?

Trying to achieve the following:
Specials: {"Season ${s.pad(2)}"}/{n.space('.')}.{s00e00}.{t.space('_')}.{vf}.{source}{any{'.'+group}{'.Unknown'}}
Normal: {"Season ${s.pad(2)}"}/{n.space('.')}.{s00e00}.{vf}.{source}{any{'.'+group}{'.Unknown'}}

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

Re: Question Regarding abs2sxe

Post by rednoah »

1.
You can use the match() function, e.g.

Code: Select all

fn.match(/BD/)
Let me know the paths that don't work so I can add the patterns to {source}

2.
{group} doesn't do Super-Sub group at all. I could add the Super-Sub group as single group pattern though. Or you just do your own code to match what you want from the filename

3.
Yes. There's some examples in the forums. Something like if

Code: Select all

{episode.special ? A : B}
4.
If you switch to Japanese you'll probably get real Japanese. You mean romanized Japanese? Pretty sure TheTVDB doesn't have that data.

FileBot can machine-transliterate Japanese to English

Code: Select all

{fn.ascii()}
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

rednoah wrote: 1.You can use the match() function, e.g.

Code: Select all

fn.match(/BD/)
Worked Perfectly. Only seems to be a few subgroups use weird naming schemes for blurays, but was surprised BD wasn't added already.
rednoah wrote: 3.Yes. There's some examples in the forums. Something like

Code: Select all

{if episode.special ? A : B}
O.o ternary statement. I tried a general if statement but must have got the syntax wrong. Working now however. TY
rednoah wrote: 4.If you switch to Japanese you'll probably get real Japanese. You mean romanized Japanese? Pretty sure TheTVDB doesn't have that data.
Based on this link: http://www.thetvdb.com/wiki/index.php?t ... :GetSeries I think i need what im looking for is the field "AliasNames"

For Example: http://thetvdb.com/?string=Mangaka-san+ ... ion=Search
In that example it has both the English title and the Romanized Version. What i wish to accomplish is to not use the English title if the alias name was originally used, just not sure on the best way to code it. I think the process needs to be something like this.
if(show has alias & filename contains alias) (name = alias) else (use name)

Hope that makes sense.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

You can try using {alias} and then build your own logic on top of that.

Though that'll only work if the search result object from the API search gets selected instead of the result object from filebots internal index (which gets priority) which doesn't know about AliasNames data because TheTVDB doesn't support AliasNames in the series record.

In this case it won't work.
:idea: Please read the FAQ and How to Request Help.
Corey3443
Posts: 23
Joined: 03 Sep 2014, 02:55

Re: Question Regarding abs2sxe

Post by Corey3443 »

I ended up using a mix of the alias command as a few other strings & logic into a script and that worked perfectly. Thanks for all your help.

As for group patterns: i dunno if these groups have been added (these at-least didn't work during my naming) animeNOW and Final8 did not detect properly.

I still have a good 150 shows left to do so ill be glade to note any additional groups if they don't show up. Does the {group} support detecting multiple group patterns at the same time, or just whatever is detected first?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question Regarding abs2sxe

Post by rednoah »

Kinda, it's taking the last occurrence but there's a bit more to it.

Post groups here:
http://www.filebot.net/forums/viewtopic.php?f=5&t=4
:idea: Please read the FAQ and How to Request Help.
Post Reply