Move existing srt with AMC script @ uTorrent

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
azeos
Posts: 3
Joined: 10 Mar 2015, 04:18

Move existing srt with AMC script @ uTorrent

Post by azeos »

First of all, thx for the amazing application. I've been using it for a while, but today I decided to try AMC.
I successfully installed the script in uTorrent, this is what I'm using:

Code: Select all

"C:\Program Files\FileBot\filebot.launcher.exe" -script fn:amc --output "G:/Series tmp" --log-file amc.log --action copy --conflict override -non-strict --def "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" "seriesFormat=G:/Series/{n}/{'Temporada '+s.pad(2)}/{n} - {s00e00} - {t}"
I don't want/need to use FileBot to download the corresponding subtitles. I do that by myself. And that seems to be a problem.
Amc script doesn't move the srt file I already have in the folder where the episode is being downloaded. Is it possible to do that?

e.g.
Folder where uTorrent moves finished files:

Code: Select all

|- E:\Matias\Downloads\EX503
    |- New.Girl.S04E16.HDTV.x264-KILLERS.mp4
    |- New.Girl.S04E16.HDTV.x264-KILLERS.srt
Log:

Code: Select all

Parameter: ut_dir = E:\Matias\Downloads\EX503
Parameter: ut_file = New.Girl.S04E16.HDTV.x264-KILLERS.mp4
Parameter: ut_kind = single
Parameter: ut_title = New.Girl.S04E16.HDTV.x264-KILLERS.mp4
Parameter: ut_label = 
Parameter: ut_state = 20
Parameter: seriesFormat = G:/Series/{n}/{'Temporada '+s.pad(2)}/{n} - {s00e00} - {t}
Input: E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.mp4
Group: [tvs:new girl] => [New.Girl.S04E16.HDTV.x264-KILLERS.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [New Girl]
Fetching episode data for [New Girl]
[COPY] Rename [E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.mp4] to [G:\Series\New Girl\Temporada 04\New Girl - S04E16 - Oregon.mp4]
Processed 1 files
mar 10, 2015 1:04:15 AM net.filebot.media.MediaDetection storeMetaInfo
ADVERTENCIA: Failed to set xattr: java.nio.file.AccessDeniedException: G:\Series\New Girl\Temporada 04\New Girl - S04E16 - Oregon.mp4:net.filebot.metadata
Done ヾ(@⌒ー⌒@)ノ
As you can see, the srt file doesn't appears as an input. But if I run this code directly from the command line, it works:

Code: Select all

"C:\Program Files\FileBot\filebot.launcher.exe" -script fn:amc --output "G:/Series tmp" --log-file amc.log --action copy --conflict override -non-strict "E:/Matias/Downloads/EX503" --def "seriesFormat=G:/Series/{n}/{'Temporada '+s.pad(2)}/{n} - {s00e00} - {t}"

Code: Select all

Parameter: seriesFormat = G:/Series/{n}/{'Temporada '+s.pad(2)}/{n} - {s00e00} - {t}
Argument: E:\Matias\Downloads\EX503
Input: E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.mp4
Input: E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.srt
Group: [tvs:new girl] => [New.Girl.S04E16.HDTV.x264-KILLERS.mp4, New.Girl.S04E16.HDTV.x264-KILLERS.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [New Girl]
Fetching episode data for [New Girl]
Auto-detected query: [New Girl]
Fetching episode data for [New Girl]
[COPY] Rename [E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.srt] to [G:\Series\New Girl\Temporada 04\New Girl - S04E16 - Oregon.srt]
[COPY] Rename [E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.mp4] to [G:\Series\New Girl\Temporada 04\New Girl - S04E16 - Oregon.mp4]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
So, is it possible to get the same result but from uTorrent?

Thanks in advanced,
azeos.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move existing srt with AMC script @ uTorrent

Post by rednoah »

If you pass in the folder (i.e. all files in the folder) it'll process the file. If you only pass in one file it'll only process that one file.
:idea: Please read the FAQ and How to Request Help.
User avatar
azeos
Posts: 3
Joined: 10 Mar 2015, 04:18

Re: Move existing srt with AMC script @ uTorrent

Post by azeos »

rednoah wrote:If you pass in the folder (i.e. all files in the folder) it'll process the file. If you only pass in one file it'll only process that one file.
So, I set "ut_file=%D" instead of "ut_file=%F"? That's what you are saying?

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

Re: Move existing srt with AMC script @ uTorrent

Post by rednoah »

Passing this:

Code: Select all

Parameter: ut_dir = E:\Matias\Downloads\EX503
Parameter: ut_file = New.Girl.S04E16.HDTV.x264-KILLERS.mp4
Parameter: ut_kind = single
Is the same as passing this:

Code: Select all

Argument: E:\Matias\Downloads\EX503\New.Girl.S04E16.HDTV.x264-KILLERS.mp4
If uTorrent passses a folder for processing the parameters should look like this:

Code: Select all

Parameter: ut_dir = E:\Matias\Downloads\EX503
Parameter: ut_kind = multi
:idea: Please read the FAQ and How to Request Help.
User avatar
azeos
Posts: 3
Joined: 10 Mar 2015, 04:18

Re: Move existing srt with AMC script @ uTorrent

Post by azeos »

@rednoah: Excellent, thanks for the help.
dauntless101
Posts: 15
Joined: 07 Jan 2016, 19:39

Re: Move existing srt with AMC script @ uTorrent

Post by dauntless101 »

How do you do this if you are using the AMC script as a shell script? Here is what I am using:

Code: Select all

filebot -script fn:amc --output "/home/zachary/mounts/sorted/media/" --action move -non-strict "/home/zachary/complete" --def excludeList=amc.txt --def "seriesFormat=tv/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm={it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/\u0022/, '\'').replaceAll(/[:|]/, '.').replaceAll(/\?/, '!').replaceAll(/[*\s\.]+/, '.').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/[0-9](th|nd|rd)/, { it.lower() })};norm(n) }.{episode.special ? 'S00E'+special.pad(2) : s00e00}.{norm(t)}{'.'+vf}{'.'+source}{'.'+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join('.')}{'.'+vc.replace('Microsoft', 'VC-1')}{'.'+ac.replace('MPEG Audio', 'MP3')}{audio.FormatProfile =~ /MA Core/ ? '-HD.MA' : ''}{audio.FormatProfile =~ /ES/ ? '-ES' : ''}{audio.FormatProfile =~ /Pro/ ? '-Pro' : ''}{'.'+af.replace('8 6ch', '7.1').replace('7 6ch', '6.1').replace('6ch', '5.1').replace('3ch', '2.1').replace('2ch','2.0').replace('1ch','1.0')}{def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g!=null) return '-'+g;}{'.'+lang}" --def "movieFormat=movies/{n} {'('+y+')'}/{norm={it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/\u0022/, '\'').replaceAll(/[:|]/, '.').replaceAll(/\?/, '!').replaceAll(/[*\s\.,]+/, '.').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/[0-9](th|nd|rd)/, { it.lower() })};isLatin = {java.text.Normalizer.normalize(it, java.text.Normalizer.Form.NFD).replaceAll(/\p{InCombiningDiacriticalMarks}+/, '') ==~ /^\p{InBasicLatin}+$/}; isLatin(info.OriginalName) ? norm(info.OriginalName) : norm(primaryTitle) }.({y}){if(isLatin(info.OriginalName) && info.OriginalName != primaryTitle) '.'+ norm(primaryTitle) }{'.'+vf}{'.'+source}{fn.contains('3D') || fn.contains('3-D') ? '.3D':''}{'.'+fn.replace(/(?i)\.DC\./, '.directors.cut.').replaceAll(/director\'?s|theatrical|ultimate/,'$0.Cut').matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR\'?S.CUT|THEATRICAL.CUT|ULTIMATE.CUT|FINAL.CUT|SPECIAL.EDITION/)*.upperInitial()*.lowerTrail().sort().join('.')}{'.'+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join('.')}{'.'+vc.replace('Microsoft', 'VC-1')}{'.'+ac.replace('MPEG Audio', 'MP3')}{audio.FormatProfile =~ /MA Core/ ? '-HD.MA' : ''}{audio.FormatProfile =~ /ES/ ? '-ES' : ''}{audio.FormatProfile =~ /Pro/ ? '-Pro' : ''}{'.'+af.replace('8 6ch', '7.1').replace('7 6ch', '6.1').replace('6ch', '5.1').replace('3ch', '2.1').replace('2ch','2.0').replace('1ch','1.0')}{def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g!=null) return '-'+g;}{'.'+lang}" --def clean=y --def subtitles=en
I run the script on my nzbget completed folder and right now it always deletes the subtitle file instead of moving it. How do I tell it to reference the whole directory?

Thanks!
dauntless101
Posts: 15
Joined: 07 Jan 2016, 19:39

Re: Move existing srt with AMC script @ uTorrent

Post by dauntless101 »

Actually I figured it out on my own. Seems like just adding "ut_kind=multi" to the end of my script did it.
Post Reply