Captain America - winter soldier vs. captain America winter soilder

Any questions? Need some help?
Post Reply
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

Is there anyway to force filebot NOT to put "-" in the name?
Like use
captain America winter soldier
Instead of
Captain America - winter soldier

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

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

You can use a custom format and then whatever you want. You can also use the plex binding and then strip all '-' characters from the result.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:You can use a custom format and then whatever you want. You can also use the plex binding and then strip all '-' characters from the result.

Would u mind explain a little what's Plex binding?
thanks,


I did some search, and tried this script

Code: Select all

filebot -script dev:amc --output /volume1/Video/{plex}
however, I was given such an error

Code: Select all

FileBot: Illegal usage: output folder must exist and must be a directory: /volume1/Video/{plex}
what did I do wrong?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

You mean this:

Code: Select all

filebot -script dev:amc --output /volume1/Video --format {plex}
Here's some docs on the {plex} binding:
viewtopic.php?f=5&t=4116
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:You mean this:

Code: Select all

filebot -script dev:amc --output /volume1/Video --format {plex}
Here's some docs on the {plex} binding:
viewtopic.php?f=5&t=4116

thanks for the help, I've got {plex} binding working now.
however, you said I can then strip "-" from the result, but how do I do it? like rename manually to delete the "-"? thanks again
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

... of course not manually. :lol:

i.e.

Code: Select all

plex.path.replace('-', '')
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:... of course not manually. :lol:

i.e.

Code: Select all

plex.path.replace('-', '')
so what would my code be? like this?

Code: Select all

filebot -script dev:amc --output /volume1/Video --format {plex} -plex.path.replace('-', '')
and since it's actually like
Captain America - Winter Solider, I guess I should use

Code: Select all

plex.path.replace(' -', '')
so there will only be one space between America and winter, instead of two.

thanks ;)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

1.

Code: Select all

filebot -script dev:amc --output /volume1/Video --format "{plex.path.replace('-', '')}"
You are using the GUI to experiment, right?

Step 1: Prototype your format in the GUI
Step 2: Copy and paste it into your command-line call

Image


2.
FileBot will normalize space sequences, so you'll never end up with more than one space in a row.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:1.

Code: Select all

filebot -script dev:amc --output /volume1/Video --format "{plex.path.replace('-', '')}"
You are using the GUI to experiment, right?

Step 1: Prototype your format in the GUI
Step 2: Copy and paste it into your command-line call

Image


2.
FileBot will normalize space sequences, so you'll never end up with more than one space in a row.

somehow it didn't work..
I used the script

Code: Select all

filebot -script dev:amc --output ~/Desktop/2/ --format "{plex.path.replace('-', '.')}" --action hardlink --conflict override -non-strict ~/Desktop/1/
and got this

Code: Select all

Rename [/Users/gary/Desktop/1/Captain America - Civil War (2016).mkv] to [/Users/gary/Desktop/2/Movies/Captain America - Civil War (2016)/Captain America - Civil War (2016).mkv]
I tried to replace ' -' or '-' with '' and '.' and even '0' but the output are all the same...



no I'm not using GUI, don't even know how. I'm just running my script on my Mac, using hardlink to save time ;)

and I think it's better to use ' -' instead of '-', so that it doesn't accidentally get rid of good dashes like those in 'x-ray', or 'x-men'
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

1.
Using formats on the command-line without understanding how they work is a bad idea. Using the GUI allows you to build confidence in how the format work, so if something doesn't work, then you know where to look and where not to look (e.g. if the format works in the GUI, then it also works in the CLI, and if it doesn't, then it's not a format issue, but some other kind of issue).

2.
The amc script doesn't use the --format option because it uses multiple formats for different kinds of files. See amc script manual for details.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:1.
Using formats on the command-line without understanding how they work is a bad idea. Using the GUI allows you to build confidence in how the format work, so if something doesn't work, then you know where to look and where not to look (e.g. if the format works in the GUI, then it also works in the CLI, and if it doesn't, then it's not a format issue, but some other kind of issue).

2.
The amc script doesn't use the --format option because it uses multiple formats for different kinds of files. See amc script manual for details.


hmm. so i can't just remove the '-' in one script with amc? that's a little tricky because I also need amc to download extras and subtitles...
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

(1) You can remove '-' in your custom format. (2) The amc script allows you to set custom formats. At what point in this line of reasoning is it suddenly impossible? :lol:

How to use custom formats is thoroughly explained in the manual:

Code: Select all

... --def movieFormat="{plex.path.replace(' - ', '')}" seriesFormat="{plex.path.replace(' - ', '')}" ...
@see viewtopic.php?f=4&t=215


:idea: It goes without saying, that in your bash script, you won't duplicate the same format:

Code: Select all

