Hire Request! BitTorrent to Plex Automation

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Newbie and complete amateur at coding here. I'm looking to automate my BitTorrent downloads so that they are named correctly and will appear in my Plex library without me having to do anything other than start the download. Essentially, I want it to organise my downloads into separate folders for TV Shows and Music on my F: drive and music in the itunes folder on my C: drive. I use the Plex agents for getting subtitles and art work, so I don't think I need filebot to do that, but I would like Filebot to be able to delete the empty folders and files after it has done its work.

I've spent a couple of hours reading these forums and it looks like what I need is certainly possible, but I'm way out of my depth here, so I'd be more than happy to make a donation if someone has the time to give me an 'Idiots Guide' style walk- through of what I need to do.

Thanks for any help you can give me!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

The main issue will be that filebot can only copies files while they're being seeded. Moving is probably not possible as long as your torrent client locks the file.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Thanks for the quick reply. What about pointing all new downloads to a single folder and then having filebot move them after they have fully downloaded? I gather filebot can recognise the difference between TV and movie files.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

I do assume you've read this beforehand:
http://www.filebot.net/forums/viewtopic.php?f=4&t=215

Yes, it can do everything you want. Just not deleting torrent from your torrent client or something like that.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Ok, I read all the information on that page and also found this post where someone was looking to do something pretty similar to me: http://www.filebot.net/forums/viewtopic.php?f=4&t=1296

I tried it, but as I expected it isn't working.

Here's the code I've been trying:

Filebot -script fn:amc --log-file amc.log --action copy --conflict override -non-strict --def "movieFormat=F:\Movies{n} ({y})/{n} ({y}) {'CD'+pi}" "seriesFormat=F:\TV Shows{n}/{'Season '+s}/{n} {sxe} {t}" music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def plex=hostname

Please point out the error of my ways!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

What's not working? What's the console output? When you say BitTorrent, do you mean uTorrent? Cause this command only works if called from uTorrent which will replace the %variables before making the call.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Sorry yeah I switched to utorrent just to follow the instructions to a T. I think it's renaming the files but not putting them where they're supposed to go. How can I show you the console output?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

See Troubleshooting notes. Basically you just need to run the command in a new console window, then you see the output. Also if filebot was called at all there will be logs in the filebot appdata folder.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

ok, thanks for your continued responses. Here's the log from the last few things I tried:

