Feature request: SRT files

All your suggestions, requests and ideas for future development
User avatar
rednoah
The Source
Posts: 17865
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Feature request: SRT files

Post by rednoah » 27 Mar 2020, 05:38

You could try --conflict index and see it works for you.


Otherwise you'd need to pass in your own custom format, that somehow yields unique file paths for unique subtitle files, how exactly depends on you though, {crc32} would do the trick but might not be what you want, option options like matching identifiers from the filename are possible. Your format. Your rules.
https://www.filebot.net/naming.html


EDIT:

e.g. this format works well:

Code: Select all

{plex.derive{if (dc > 1) '.'+di}}
Image
:idea: Please read the FAQ and How to Request Help.

jprokos
Posts: 52
Joined: 09 Oct 2016, 02:01

Re: Feature request: SRT files

Post by jprokos » 27 Mar 2020, 06:42

Thanks you. Sorry—a lot of questions here. Looks like you have provided an example already but I will post this anyway.

I am not clear on how to "pass in a custom format" in the amc script but would love to know. Is there a page on this site that explains formatting for that? Please provide an example using {crc32}

I have a generic Plex structure:

/Volumes/PlexMedia/Movies/Title/movieFiles and subtitles
/Volumes/PlexMedia/Seeding/Title/movieFiles/Subs/subtitles

Matching identifiers from the filename might do the trick, but something more robust would probably be better since I am not in control of the incoming file names.

I am currently using --conflict skip which causes the extra files to be put into the "unsorted directory" which means I have to manually rename them and add them into the movie's directory.

Not sure exactly what "--conflict index" does, but from two tests it appears to copy and append both subtitle files with "CD1" and "CD2".
CD stands for? I am guessing it's not for Compact Disk 1 and 2

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

Re: Feature request: SRT files

Post by rednoah » 27 Mar 2020, 06:52

1.
Please read the amc script manual on how to use custom formats.


2.
--conflict index will add .1 .2 etc to the filename to make it unique. If you get CD1/2 then that's not the doing of --conflict index but multi-part movie handling, which is unrelated to --conflict resolution.


:idea: Make sure that your test setup is representative, i.e. real video files, real subtitles.
:idea: Please read the FAQ and How to Request Help.

jprokos
Posts: 52
Joined: 09 Oct 2016, 02:01

Re: Feature request: SRT files

Post by jprokos » 31 Mar 2020, 05:05

rednoah wrote:
27 Mar 2020, 06:52
1.
Please read the amc script manual on how to use custom formats.

2.
--conflict index will add .1 .2 etc to the filename to make it unique. If you get CD1/2 then that's not the doing of --conflict index but multi-part movie handling, which is unrelated to --conflict resolution.

:idea: Make sure that your test setup is representative, i.e. real video files, real subtitles.
Thanks for your patience,,, and help.

Since it worked for you I would like to use {plex.derive{if (dc > 1) '.'+di}} in my AMC script. I included my script below. Where do I place this?

1. I can't find literature on custom formats on modifying the AMC script. Are you saying don't call the AMC script at all—then re-create the AMC script then add my requirements? Or are you saying to call the AMC script and amend it. If it's the later, again, I have not seen a format for that in the manual or any examples of it.

2. I am not downloading multi-part movies. There is only one movie per directory; there are two .srt files in a "Subs" directory within that directory. This didn't happen until after I set the --conflict index flag. My script copies files to "Movies" directory and maintains the originals in "Seeding" directory. The "post amc script" subtitle files in "Movies" are now "moviename (date) CD1.eng.srt" and "moviename (date) CD2.eng.srt" and are the exact same size as the originals which were named "2_English.srt" and "3_English.srt". Their modify/added/created time are exactly the same. I can't think of another reason for it than the --conflict index flag.

This is my script:

Code: Select all

/usr/local/bin/filebot -script fn:amc --output "/Volumes/PlexMedia" --action duplicate --conflict index -non-strict --log-file amc.log --def excludeList=/Users/uname/.filebot/amc.excludes --def unsorted=y --def music=y --def subtitles=en --def minFileSize=0 --def minLengthMS=0 --def plex="127.0.0.1":"##############" "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
I downloaded filebot with Homebrew and use the complete path to filebot.sh. This is the correct method these days?

