[Windows+uT] Help with some AMC Script issues

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

[Windows+uT] Help with some AMC Script issues

Post by ronniehd »

Code: Select all

"C:/Program Files/FileBot/filebot.launcher.exe" -script fn:amc --output "S:/myMedia" --log-file amc.log --action move --conflict override -non-strict --def excludeList=amc.txt "movieFormat={label}/{n} {y}/{n} {y}" "seriesFormat={label}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}" unsorted=y music=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def clean=y xbmc=localhost
Hello, I'm having a few problems with custom AMC Script above:

1. --def clean=y is not working. After media file(s) is moved and renamed the leftovers remain. I ran this script many times now and its not cleaning up.
See screenshot: I downloaded complete season 1 of Dexter, script moved and renamed the video files but left the folders and .DAT file.
Image

2. When I add a torrent with many files to download e.g: a complete season of a TV show and I pick 1 or few other files to download (I do this to check quality, if I like then I proceed to download the rest but still little by little), once "finished" downloading uTorrent runs the script and move from S:/Downloads/Incomplete to S:/Downloads then proceeds to rename and move to its final location BUT back in uT I see error (RED) in the torrent I was downloading and I'm unable to download the rest of the files, it becomes tricky and I have to do a workarround in order to get it downloading the rest of the files but the download continues in S:/Downloads directory, ALSO sometimes script puts folders under Unsorted directory just empty folders.

In the end I have to do the clean up manually, remove AMC log and AMC.txt and run the script manually in cmd :(

What am I missing?

Thanks in advance! and happy new year!!!
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

1.
Logs? The cleaner script won't just delete everything. If there's unkown files, it won't touch anything.

See docs & code:
viewtopic.php?f=4&t=5#p1341


2.
You're not supposed to use --action move anyway. Your torrent client will keep a file lock and FileBot won't be able to move anything. You should use --action hardlink if possible, and --action copy if necessary.
:idea: Please read the FAQ and How to Request Help.
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

Re: [Windows+uT] Help with some AMC Script issues

Post by ronniehd »

Thank you for your response!

Ok here is the Logger of a recent complete tv show season download:

Code: Select all

[2016-01-03 18:08:03]  Executing: "C:/Program Files/FileBot/filebot.launcher.exe" -script fn:amc --output "S:/myMedia" --log-file amc.log --action hardlink --conflict override -non-strict --def excludeList=amc.txt "movieFormat={label}/{n} {y}/{n} {y}" "seriesFormat={label}/{n}/{episode.special ? 'Special' : 'Season '+s}/{n} - {s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}" unsorted=y music=y deleteAfterExtract=y root=y "ut_label=TV Shows" "ut_state=5" "ut_title=The Big Bang Theory Season 08 (720p) S08 Complete 8 MP4 HDTV [KoTuWa]" "ut_kind=%K" "ut_file=" "ut_dir=S:\Downloads\The Big Bang Theory Season 08 (720p) S08 Complete 8 MP4 HDTV [KoTuWa]" --def clean=y pushbullet=token xbmc=localhost
and here is the complete log:
http://pastebin.com/mn2rXMHp

1. I used --action hardlink this time and did not have problem with the uT downloading little by little so that's good but once finished all files remain in S:/myMedia/Downloads. Files did copy/mirror or whatever to the right final location and so far nothing has gone to unsorted folder.

I think i get it why files are not being cleaned up when downloading in certain ways with a torrent client (like dl some and not all files of a torrent or dl in parts little by little). i would like to know if by using --action hardlink when i select "Remove And > Delete .torrent + Data" within uTorent the mirrored files in the final location won't be also removed [Edit: Confirmed it doesn't remove them], or i rather use --action copy
Guess with uTorrent i'll have to use Delete .torrent + Data afterall, right?

2. Checked the complete log and there are some WARNINGS (ADVERTENCIAS) related to java, don't know if that is normal.

3. I've also noticed that "ut_kind=%K" remains the same so no value is being picked up