FORMAT="{plex}"
...
... --def movieFormat="$FORMAT" seriesFormat="$FORMAT" ...
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

ok this does work. however it's like a problem after a problem.

so the problem now is, I'm not sure if it's related, as the configured in AMC script, filebot will download subtitles from shooter, named as MOVIE.zho.srt. and since I'm now using {plex} binding, it will be moved and renamed as MOVIE.chi.srt. this should be great because plex will now show it as a Chinese subtitle, instead of unknown.
however, all those subtitles renamed as MOVIE.chi.srt are NOT usable by PLEX, it will just cause a transcoder error. this will disable PLEX sync altogether because PLEX sync requires transcoding on subtitles.
I also discovered that when I run a suball on my videos, it will fetch from shooter (so assumably the same file as fetched in amc script), and kept it as MOVIE.zho.srt, and this subtitle will be usable by PLEX.

I tried both r4922 and latest jar but the same problem.

so a temperatury fix I can think of is disable subtitle searching in amc, but run a suball on the output folder instead.
so the script would be something like this

Code: Select all

filebot -script fn:amc ****** --def exec="filebot -script fn:suball {file}"
do you think this script is gonna work?

thanks again
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

1.
No, this is not gonna work well. What's the benefit of using the --def exec option for this use case?

I'd just call suball after amc:

Code: Select all

filebot -script fn:amc --output "/path/to/Media" ...
filebot -script fn:suball "/path/to/Media" --lang zho -non-strict --def maxAgeDays=7

2.
That being said, these kinds of workarounds are never a good idea. Have you tried fixing transcoder error problem at the root? This is probably a question you should ask in the Plex forums.

The amc script automatically converts any kind of subtitle to SubRip format with UTF-8 character encoding. Tell your transcoder to read subtitles with UTF-8 instead of Big5 or GB 18030 or whatever encoding Chinese subtitle uploaded seem to like.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:1.
No, this is not gonna work well. What's the benefit of using the --def exec option for this use case?

I'd just call suball after amc:

Code: Select all

filebot -script fn:amc --output "/path/to/Media" ...
filebot -script fn:suball "/path/to/Media" --lang zho -non-strict --def maxAgeDays=7

2.
That being said, these kinds of workarounds are never a good idea. Have you tried fixing transcoder error problem at the root? This is probably a question you should ask in the Plex forums.

The amc script automatically converts any kind of subtitle to SubRip format with UTF-8 character encoding. Tell your transcoder to read subtitles with UTF-8 instead of Big5 or GB 18030 or whatever encoding Chinese subtitle uploaded seem to like.
1. so how does filebot understand "age". is it the date the file was last modified? created? and by running amc script first, would amc change the date?
I was thinking "--def exec" so that I don't have to deal the 'age/date' confusion, I just pass the output directory down and force it to download subtitles, ignoring the age.
btw, is there a 'override' option for suball as well? sometimes I update the video file (for proper or better resolution), but there is already a old sub there, so the suball ignores that video (based on language exclude setting). therefore the sub is out-of-sync

2. I don't think plex is the problem. because I was using most basic amc without any modification, the sub downloaded worked. I just tried again using basic amc (without {plex} format binding), still the subtitle is good.
the problem seems to be when amc moved and renamed the sub. even after I manually changed it back from chi to zho, still no luck.


simply put, when I run this, the output sub is called "MOVIE.chi.srt", and it doesn't work with plex

Code: Select all

filebot -script dev:amc --output /volume1/Video/  --log-file /volume1/Download/NZBGet/FileBot.log --action move --conflict override -non-strict /volume1/Download/Completed/ --def subtitles=zho,eng,en artwork=y extra=y movieFormat="{plex.path.replace(' - ', ' ')}" seriesFormat="{plex}" exec="/usr/syno/bin/synoindex -A '{file}'"
but when I run this, the output sub is called "MOVIE.zho.srt", and it works with plex.

Code: Select all

filebot -script dev:amc --output /volume1/Video/  --log-file /volume1/Download/NZBGet/FileBot.log --action move --conflict override -non-strict /volume1/Download/Completed/ --def subtitles=zho,eng,en artwork=y extra=y exec="/usr/syno/bin/synoindex -A '{file}'"
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

1.
"age" refers to the last-modified date. On Linux, there is no such thing as creation-date, only last-modified. It'll go through all your files and quickly ignore anything that has been there for a while and fetch missing subtitles for new content.

There is no override option due to abuse. You will not be able to fetch missing subtitles if there's already a subtitle in that folder. You'll need to delete the out-of-sync subtitle files and then run the suball script if you want new subtitles.


2.
Plex documentation says that they use the ISO 639-2/B standard for language codes, so "chi" would be the correct language code. "zho" is ISO 639-2/T. You'll want to report the issue with the Plex developers. They should just support both language code standards.