jprokos
Posts: 52
Joined: 09 Oct 2016, 02:01

Re: Feature request: SRT files

Post by jprokos » 31 Mar 2020, 06:08

Could it be TheMovieDB that is renaming the srt files?

It looks like my open subtitles lookup fails every time. I see there is a guide on fixing that in the forums. Should I just remove --def subtitles=en from my script?

And I see my token is stale...

Code: Select all

Run script [fn:amc] at [Wed Mar 25 20:11:23 CDT 2020]
Parameter: excludeList = /Users/John/.filebot/amc.excludes
Parameter: unsorted = y
Parameter: music = y
Parameter: subtitles = en
Parameter: minFileSize = 0
Parameter: minLengthMS = 0
Parameter: plex = *****
Parameter: ut_dir = /Volumes/PlexMedia/Seeding/The.Movie.2019.1080p
Parameter: ut_kind = multi
Parameter: ut_title = The.Movie.2019.1080p
Parameter: ut_label = Movies
Use excludes: /Users/John/.filebot/amc.excludes (3)
Input: /Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/2_English.srt
Input: /Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/3_English.srt
Input: /Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/The.Movie.2019.1080p.mp4
Group: {Movie=true} => [2_English.srt, 3_English.srt, The.Movie.2019.1080p.mp4]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/The.Movie.2019.1080p.mp4
Rename movies using [TheMovieDB]
Auto-detect movie from context [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/The.Movie.2019.1080p.mp4]
Auto-detect movie from context [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/2_English.srt]
Auto-detect movie from context [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/3_English.srt]
[DUPLICATE] from [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/The.Movie.2019.1080p.mp4] to [/Volumes/PlexMedia/Movies/The Movie (2019)/The Movie (2019).mp4]
[DUPLICATE] from [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/2_English.srt] to [/Volumes/PlexMedia/Movies/The Movie (2019)/The Movie (2019) CD1.eng.srt]
[DUPLICATE] from [/Volumes/PlexMedia/Seeding/The.Movie.2019.1080p/Subs/3_English.srt] to [/Volumes/PlexMedia/Movies/The Movie (2019)/The Movie (2019) CD2.eng.srt]
Processed 3 files
Notify Plex: [host:127.0.0.1, token:################]
GET: http://127.0.0.1:32400/library/sections/all/refresh?X-Plex-Token=################
HttpClientError: http://127.0.0.1:32400/library/sections/all/refresh?X-Plex-Token=################ [401 Unauthorized]

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

Re: Feature request: SRT files

Post by rednoah » 31 Mar 2020, 06:21

The --def subtitles=en option of the amc script will only perform Exact Search and is thus very likely to not return any results if your particular media file isn't very popular around the internet:
viewtopic.php?t=2615


The suball script as separate call is generally recommended, since that will give more options, including -non-strict mode:

Code: Select all

filebot -script fn:suball ...
filebot -script fn:amc ...
:idea: Please read the FAQ and How to Request Help.

jprokos
Posts: 52
Joined: 09 Oct 2016, 02:01

Re: Feature request: SRT files

Post by jprokos » 31 Mar 2020, 06:28

I would rather keep what has been downloaded with the file than search on OpenSubtitles, but I need to keep both srt files not just one. You previously recommended using {plex.derive{if (dc > 1) '.'+di}} in my AMC script to avoid one of them being left behind—that looks like the solution. Not sure how to accomplish this...

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

Re: Feature request: SRT files

Post by rednoah » 31 Mar 2020, 06:36

jprokos wrote:
31 Mar 2020, 06:28
I would rather keep what has been downloaded with the file than search on OpenSubtitles
Then you just disable subtitles altogether. --def subtitles=en means "download additional subtitles" and does not enable or disable the processing of existing subtitles in general.

jprokos wrote:
31 Mar 2020, 06:28
You previously recommended using {plex.derive{if (dc > 1) '.'+di}} in my AMC script to avoid one of them being left behind—that looks like the solution. Not sure how to accomplish this...
Please read up on custom formats if you're unfamiliar with custom formats:
https://www.filebot.net/naming.html

Please read the amc script manual if you need help integrating your custom format with the amc script.
:idea: Please read the FAQ and How to Request Help.

Post Reply