Automating UT downloads

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
fodder1
Posts: 4
Joined: 24 Jan 2014, 00:04

Automating UT downloads

Post by fodder1 »

Hi Everyone.

I was only just put onto FILEBOT and, oh man is this a nice program!

Background!
i need to get utorrent to run a command when teh file finishes and then file bot to do its thing.
I am running utorrent on a windows machine and then getting FB to do its thing and move it to a share on my NAS (UNRAID)

problems!

OK, when i was put onto FB i ran some tests and it worked very well.
Here is a simple test command that works, it creates the directory structure needed, copies the file and renames it like a dream.

Code: Select all

 
filebot -script fn:amc --output "//XXXXXX/videos/scratch area/new" --action copy -non-strict "\\XXXXXXX\torrent\Completed torrents\Almost.Human.S01E08.720p.HDTV.X264-DIMENSION" --def excludeList=amc.txt 


Integrate with UT!
Some reading and bit of searching and i find the help section on UT integration.
I used the example script and had no end of problems.
More reading and a 64-bit version java later with several reboots and the code below does not work, but the one above does.

Code: Select all

filebot -script fn:amc --output "\\XXXXXX\video\scratch area\New" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=" "ut_state=5" "ut_title=Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264" "ut_kind=multi" "ut_file=Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv" "ut_dir=T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264"
here is the error when ran from a (administrator) dos prompt
(The code is copied from a dos window, so it is all one line for the command, but displays wrong)

Code: Select all

filebot -script fn:amc --output "\\XXXXXX\video\scratch are
a\New" --log-file amc.log --action copy --conflict override -non-strict --def m
usic=y subtitles=en artwork=y "ut_label=" "ut_state=5" "ut_title=Continuum.S02E0
7.Second.Degree.720p.WEB-DL.AAC2.0.H264" "ut_kind=multi" "ut_file=Continuum.S02E
07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv" "ut_dir=T:\Completed torrents\Cont
inuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264"
Locking C:\Users\Chris\AppData\Roaming\FileBot\logs\amc.log
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label =
Parameter: ut_state = 5
Parameter: ut_title = Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264
Parameter: ut_kind = multi
Parameter: ut_file = Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv
Parameter: ut_dir = T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WE
B-DL.AAC2.0.H264
Input: T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H
264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt
Input: T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H
264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv
Group: [tvs:Continuum] => [Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H26
4.eng.srt, Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv]
No missing subtitles
Rename episodes using [TheTVDB]
Auto-detected query: [Continuum]
Fetching episode data for [Continuum]
Fetching episode data for [Continuum (SyFy)]
Resource not found: http://thetvdb.com/api/58B4AA94C59AD656/series/272518/all/en
.xml
Fetching episode data for [Continuum (Web Series)]
Auto-detected query: [Continuum]
Fetching episode data for [Continuum]
Fetching episode data for [Continuum (SyFy)]
Resource not found: http://thetvdb.com/api/58B4AA94C59AD656/series/272518/all/en
.xml
Fetching episode data for [Continuum (Web Series)]
Jan 24, 2014 11:23:58 AM net.sourceforge.filebot.media.MediaDetection storeMetaI
nfo
WARNING: Failed to set xattr: java.nio.file.NoSuchFileException: T:\Completed to
rrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264\Continuum.S02E07.S
econd.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt:metadata
Jan 24, 2014 11:23:58 AM net.sourceforge.filebot.media.MediaDetection storeMetaI
nfo
WARNING: Failed to set xattr: java.nio.file.NoSuchFileException: T:\Completed to
rrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264\Continuum.S02E07.S
econd.Degree.720p.WEB-DL.AAC2.0.H264.mkv:metadata
[COPY] Rename [T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.
AAC2.0.H264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt] to [
\\XXXXXX\video\scratch area\New\TV Shows\Continuum\Season 02\Continuum - S0
2E07 - Second Degree.eng.srt]
[COPY] Failed to rename [T:\Completed torrents\Continuum.S02E07.Second.Degree.72
0p.WEB-DL.AAC2.0.H264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng
.srt]
IOException: Failed to create folder: \\XXXXXX\video\scratch area\New\TV Sh
ows\Continuum\Season 02
Done Òâ¥(´╝áÔîÆÒâ╝ÔîÆ´╝á)ÒâÄ