Please also check this log from a manual download with compressed files:
http://pastebin.com/PnLEMJAd

4. Apparently all went good but when i checked the final location episodes 3 and 11 were missing, nothing in unsorted folder, probably was something on my side. Had to manually download those episodes again as cleaning did a pretty good job there.

5. How can i make the main/root folder e.g: S:\Downloads\Zorro 1957 season 1 of a download be gone too?

Thank you for your time.
Last edited by ronniehd on 04 Jan 2016, 16:33, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

1.
If you use MOVE and CLEAN while seeding it's not surprising that it doesn't work, since Windows won't allow it to move/delete files that are in use. If you use hardlink/copy you can delete the original files without loosing the organized files.

2.
Ignore the warnings. If you're not using NTFS filesystem then xattr (Extended Attributes) won't work.

3.
You're using an older uT version. Newer versions will set %K to either single or multi. So you may or may not have issues with processing single file torrents.

5.
You can pass in your own formats. Read the manual.
:idea: Please read the FAQ and How to Request Help.
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

Re: [Windows+uT] Help with some AMC Script issues

Post by ronniehd »

1. Yeah I realized of all that. I'll keep testing. Thanks!

2. OK

3. I'll have an eye on it

5. You misunderstood that one. I meant how can I make cleaner also clean the main/root folder of a downloaded torrent (the bold part of the example I gave is NOT a format I want to apply, is the main folder i want to also be cleaned up).

S:/Downloads/torrent DL title/Downloaded files
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

5.
You can call the clean script on that folder yourself.

--def clean=y behaves different when setting --action move or copy/hardlink and in the latter case it's just deleting files that are created by the script.
:idea: Please read the FAQ and How to Request Help.
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

Re: [Windows+uT] Help with some AMC Script issues

Post by ronniehd »

Hello @rednoah, wondering if you made changes in the script since my last post (First week of January) ?
When I created this thread I was running Windows 10 and {labels} was working fine with uTorrent sub-labels as in the form: eg: Movies/BLURAY , days later I downgraded to Windows 8.1 and sub-labels stopped working. Like if I add a torrent to Movies/BLURAY sub-label, the script will now move it to "Movies BLURAY" folder and won't create/take it as directory even though in the log shows Label= Movies/BLURAY, the problem happen until the end of the script when file is moved to final destination.
Is there I way to fix this?

Thank you in advance!
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

Logs?

EDIT:

All {values} will be stripped of path separators (\ and/). This has always been the case, otherwise unexpected / characters in bindings like {t} in certain episode titles would inadvertently create subfolders.
:idea: Please read the FAQ and How to Request Help.
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

Re: [Windows+uT] Help with some AMC Script issues

Post by ronniehd »

Here's the log of one of the movies that I added to sub-label:
http://pastebin.com/HF0KwHt3

I'm not sure of what your trying to say in your last post.
I just hope it can be done. I like the way I have organized my media.

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

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

Any and all bindings are sanitized, meaning that \ and / are removed. If you pass in --def "Movies/BLURAY" then label will evaluate to Movies BLURAY.

You can easily force back / into your format though:

Code: Select all

{label.replace(' ', '/')}
You may want to use ':' instead of ' ' as separator in the label though, in case your labels contain spaces.
:idea: Please read the FAQ and How to Request Help.
ronniehd
Posts: 10
Joined: 29 Dec 2015, 17:01

Re: [Windows+uT] Help with some AMC Script issues

Post by ronniehd »

Hi, i finally could test but only:

Code: Select all

{label.replace(' ', '/')}

Is working :) but haven't tested with labels that contain space yet, when I do and if I find an issue I'll post back.

Code: Select all

{label.replace(':', '/')}
Doesn't work, keep getting "Movies BLURAY" folder

Thank you!
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows+uT] Help with some AMC Script issues

Post by rednoah »

For {label.replace(':', '/')} to work the label would have to be "Movies:BLURAY" obviously. Read the code. :D
:idea: Please read the FAQ and How to Request Help.
Post Reply