:idea: Now guess how we can fix the destination path? Yes! Exactly the way we replace ' - ' with ' ' except we now replace 'chi' with 'zho'.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:1.
"age" refers to the last-modified date. On Linux, there is no such thing as creation-date, only last-modified. It'll go through all your files and quickly ignore anything that has been there for a while and fetch missing subtitles for new content.

There is no override option due to abuse. You will not be able to fetch missing subtitles if there's already a subtitle in that folder. You'll need to delete the out-of-sync subtitle files and then run the suball script if you want new subtitles.


2.
Plex documentation says that they use the ISO 639-2/B standard for language codes, so "chi" would be the correct language code. "zho" is ISO 639-2/T. You'll want to report the issue with the Plex developers. They should just support both language code standards.

:idea: Now guess how we can fix the destination path? Yes! Exactly the way we replace ' - ' with ' ' except we now replace 'chi' with 'zho'.


it's driving me a little crazy.
1. so will running amc change the modify date?

2. I now ran both scripts via ssh, and they both output to .chi.srt and they both worked.
however when the same script was called by nzbget... although both scripts are giving me .chi.srt (I don't why they are both doing this, and I don't mind .chi.srt, it's actually better but not that it really matters)...

also I get this error a lot, both running via ssh and called by nzbget

Code: Select all

FileSystemException: /volume1/Download/Completed/TV Shows/Gossip.Girl.S06E01.Gone Maybe Gone.720p.WEB-DL.DD5.1.H.264-TB English/Gossip.Girl.S06E01.Gone Maybe Gone.720p.WEB-DL.DD5.1.H.264-TB.zho.srt: Unable to get size of extended attribute 'net.filebot.filename': No data available
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

1.
I don't know. Try and see what happens. Kinda depends on the operating system and what you're doing exactly, especially if source / destination path are on the same filesystem.

:idea: Using --def exec to update the timestamps would make sense.


2.
The {plex} binding will give you ISO 639-2/B (e.g. chi) language codes for subtitles because that's what the Plex naming standard says.

:idea: The {lang} binding will give you the ISO 639-3 language code (e.g. zho) which is the latest and greatest of all the language code standards. The destination path, including the subtitle language code extension, is entirely up to your format, so you can do whatever works best for you.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:1.
I don't know. Try and see what happens. Kinda depends on the operating system and what you're doing exactly, especially if source / destination path are on the same filesystem.

:idea: Using --def exec to update the timestamps would make sense.


2.
The {plex} binding will give you ISO 639-2/B (e.g. chi) language codes for subtitles because that's what the Plex naming standard says.

:idea: The {lang} binding will give you the ISO 639-3 language code (e.g. zho) which is the latest and greatest of all the language code standards. The destination path, including the subtitle language code extension, is entirely up to your format, so you can do whatever works best for you.
so the problem now is, why I have different 'results' by start the script via ssh vs. nzbget.
when I ran it via ssh, it works just fine, but when I ran it via nzbget, it just doesnt work.. and both are running under root.... so weird
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

ok now I think I found where the problem is.
so I checked the problematic chi.srt and working zho.srt from suball, they have the same MD5. so no way the file is damaged. then I started to dig into permission issue.
after I set a problematic chi.srt to 777, it worked. the weird thing now is, that most chi.srt downloaded by amc are somehow working right after, but there are a few that still doesn't work. they will need to be set to 777 permission
so I guess I'll just add another exec="chmod 777 '{file}'" at the end of the script.
btw, can I put two commands in one exec=""? or should I use two exec=""
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

The usual way? Exactly like on the command-line? :lol:

@see http://stackoverflow.com/a/5130889/1514467

If it's not a simple command, I'd just make my own little script:

Code: Select all

--def exec="/path/to/fix-permissions.sh {quote(file)}"
That way you can easily make modifications without touching the amc call and you can use it standalone for testing.
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: Captain America - winter soldier vs. captain America winter soilder

Post by garyleecn »

rednoah wrote:The usual way? Exactly like on the command-line? :lol:

@see http://stackoverflow.com/a/5130889/1514467

If it's not a simple command, I'd just make my own little script:

Code: Select all

--def exec="/path/to/fix-permissions.sh {quote(file)}"
That way you can easily make modifications without touching the amc call and you can use it standalone for testing.

I guess I'll just use && to combine two commands. These are two simples commands so no need to maintain another file.

Btw, quick question, by default the suball command download .zho file, is it possible to have it name .chi? After all .chi is indeed better.

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

Re: Captain America - winter soldier vs. captain America winter soilder

Post by rednoah »

You can call the suball script first, and then the amc script, so that newly downloaded subtitles will be processed through the amc script and your custom format.
:idea: Please read the FAQ and How to Request Help.
Post Reply