I grabbed the actual string used from the "logging" tab as described in the how to.
There are two problems:-
1> it is failing to create the folder.
2> "WARNING: Failed to set xattr: java.nio.file.NoSuchFileException:"
but that is in the one that works. I tried searching for both problems but came up with nothing that i could see that would help.

Any ideas please?

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

Re: Automating UT downloads

Post by rednoah »

Ignore the warnings, that's just optional stuff.

For some reason it can't create the parent folder structure:

Code: Select all

IOException: Failed to create folder: \\XXXXXX\video\scratch area\New\TV Shows\Continuum\Season 02
There's nothing I can do about that, Windows just doesn't allow you to create a folder. Check your permissions, which user owns the network share, which user is running utorrent, try mounting the share as local drive, etc
:idea: Please read the FAQ and How to Request Help.
fodder1
Posts: 4
Joined: 24 Jan 2014, 00:04

Re: Automating UT downloads

Post by fodder1 »

Hi and thanks for taking the time to look!

Yeah that is the strange bit.
rednoah wrote:Ignore the warnings, that's just optional stuff.

For some reason it can't create the parent folder structure:

Code: Select all

IOException: Failed to create folder: \\XXXXXX\video\scratch area\New\TV Shows\Continuum\Season 02
There's nothing I can do about that, Windows just doesn't allow you to create a folder. Check your permissions, which user owns the network share, which user is running utorrent, try mounting the share as local drive, etc
AS both of those examples, the simple on (that works) and the UT example are run from the same CMD window, on the same box.
So, it can't be the permissions can it?

The simple example is also a bunch of RAR files , that FB has unrar'd and stuck in the "origninal" UT folder then copied.

Also i was playing around a bit and created the folder structure needed for the UT example (that is jsut 3 files) so that i can jsut copy the file, but that didn't work either, same error.

So i don't think it is permissions based, as far as i know them.

Any other ideas

(here are both commands run is the same CMD window)

Code: Select all


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.


C:\Users\Chris>filebot -script fn:amc --output "\\xxxxxx\video\scratch area
\New" --log-file amc.log --action copy --conflict override -non-strict --def mus
ic=y subtitles=en artwork=y "ut_label=" "ut_state=5" "ut_title=Continuum.S02E07.
Second.Degree.720p.WEB-DL.AAC2.0.H264" "ut_kind=multi" "ut_file=Continuum.S02E07
.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv" "ut_dir=T:\Completed torrents\Contin
uum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264"
Locking C:\Users\Chris\AppData\Roaming\FileBot\logs\amc.log
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label =
Parameter: ut_state = 5
Parameter: ut_title = Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264
Parameter: ut_kind = multi
Parameter: ut_file = Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv
Parameter: ut_dir = T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WE
B-DL.AAC2.0.H264
Input: T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H
264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt
Input: T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H
264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv
Group: [tvs:Continuum] => [Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H26
4.eng.srt, Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.mkv]
No missing subtitles
Rename episodes using [TheTVDB]
Auto-detected query: [Continuum]
Fetching episode data for [Continuum]
Fetching episode data for [Continuum (SyFy)]
Resource not found: http://thetvdb.com/api/58B4AA94C59AD656/series/272518/all/en
.xml
Fetching episode data for [Continuum (Web Series)]
Auto-detected query: [Continuum]
Fetching episode data for [Continuum]
Fetching episode data for [Continuum (SyFy)]
Resource not found: http://thetvdb.com/api/58B4AA94C59AD656/series/272518/all/en
.xml
Fetching episode data for [Continuum (Web Series)]
Jan 24, 2014 7:16:39 PM net.sourceforge.filebot.media.MediaDetection storeMetaIn
fo
WARNING: Failed to set xattr: java.nio.file.NoSuchFileException: T:\Completed to
rrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264\Continuum.S02E07.S
econd.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt:metadata
Jan 24, 2014 7:16:39 PM net.sourceforge.filebot.media.MediaDetection storeMetaIn
fo
WARNING: Failed to set xattr: java.nio.file.NoSuchFileException: T:\Completed to
rrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264\Continuum.S02E07.S
econd.Degree.720p.WEB-DL.AAC2.0.H264.mkv:metadata
[COPY] Rename [T:\Completed torrents\Continuum.S02E07.Second.Degree.720p.WEB-DL.
AAC2.0.H264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng.srt] to [
\\xxxxxx\video\scratch area\New\TV Shows\Continuum\Season 02\Continuum - S0
2E07 - Second Degree.eng.srt]
[COPY] Failed to rename [T:\Completed torrents\Continuum.S02E07.Second.Degree.72
0p.WEB-DL.AAC2.0.H264\Continuum.S02E07.Second.Degree.720p.WEB-DL.AAC2.0.H264.eng
.srt]
IOException: Failed to create folder: \\xxxxxx\video\scratch area\New\TV Sh
ows\Continuum\Season 02
Done Òâ¥(´╝áÔîÆÒâ╝ÔîÆ´╝á)ÒâÄ