Parameter: movieFormat = G:/Movies/{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = E:/TV/{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label = %L
Parameter: ut_state = %S
Parameter: ut_title = %N
Parameter: ut_kind = %K
Parameter: ut_file = %F
Parameter: ut_dir = %D
Parameter: plex = hostname
Done ヾ(@⌒ー⌒@)ノ
Parameter: movieFormat = G:/Movies/{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = E:/TV/{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label =
Parameter: ut_state = 20
Parameter: ut_title = Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]
Parameter: ut_kind = multi
Parameter: ut_file = game.of.thrones.s02e01.hdtv.xvid-fqm.avi
Parameter: ut_dir = F:\Downloaded\Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]
Parameter: plex = hostname
Input: F:\Downloaded\Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]\game.of.thrones.s02e01.hdtv.xvid-fqm.avi
Exclude: F:\Downloaded\Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]\Torrent Downloaded From ExtraTorrent.com.txt
Group: [tvs:game of thrones] => [game.of.thrones.s02e01.hdtv.xvid-fqm.avi]
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Matched [game.of.thrones.s02e01.hdtv.xvid-fqm.avi] to [Game.of.Thrones.s02e01.hdtv.xvid-fqm.The.North.Remembers] via filehash
Fetching [Game.of.Thrones.s02e01.hdtv.xvid-fqm.The.North.Remembers.srt]
Export [Game.of.Thrones.s02e01.hdtv.xvid-fqm.The.North.Remembers.srt] as: SubRip / UTF-8
Writing [Game.of.Thrones.s02e01.hdtv.xvid-fqm.The.North.Remembers.srt] to [game.of.thrones.s02e01.hdtv.xvid-fqm.eng.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [Game of Thrones]
Fetching episode data for [Game of Thrones]
Auto-detected query: [Game of Thrones]
Fetching episode data for [Game of Thrones]
[COPY] Rename [F:\Downloaded\Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]\game.of.thrones.s02e01.hdtv.xvid-fqm.eng.srt] to [E:\TV\Game of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.srt]
[COPY] Failed to rename [F:\Downloaded\Game of Thrones S02E01 The North Remembers HDTV XviD-FQM[ettv]\game.of.thrones.s02e01.hdtv.xvid-fqm.eng.srt]
IOException: Failed to create folder: E:\TV\Game of Thrones\Season 2
Done ヾ(@⌒ー⌒@)ノ
Parameter: movieFormat = G:/Movies/{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = E:/TV/{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label =
Parameter: ut_state = 20
Parameter: ut_title = Mayday Air Crash Investigation Season 05 of 13 HQ x264
Parameter: ut_kind = multi
Parameter: ut_file = 5 01 Slammed to the Ground.mp4
Parameter: ut_dir = F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264
Parameter: plex = hostname
Input: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 01 Slammed to the Ground.mp4
Exclude: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\~uTorrentPartFile_B7D272F3.dat
Group: [tvs:mayday] => [5 01 Slammed to the Ground.mp4]
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Looking up subtitles by name via OpenSubtitles
No matching subtitles found: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 01 Slammed to the Ground.mp4
Rename episodes using [TheTVDB]
Auto-detected query: [Mayday]
Fetching episode data for [Mayday (2013)]
Fetching episode data for [Mayday (1999)]
[COPY] Rename [F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 01 Slammed to the Ground.mp4] to [E:\TV\Mayday (2013)\Season 1\Mayday (2013) 1x01 Episode 1.mp4]
[COPY] Failed to rename [F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 01 Slammed to the Ground.mp4]
IOException: Failed to create folder: E:\TV\Mayday (2013)\Season 1
Done ヾ(@⌒ー⌒@)ノ
Parameter: movieFormat = F:\Movies{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = F:/TV Shows{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = n
Parameter: ut_label =
Parameter: ut_state = 20
Parameter: ut_title = Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Parameter: ut_kind = single
Parameter: ut_file = Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Parameter: ut_dir = F:\Downloaded
Parameter: plex = hostname
Input: F:\Downloaded\Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Group: [tvs:game of thrones] => [Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4]
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Matched [Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4] to [Game.of.Thrones.S02E01.HDTV.RM-ASAP_en] via filehash
Fetching [Game.of.Thrones.S02E01.HDTV.RM-ASAP_en.srt]
Export [Game.of.Thrones.S02E01.HDTV.RM-ASAP_en.srt] as: SubRip / UTF-8
Writing [Game.of.Thrones.S02E01.HDTV.RM-ASAP_en.srt] to [Game.of.Thrones.S02E01.HDTV.RM-ASAP.eng.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [Game of Thrones]
Fetching episode data for [Game of Thrones]
Auto-detected query: [Game of Thrones]
Fetching episode data for [Game of Thrones]
[COPY] Rename [F:\Downloaded\Game.of.Thrones.S02E01.HDTV.RM-ASAP.eng.srt] to [F:\TV ShowsGame of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.srt]
[COPY] Rename [F:\Downloaded\Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4] to [F:\TV ShowsGame of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.mp4]
Processed 2 files
Apr 04, 2014 6:35:29 PM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.nio.file.AccessDeniedException: F:\TV ShowsGame of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.mp4:metadata
Notify Plex: hostname
UnknownHostException: hostname
Done ヾ(@⌒ー⌒@)ノ
Parameter: movieFormat = F:\Movies{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = F:/TV Shows{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = n
Parameter: ut_label =
Parameter: ut_state = 20
Parameter: ut_title = Mayday Air Crash Investigation Season 05 of 13 HQ x264
Parameter: ut_kind = multi
Parameter: ut_file = 5 01 Slammed to the Ground.mp4
Parameter: ut_dir = F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264
Parameter: plex = hostname
Input: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 02 Deadly Glide.mp4
Exclude: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\~uTorrentPartFile_B7D272F3.dat
Group: [tvs:mayday] => [5 02 Deadly Glide.mp4]
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Looking up subtitles by name via OpenSubtitles
No matching subtitles found: F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 02 Deadly Glide.mp4
Rename episodes using [TheTVDB]
Auto-detected query: [Mayday]
Fetching episode data for [Mayday (2013)]
Fetching episode data for [Mayday (1999)]
[COPY] Rename [F:\Downloaded\Mayday Air Crash Investigation Season 05 of 13 HQ x264\5 02 Deadly Glide.mp4] to [F:\TV ShowsMayday (2013)\Season 1\Mayday (2013) 1x02 Episode 2.mp4]
Processed 1 files
Apr 04, 2014 6:39:44 PM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.nio.file.AccessDeniedException: F:\TV ShowsMayday (2013)\Season 1\Mayday (2013) 1x02 Episode 2.mp4:metadata
Notify Plex: hostname
UnknownHostException: hostname
Done ヾ(@⌒ー⌒@)ノ
Parameter: movieFormat = F:/Movies/{n} ({y})/{n} ({y}) {'CD'+pi}
Parameter: seriesFormat = F:/TV Shows/{n}/{'Season '+s}/{n} {sxe} {t}
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_label =
Parameter: ut_state = 20
Parameter: ut_title = Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Parameter: ut_kind = single
Parameter: ut_file = Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Parameter: ut_dir = F:\Downloaded
Parameter: plex = hostname
Input: F:\Downloaded\Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4
Group: [tvs:game of thrones] => [Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4]
No missing subtitles
Rename episodes using [TheTVDB]
Auto-detected query: [Game of Thrones]
Fetching episode data for [Game of Thrones]
[COPY] Rename [F:\Downloaded\Game.of.Thrones.S02E01.HDTV.RM-ASAP.mp4] to [F:\TV Shows\Game of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.mp4]
Processed 1 files
Apr 04, 2014 7:55:28 PM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: Failed to set xattr: java.nio.file.AccessDeniedException: F:\TV Shows\Game of Thrones\Season 2\Game of Thrones 2x01 The North Remembers.mp4:metadata
Fetching series artwork for [Game of Thrones] to [F:\TV Shows\Game of Thrones\Season 2]
Fetching F:\TV Shows\Game of Thrones\poster.jpg => {id=833691, BannerMirror=http://thetvdb.com/banners/, BannerPath=posters/121361-4.jpg, BannerType=poster, BannerType2=680x1000, Language=en, Rating=6.9610, RatingCount=77}
Fetching F:\TV Shows\Game of Thrones\banner.jpg => {id=900055, BannerMirror=http://thetvdb.com/banners/, BannerPath=graphical/121361-g19.jpg, BannerType=series, BannerType2=graphical, Language=en, Rating=7.1282, RatingCount=39}
Fetching F:\TV Shows\Game of Thrones\fanart.jpg => {id=858638, BannerMirror=http://thetvdb.com/banners/, BannerPath=fanart/original/121361-15.jpg, BannerType=fanart, BannerType2=1920x1080, Colors=|206,210,222|27,27,27|75,80,86|, Language=en, Rating=7.4118, RatingCount=68, SeriesName=false, ThumbnailPath=_cache/fanart/original/121361-15.jpg, VignettePath=fanart/vignette/121361-15.jpg}
Fetching F:\TV Shows\Game of Thrones\Season 2\poster.jpg => {id=896574, BannerMirror=http://thetvdb.com/banners/, BannerPath=seasons/121361-2.jpg, BannerType=season, BannerType2=season, Season=2, Language=en, Rating=7.6129, RatingCount=31}
Fetching F:\TV Shows\Game of Thrones\Season 2\banner.jpg => {id=896577, BannerMirror=http://thetvdb.com/banners/, BannerPath=seasonswide/121361-2.jpg, BannerType=season, BannerType2=seasonwide, Season=2, Language=en, Rating=9.3333, RatingCount=3}
Fetching F:\TV Shows\Game of Thrones\clearart.png => {type=clearart, id=17624, url=http://assets.fanart.tv/fanart/tv/12136 ... 588447.png, lang=en, likes=9}
Fetching F:\TV Shows\Game of Thrones\logo.png => {type=clearlogo, id=3238, url=http://assets.fanart.tv/fanart/tv/12136 ... 121361.png, lang=en, likes=12}
Fetching F:\TV Shows\Game of Thrones\landscape.jpg => {type=tvthumb, id=18471, url=http://assets.fanart.tv/fanart/tv/12136 ... 899663.jpg, lang=en, likes=5}
Fetching F:\TV Shows\Game of Thrones\Season 2\landscape.jpg => {type=seasonthumb, id=17750, url=http://assets.fanart.tv/fanart/tv/12136 ... 445d21.jpg, lang=en, likes=10, season=2}
Notify Plex: hostname
UnknownHostException: hostname
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

FileBot doesn't have permissions to write to the destination:

Code: Select all

IOException: Failed to create folder: E:\TV\Game of Thrones\Season 2
I assume this is not a local folder, but some sort of network drive, and somehow the permissions are not working.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Ok, I seem to have made some progress but I've hit a new problem which is really confusing me.

The automation is now running to the extent that it is renaming the files and moving them to where I want them to go, but the weird thing is that they won't show up in Plex at all, even if I manually tell it to update the library. I noticed on another thread that the command to tell Plex to update is based on it being at the 32400 port but mine is at 13758, is this anything to do with it?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

Nope, if they don't show up in Plex then that's weird. Again, my best guess is permissions are not right, i.e. Plex isn't allowed to read the files.

If the port is different then plex=hostname won't work, but that couldn't affect manual rescan.
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Ok, a simple system restart seemed to solve this problem, should have tried that first!

Two more things and then I think I'm in business:

1. How do I change the code so that filebot doesn't download artwork and subtitles? The Plex agents already do this so I want to avoid overlap.

2. After it moves the files to the location I want, it leaves a copy in the downloaded folder, how do I make it delete that?

Thanks again for your help, I'll certainly be sending a donation your way when I'm fully up and running.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

1. Remove this option:

Code: Select all

artwork=y
2. As long as the files are seeding, utorrent will lock the files so they can't be moved or deleted. Also don't be a leecher. :P
:idea: Please read the FAQ and How to Request Help.
Richardjw84
Posts: 8
Joined: 03 Apr 2014, 13:10

Re: Hire Request! BitTorrent to Plex Automation

Post by Richardjw84 »

Yeah that's a fair point, what about setting it up so that it clears that folder periodically? That way I can seed for a bit and then clear the space. My hard drive isn't that big so I can't afford room for two copies of everything I download.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Hire Request! BitTorrent to Plex Automation

Post by rednoah »

You'll still need to Delete+Remove from utorrent first. The filebot cleaner script can get rid of empty folders and left behind txt,nfo,etc files.

I can recommend to just buy a new hard drive, storage is cheap nowadays. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply