[Windows] Context Menu w/ Folder Watcher+Scripts Pack [1.8]

How-to guides, frequently asked questions, not-so-obvious features, etc
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ztrust »

hey Ithiel
is there somewhere i can it to run cmd minimized I have tried it myself but not with much luck
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ithiel »

Hi ZTrust,

Two things:

1. Is subtitle fetch still playing up for you? It stopped working for me for a while.. then started working again, without me changing anything (and I can't see any notes in the changelog for filebot) - so I'm wondering if it was a problem with OpenSubtitles or something, lol.

2. With regards to running cmd minimized, the solution would be implementing something like this:
http://www.howtogeek.com/131597/can-i-r ... nd-prompt/

It was on my todo list during my last holiday, but I never quite got around to it. It's still something I intend to implement, but it won't be until the Christmas/New Year break I'm afraid (not that it's all that far away).
There can be only one Power² User
User avatar
alexander_q
Posts: 21
Joined: 19 Aug 2014, 02:02

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by alexander_q »

I like this script, but I also can't decipher the tv_shows.txt and the like. I've managed to cut out the rating and get rid of the "0" padding on season numbers, but can't figure out how to get rid of the mandatory year (this was causing 99% of shows to not be indexed by XBMC - on TVDB, the shows only contain the year of release if there was an earlier show with the same title) and put the "the" at the front.

Can you assist me? Here is the contents of my tv_shows.txt:

Code: Select all

{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() }).replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""} ({y})/{episode.special ? 'Special' : 'Season '+s.pad(1)}/{norm(n)} {episode.special ? 'S00E'+special.pad(2) : s00e00} {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':""}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, " ") + ')'}{" Part $pi"}{" [$vf $vc $ac $af]"}
Thristle
Posts: 2
Joined: 06 Nov 2014, 14:15

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Thristle »

im getting this massage (normal installer)
Image
using the preview installer a CMD window just opens and closes
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ztrust »

hey
Sorry it has taken me this crazy long time to repsond.
I lost my laptop for 2 weeks or so I felt defiled and had to reinstall everything and im affraid I then forgot about this post.
but the answer is both yes and no for the most part it seems to have fixed it self and for the rest I think its me that has f.... up somewhere this script used to download matching subs even if the filename wasent the same but it dosent do that anymore but im thinking it might be me that has done something wrong in my amc setup.

regarding the cmd. I had looked at the link but I could not get it to work becauce it said the /start was not recognized but I will live its running on my server again so I dont notice it anymore.
But thanks for all.
this is as crusial as filebot itself ;)
what ever is keeping youy away from the forums I wish you good luck

ztrust
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

Hi Ithiel

When I right-click a file and then click fetch subtitle, a cmd prompt appears without any admin request privileges. Is there a way to make the watch feature does the same, but silently. I mean it appears and then request admin rights--interrupting anything you're doing.

Also Filebot has disappeared from my context menu, do I have to reinstall?
Image
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ithiel »

Hi MarFilot,

There are three issues in your post, which I'd like to address separately:

1. Silent Running: This is similar to a request from Ztrust and a few others. Yes, there is a way that I can make it do this, however it requires some fairly significant re-writing and a crapload of testing (cmd is great for full transparency coding that doesn't need to be compiled, but debugging is a real prick). I'm hoping to work on this over the Christmas/New Year holidays (I have a short attention span, so the whole "spending time with family" thing is going to lose its appeal pretty fast, haha).

2. UAC/Admin Request: It sounds like your UAC settings are set high, and it's freaking about the CMD window. Unfortunately, even if I changed this to the silent method, UAC would still likely jump up and down in a hissy fit about it... It's UAC - being a pain in the ass is kinda it's "thing", lol. Can you please try changing the UAC notification settings to "Never" in the (Windows) Action Centre, reboot, and let me know if it's still happening.

3. Missing Context Menu: The menu is added via the registry - if it's missing, it means something removed the registry keys. Safest bet is to uninstall/reinstall the context menu.


Please Note: When I do the re-write, it will all be done on using the latest version of FileBot available at the time, with the majority of testing being done on Windows 8 Pro x64 (although I might do some testing on Windows 10 Technical Preview because.. well.. what else does one do with a Win10 box, eh?).

So far the main things I'm looking at are:
- ensuring ongoing compatibility with the latest version of FileBot,
- silent running of scheduled tasks,
- ideally replacing the now depreciated bitsadmin for file transfers (great, more frigging PowerShell *sigh*),
- investigating Windows 10 compatibility.

Anyway, if there are any other major bugs that people have noticed or reasonable feature requests that they would like to make, now's the time to ask :-)

Cheers,

Ithiel
There can be only one Power² User
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

Ithiel wrote:Hi MarFilot,

There are three issues in your post, which I'd like to address separately:

1. Silent Running: This is similar to a request from Ztrust and a few others. Yes, there is a way that I can make it do this, however it requires some fairly significant re-writing and a crapload of testing (cmd is great for full transparency coding that doesn't need to be compiled, but debugging is a real prick). I'm hoping to work on this over the Christmas/New Year holidays (I have a short attention span, so the whole "spending time with family" thing is going to lose its appeal pretty fast, haha).

2. UAC/Admin Request: It sounds like your UAC settings are set high, and it's freaking about the CMD window. Unfortunately, even if I changed this to the silent method, UAC would still likely jump up and down in a hissy fit about it... It's UAC - being a pain in the ass is kinda it's "thing", lol. Can you please try changing the UAC notification settings to "Never" in the (Windows) Action Centre, reboot, and let me know if it's still happening.

3. Missing Context Menu: The menu is added via the registry - if it's missing, it means something removed the registry keys. Safest bet is to uninstall/reinstall the context menu.


Please Note: When I do the re-write, it will all be done on using the latest version of FileBot available at the time, with the majority of testing being done on Windows 8 Pro x64 (although I might do some testing on Windows 10 Technical Preview because.. well.. what else does one do with a Win10 box, eh?).

So far the main things I'm looking at are:
- ensuring ongoing compatibility with the latest version of FileBot,
- silent running of scheduled tasks,
- ideally replacing the now depreciated bitsadmin for file transfers (great, more frigging PowerShell *sigh*),
- investigating Windows 10 compatibility.

Anyway, if there are any other major bugs that people have noticed or reasonable feature requests that they would like to make, now's the time to ask :-)

Cheers,

Ithiel
Hi Ithiel,

Thanks for responding. Great responses! :)

I will reinstall the script--I figured as much that that was the issue.

I'm running Windows 7, and will be until I can afford a better system to run the latest Windows OS in 64bit.

The main problem I have is that whenever the schedule watch starts, UAC kicks in and I have to click 'Yes'. However, when I fetch subtitles, it doesn't appear. You mentioned that I should change it to never. I use UAC because it can be really handy. I've never turned it off before--but I know how to.
Am I the only one that gets interrupted by the UAC each time a schedule watch starts?
Assuming that you don't get interrupted, is it that your UAC is set to never?

I'm looking forward to the upgrade. Although, it does sound tiring.

P.S. I do have the latest Filebot version.
That "...short attention span..." was really funny--lol.
Image
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ithiel »

Hi MarFilot,

Interestingly, Windows 8 actually tends to run better on the same hardware as Windows 7. Only downside is that it means you're running Windows 8 :-P

Ah.. Win8 ain't that bad though. Start screen thing just takes a while to get used to. If you're keen to upgrade to the newest OS though, but don't want to part with any coin, assuming it isn't a work computer, you could always check out the Technical Preview for Windows 10. It's free to join/use during the test window (which should be going for nearly another year), and it is Microsoft's 'intent' to allow seamless upgrades to the final version (without having to format you're preview edition).

Keep in mind though.. the Technical Preview is still in some serious early days at the moment, so some stuff doesn't work, and others are forever being changed... but if it isn't a 'work' computer, and you're keen to want to try out new stuff.. could be worth a look in.

What were we talking about again? Oh, yeah.. context menu! (see - short attention span, lol)

I've never run into that particular issue myself, but I have UAC disabled. Can you try (temporarily) disabling UAC to see if it makes the problem go away (you can also test it out on a few of the different levels as well to see if that has any effect)? You don't need to leave it off forever - just long enough to see if that's the problem. If it is, let me know, and I'll see if I can do something about it in the next release. No assurances though, cause I have nfi what's causing it yet :-P
There can be only one Power² User
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

Hi Ithiel,

I have a Sony Vaio VGN-NS110E laptop. Sony stated that this model doesn't support a Windows 8 upgrade. However, I could upgrade to a 32bit version of Win8 with the current specs of my laptop. I'm assuming a Win10 would be the same. Some of the specs are as stated below:
Processor: Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz (2 CPUs), ~2.0GHz
Memory: 2048MB RAM
Display Adapter: Intel GM45/47 Chipset - Integrated Graphics
Display Memory: 829 MB

I don't want a 32bit; I want a 64bit version. I use multimedia applications like Toon Boom/Photoshop/Illustrator. They run best on 64it systems. My laptop's RAM can only be upgraded to 4GB max, and that's the minimum requirement for a 64bit system.

I set my UAC level to Never. The watch schedule just ran and I was prompted for admin privileges; it resolved it.
Image
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Ithiel »

Hi MarFilot,

-------------------
Context Menu/UAC:

Just wanting to confirm the last bit of your message there - you're saying that when you disabled UAC and rebooted, there weren't any more alerts anymore? If so, what UAC setting did you change it to/from? I'll have a look into the way I schedule the tasks and see if there is a way I can make it not need that work around, but... just as a heads up... if it turns out to be a big ol' mess to fix, that particular problem may fall into the "waaay too much fluffing about" pile though :-/

-------------------
Windows 10:

While the integrated graphics chip leaves a little to be desired, after upgrading to 4GB ram, that machine should have no dramas running either Windows 8 or 10.

Please keep in mind however that this is general specifications reference only and does not constitute as individual technical advice. Which operating system is best for you will depend on a number of different issues, such as accessories, required software, licencing costs, or if your universe divides by zero.

Windows 10 is still heavily under development and is not recommended for production (work) machines, and making lots and lots of backups is strongly encouraged.

If you are keen to try out the new version of Windows and are willing to take the risk that it could explode into a fiery inferno of death, destruction, and panda tears - power to you.. I've got it running on a machine almost identical to that, but with a Radeon card instead of the integrated graphics, and it's been as happy as a pig in mud.

That being said though, if the only reason to upgrade is because of a UAC notification from a fan-created context menu for free file renamer program... I'd probably hold off for the time being :-)

-------------------
32 bit vs 64 bit:

As long as you have a 64 bit capable CPU (which the C2D is), you should be fine running an x64 version of the operating system. It won't make any difference on 2GB, but may help slightly with 4GB ram (to ensure that all of it us usable - long story, but tl;dr version is your gpu also contributes to the 32bit memory limit), and would also allow you to run the x64 versions of apps.

Keep in mind though that all the Adobe suite ships with both 32 and 64 bit installers (generally both get installed), and you will want to use different versions at different times (depending on the type of work you're doing at the time, addons/extensions you are using, and how unstable that particular adobe program wants to be today).

Also, 32bit may have a maximum but 64 bit does not have a minimum. I installed a 64 bit version of Windows 7 on an Atom based ultra portable laptop that had 2GB ram, and if its processing power was dynamite, it wouldn't have enough to blow the screen cover open... but it still worked, lol :-)
There can be only one Power² User
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

Hi Ithiel,

Daaaaamn! Great information. Most definitely will be looking into those. Thanks.

In regards to the Context Menu/UAC issue, I changed my UAC settings from 'Default' to 'Never'; restarted my PC and it hasn't alerted me since. For the context menu issue--where Filebot was missing--I reinstalled the script and that resolved it.


----------------------------------------------------------------------------


Another problem. The registry got changed again for me. Must be TuneUp. I disabled registry cleaning now. Anyway, I uninstalled the script and reinstalled it. When I was scheduling a watch folder, I saw a message in cmd telling me that 'The system cannot find the specified file'.
http://prntscr.com/5ik6mi

When I try to fetch subtitle, cmd appeared for less than a second and then disappeared. Nothing happened.

I reinstalled the script again, but during the installation process I'm seeing this in cmd:
http://prntscr.com/5ik45t

EDIT:
forget the last part
Last edited by MarFilot on 12 Jan 2015, 19:48, edited 1 time in total.
Image
Gavin
Posts: 2
Joined: 23 May 2014, 15:54

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by Gavin »

Got something of a problem with this script which I hope hasn't been happening the whole time I've been using it because I only just noticed this:
I Renamed a movie using the context menu Rename Movie (TheMovieDB). Sure enough the process runs , my movie (9.5GB) is renamed and moved to the new VIdeos location as specified in setup and there is the movie seemingly OK. However the movie is now only 1.1GB in size. The whole f***ing moving is lost and unrecoverable and I only have the first ten minutes of it. WTF!!!
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

No more responses, huh?

Is it possible to have the watch settings modified, so that it fetches subtitles in sub-folders of the folder being watched?
I'm watching ...\Downloads\TV Shows. Some of my torrents are being downloaded in folders and not as single files, so I would need the script to cover them as well.

EDIT:

The script actually downloads subs for sub-folders only when there isn't any immediate media file in the root of the watch folder.
How would I change the script, so that it download for both?

Thanks
Image
sevenalive
Posts: 3
Joined: 22 Oct 2014, 06:50

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by sevenalive »

Thanks for the context menu, greatly appreciated.
TehBotol
Supporter
Posts: 34
Joined: 06 Mar 2013, 00:01

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by TehBotol »

Looks great shame it no longer updated...

btw -get-subtitles is disabled in filebot viewtopic.php?f=4&t=5#p8871
so your subtitle context menu is no longer works

also is there a way to make this cmdlets not moving the file i renamed?
so it just rename the file without moving it

EDIT1: Nevermind, i can edit the tv_shows.groovy inside the cmdlets folder and delete the output line so it wont move the file
jclancy103
Posts: 6
Joined: 20 Jan 2015, 06:59

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by jclancy103 »

Is it possible to after rename and move a movie file using the windows right-click filebot/rename option to also clean the left over folder and files.

I have tried to play with the movies.groovy file by adding clean, by adding filebot -script fn:cleaner but all I get is errors while trying to run that.

Thanks for answering,
John
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

So I'm getting

Code: Select all

Lookup by hash failed: 401 Unauthorized
when the script for the watched folder runs.

When that happens I log in again and run the fetch subtitles script manually and it runs fine, but when the watch script runs again, problem.

Something is definitely wrong here.
I signed in again via Filebot app and ran the script manually. I downloaded 1 subtitle, but I got back the 401 error from before.
It only download 1 subtitle at a time now.
The folder that I'm watching has sub folders named based on the series name, and sub-sub folders within those sub folders with the actual files.
Image
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by rednoah »

Did you set OpenSubtitles username/password yet? Also, FileBot settings a stored per user. So if you set username/password with one user, you need to make sure that you again call the script as that user later. Which user is you watch script running as?

Code: Select all

filebot -script fn:configure --def osdbUser=XXX osdbPwd=YYY

Code: Select all

filebot -script fn:suball ...
:idea: Please read the FAQ and How to Request Help.
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

rednoah wrote:Did you set OpenSubtitles username/password yet? Also, FileBot settings a stored per user. So if you set username/password with one user, you need to make sure that you again call the script as that user later. Which user is you watch script running as?...
Firstly, thanks for responding :)

Only 1 user.
The script that I refer to is the script provided i this thread to install the cmdlets. I don't understand what you meant by which user am I using...
rednoah wrote:...

Code: Select all

filebot -script fn:configure --def osdbUser=XXX osdbPwd=YYY

Code: Select all

filebot -script fn:suball ...
The first code that you posted, should I create a batch file with that and run it?
And the 2nd script is for?

I had already set the password.
I logged in via the application, from the login button in the 'Subtitles' section.
I also ran the 'opensubtitles_login.cmd' file from the cmdlets.

The following code

Code: Select all

filebot -script fn:osdb.stats
gave me

Code: Select all

limit_check_by = user_id
user_id = XXXXXXX
global_24h_download_limit = 200
client_ip = XXXXXXXXXXXXXX
client_24h_download_count = 4
client_download_quota = 196
client_24h_download_limit = 200
Image
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by rednoah »

This means you're logged in:

Code: Select all

user_id = XXXXXXX
This means you're not logged in:

Code: Select all

Lookup by hash failed: 401 Unauthorized
(might be a server issue though)


You say it always works when running it manually, but it never works when called automatically in the background? Correct?


You can either wait for Ithiel to have a look, or start debugging it yourself:
viewtopic.php?f=3&t=3067

I'd start by calling filebot -script fn:osdb.stats in the same way the watcher script is called, and see if the output for that is different. Also, there's Fiddler so you can inspect the HTTP communication and see if it makes sense.
:idea: Please read the FAQ and How to Request Help.
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

rednoah wrote: ...
Okay, let me clarify.

When I said manually I meant right-click the 'TV Shows' folder>FileBot>Fetch>Subtitles without...

I just created the script to fetch all subtitles.

Code: Select all

filebot -script fn:suball "C:/Users/MarHutchy/Downloads/TV SHOWS" -non-strict --def maxAgeDays=7 > "C:/Users/MarHutchy/Downloads/TV SHOWS/log.txt"
It produced this:
http://pastebin.com/33jwvJ0i

instead of this:
http://prntscr.com/8pzee8

I read your post about debugging shell script.

Here's what I got when I ran my script:

Code: Select all

filebot -script fn:suball "C:/Users/MarHutchy/Downloads/TV SHOWS" -non-strict --def maxAgeDays=7 & filebot -script fn:sysenv > "C:/Users/MarHutchy/Downloads/TV SHOWS/log.txt" 2>&1
It produced this:
http://pastebin.com/exXSMVnq
Image
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by rednoah »

1.
Install Fiddler and FileBot 4.6.1 pre-release:
http://www.telerik.com/fiddler
https://sourceforge.net/projects/filebo ... ebot/HEAD/

2.
Run Fiddler and then run filebot.platform.exe to search for & download subtitles. Now you'll see the HTTP communication between FileBot and OpenSubtitles API in Fiddler.

3.
See if the HTTP requests/responses make sense. If you get a 409 error, make sure you copy request/response for that exact error.
:idea: Please read the FAQ and How to Request Help.
MarFilot
Posts: 34
Joined: 18 Nov 2014, 12:10

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by MarFilot »

rednoah wrote:1.
Install Fiddler and FileBot 4.6.1 pre-release:
http://www.telerik.com/fiddler
https://sourceforge.net/projects/filebo ... ebot/HEAD/

2.
Run Fiddler and then run filebot.platform.exe to search for & download subtitles. Now you'll see the HTTP communication between FileBot and OpenSubtitles API in Fiddler.

3.
See if the HTTP requests/responses make sense. If you get a 409 error, make sure you copy request/response for that exact error.
Sorry for being such a bother, but which filebot file should I download? The link that you provided has one executable file which is from August and the others are only jar files. I downloaded the first jar file that was recently modified, but I don't know where to find the filebot.platform.exe file that you mentioned.
Image
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Windows] Context Menu w/ Folder Watcher+Scripts Pack [1

Post by rednoah »

1.
Open the link, click FileBot_4.6.1_B4 (the latest), then download FileBot_4.6.1_x64.msi (installer for your platform). After installing you should start FileBot using the FileBot (platform) link, instead of the FileBot link.

2.
Using Fiddler to look at the OpenSubtitles requests would look something like this:
Image

You can copy & paste the request/response text from the two panels on the right (Raw view).
:idea: Please read the FAQ and How to Request Help.
Post Reply