C:\Users\Chris>filebot -script fn:amc --output "//xxxxxx/videos/scratch are
a/new" --action copy -non-strict "\\xxxxxx\torrent\Completed torrents\Almos
t.Human.S01E08.720p.HDTV.X264-DIMENSION" --def excludeList=amc.txt
Parameter: excludeList = amc.txt
Argument: \\xxxxxx\torrent\Completed torrents\Almost.Human.S01E08.720p.HDTV
.X264-DIMENSION
Read archive [not.quite.human.108.720p-dimension.rar] and extract to [\\xxxxxx
\torrent\Completed torrents\Almost.Human.S01E08.720p.HDTV.X264-DIMENSION\not.
quite.human.108.720p-dimension\Almost.Human.S01E08.720p.HDTV.X264-DIMENSION]
Skipped extracting files [\\xxxxxx\torrent\Completed torrents\Almost.Human.
S01E08.720p.HDTV.X264-DIMENSION\not.quite.human.108.720p-dimension\Almost.Human.
S01E08.720p.HDTV.X264-DIMENSION\Almost.Human.S01E08.720p.HDTV.X264-DIMENSION.mkv
]
Done ?(?????)?

C:\Users\Chris>
C:\Users\Chris>

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

Re: Automating UT downloads

Post by rednoah »

I see calls, the first fails at creating a folder, the seconds doesn't do anything, and succeeds at not doing anything.

For testing you probably don't want to set this:

Code: Select all

--def excludeList=amc.txt
The file is added to the excludeList on the first run, which then fails, but the second run checks the excludeList and thinks this file has already been processed, and thus ignores it, ending up with nothing to do.
:idea: Please read the FAQ and How to Request Help.
fodder1
Posts: 4
Joined: 24 Jan 2014, 00:04

Re: Automating UT downloads

Post by fodder1 »

Hi Everyone.

I had a fresh look at it today. Rednoha is the man so i played around with running the command under different users, with no luck.

So instead of using a UNC path i used a mapped path in the the string (CMD window) and it worked!
filebot -script fn:amc --output "v:\scratch area\New" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=" "ut_state=5" "ut_title=Continuum.S02E08.Second.Listen.720p.WEB-DL.AAC2.0.H264" "ut_kind=multi" "ut_file=Continuum.S02E08.Second.Listen.720p.WEB-DL.AAC2.0.H264.mkv" "ut_dir=T:\Completed torrents\Continuum.S02E08.Second.Listen.720p.WEB-DL.AAC2.0.H264"
so :oops: it was a permissions issue, just not one i can explain!
(the user it uses in the CMD widow should be the same used by the share. )

I have updated the string in uTorrent and i am downloading another file to see if it works with automation, but i suspect it will.

I think it downloading the covers, fanart, posters etc is a waste of time as i don't think PLEX uses the "local" (IE in the directory) files.
But the size and convenience is worth the small space usage.

Now to see what else this little wonder of a program can do.

thank you for your time!
User avatar
rednoah
The Source
Posts: 23939
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automating UT downloads

Post by rednoah »

1. Nobody understands Windows permissions, and it never makes sense. For some reason mapped drives and UNC shares are handled completely different by Windows internally for some reason it seems.

2. artwork=y doesn't just enable artwork, but also everything else HTPC software may be using, like .nfo files with TheMovieDB/TheTVDB IDs (which is definitely useful).
:idea: Please read the FAQ and How to Request Help.
Post Reply