Page 1 of 1

Opensubtitles.org auto-login

Posted: 03 Apr 2015, 11:16
by wilda23
Hello,

I have "server" PC at home running Win 7 Ultimate and it has filebot installed. I'm too lazy to come to the PC and start script manually or launch TeamViewer on my PC, so I googled how to run remote pcs cmd on my pc - it's called "psexec".

Everything went smoothly untill I tried to login to Opensubtitles..

Code: Select all

psexec -u <username> -p <password> \\<server> cmd /s /k cd C:\program files\filebot && filebot -script fn:configure
Enter OpenSubtitles username: 
I entered the username, pressed enter and then it skipped password enetring and huge error popped up.

On my "server" pc i logged in without any problem, however running script remotely through psexec from my PC it's impossible to login into OpenSubtitles acc.

So my question - is it possible to set variables for login directly into CMD to automize it? For example:

Code: Select all

set osdbUser=<user>
set osdbPwd=<password>
psexec ....

or

Code: Select all

psexec -u <username> -p <password> \\<server> cmd /s /k cd C:\program files\filebot && filebot -script fn:configure --def osdbUser=<user> osdbPwd=<password>
Certainly I tried my "solution" with no result, that's why I'm asking.

Re: Opensubtitles.org auto-login

Posted: 03 Apr 2015, 13:59
by xflak
You only have to login once.... You say you're lazy but what you're doing is actually more work

Re: Opensubtitles.org auto-login

Posted: 03 Apr 2015, 15:17
by wilda23
xflak wrote:You only have to login once.... You say you're lazy but what you're doing is actually more work
well, that's not truth - I already logged in on my server machine but when i try to run the script remotely it doesn't allow me to log in - i don't want to install FileBot on my PC, that's why I'm trying to run the script remotely.

Re: Opensubtitles.org auto-login

Posted: 04 Apr 2015, 16:59
by rednoah
well, that's not truth
Well, it is.


But hey, why not try for yourself?

Code: Select all

$ filebot -clear-prefs
Reset preferences

$ filebot -script fn:osdb.stats
limit_check_by = user_ip
...

$ filebot -script fn:configure
Enter OpenSubtitles username: XY
Enter OpenSubtitles password: XY
Testing OpenSubtitles... OK

$ filebot -script fn:osdb.stats
limit_check_by = user_id
...
So what exactly is the issue? (future posts that do not include logs will be ignored)

Re: Opensubtitles.org auto-login

Posted: 05 Apr 2015, 12:09
by wilda23
This is batch file i created download subs on demand:

Code: Select all

C:\Users\Jakub\Desktop>chcp 1250
Active code page: 1250

C:\Users\Jakub\Desktop>set _user=server

C:\Users\Jakub\Desktop>set _heslo=server776781132

C:\Users\Jakub\Desktop>set _server=\\192.168.0.99

C:\Users\Jakub\Desktop>cd C:\

C:\>psexec -u server -p server776781132 \\192.168.0.99 -s cmd /s /k "set id=\\192.168.0.99\server_ext\SharedMedia\TV Shows && cd c:\scripts && fetch_subtitle_path.bat && pause"

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com



c:\SCRIPTS>chcp 1250
Active code page: 1250

c:\SCRIPTS>IF NOT DEFINED id SET /P id=Adresa:

c:\SCRIPTS>cd C:\Program Files\FileBot

C:\Program Files\FileBot>filebot -script fn:suball --log-file amc.log -non-strict "\\192.168.0.99\server_ext\SharedMedia\TV Shows " --lang en --conflict override -non-strict
Locking C:\Windows\system32\config\systemprofile\AppData\Roaming\FileBot\logs\amc.log
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Arrow\Season 03]
No missing subtitles
Exclude: \\192.168.0.99\server_ext\SharedMedia\TV Shows\Boardwalk Empire\Season 02
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Boardwalk Empire\Season 03]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Boardwalk Empire\Season 04]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Boardwalk Empire\Season 05]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Game of Thrones\Season 04]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\Game of Thrones\Special]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\House\Season 01]
No missing subtitles
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\House\Season 02]
Get [English] subtitles for 2 files
CmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`
Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\House\Season 03]
Get [English] subtitles for 1 filesCmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`

Fetch subtitles for [\\192.168.0.99\server_ext\SharedMedia\TV Shows\House\Season 04]
Get [English] subtitles for 2 filesCmdlineException: OpenSubtitles: Please enter your login details by calling `filebot -script fn:configure`
This is my CMD line on my computer trying to login into OpenSubtitles remotely - when i press enter right after filling username it skips entering password.

Code: Select all

C:\Users\Jakub>cd c:\

c:\>psexec -u server -p server776781132 \\192.168.0.99 -s cmd

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com


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

C:\Windows\system32>cd C:\program files\filebot

C:\Program Files\FileBot>filebot -script fn:osdb.stats
limit_check_by = user_ip
global_24h_download_limit = 200
client_ip = 62.209.197.2
client_24h_download_count = 8
client_download_quota = 192
client_24h_download_limit = 200
Done ?(?????)?
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.

C:\Program Files\FileBot>filebot -script fn:configure
Enter OpenSubtitles username: wilda23
Enter OpenSubtitles password: IllegalArgumentException: Illegal login: wilda23Failure (░_░)

java.lang.IllegalArgumentException: Illegal login: wilda23
        at net.filebot.WebServices.setLogin(WebServices.java:286)
        at net.filebot.WebServices$setLogin.callStatic(Unknown Source)

        at Script1.run(Script1.groovy:9)C:\Program Files\FileBot>
        at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
        at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
        at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:112)
        at net.filebot.Main.main(Main.java:169)
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.
I'm loggend in on my server machine, as I've mentioned already, but I can not login on my remote machine..

Re: Opensubtitles.org auto-login

Posted: 06 Apr 2015, 03:22
by rednoah
Don't use psexec then. It seems to have issues with console-interactive programs. The output looks jumbled up as well...

Use remote desktop to login and then use a local cmd to enter your user details.

Re: Opensubtitles.org auto-login

Posted: 06 Apr 2015, 08:25
by wilda23
rednoah wrote:Don't use psexec then. It seems to have issues with console-interactive programs. The output looks jumbled up as well...

Use remote desktop to login and then use a local cmd to enter your user details.
"too complicated" - i know what remote desktop or teamviewer is - this should be way to make it easier and faster - i think installing filebot on my machine would solve the issue however it's not as good solution - it'd be great to input opensub. login information directly into CMD

Re: Opensubtitles.org auto-login

Posted: 19 Apr 2015, 06:46
by rednoah
Improved support for pseudo TTY and STDIN redirection with r2890 so you should be able to feed user/password to the fn:configure script via standard input.

Re: Opensubtitles.org auto-login

Posted: 19 Apr 2015, 07:02
by wilda23
rednoah wrote:Improved support for pseudo TTY and STDIN redirection with r2890 so you should be able to feed user/password to the fn:configure script via standard input.
I've tried to run psexec again and the same error..

Re: Opensubtitles.org auto-login

Posted: 19 Apr 2015, 07:09
by rednoah
Works on headless/embedded Linux:

Code: Select all

cat osdb.txt | filebot -script dev:configure

Code: Select all

Enter OpenSubtitles username: Enter OpenSubtitles password: Testing OpenSubtitles... OK

Re: Opensubtitles.org auto-login

Posted: 19 Apr 2015, 07:11
by wilda23
rednoah wrote:Works on headless/embedded Linux:

Code: Select all

cat osdb.txt | filebot -script dev:configure

Code: Select all

Enter OpenSubtitles username: Enter OpenSubtitles password: Testing OpenSubtitles... OK
well, this is gonna be problem - i'm running windows 8.1 :D

Re: Opensubtitles.org auto-login

Posted: 19 Apr 2015, 07:23
by rednoah
Input/Output still works the same. It's about as basic as it gets. But I'm not sure how psexec handles input/output/error streams, but I'm sure it supports providing standard input somehow and then sending it to the remote process.

Re: Opensubtitles.org auto-login

Posted: 11 Aug 2017, 10:58
by stavros
I agree with wilda23, there should be an option to specify these on the command line. I use the Docker image, and there's no way that I can see to specify credentials, as I only get one command.

Re: Opensubtitles.org auto-login

Posted: 11 Aug 2017, 14:09
by rednoah
Configure FileBot:

Code: Select all

filebot -script fn:configure
Configure FileBot inside a docker image:

Code: Select all

docker run -it -v $PWD:/volume1 -v data:/data rednoah/filebot -script fn:configure
If you get one command, then you get one command that can include many commands, e.g. by calling bash. But you really just need to call configure once, and then the configuration will be persisted on the "data" virtual mount point, just like other things such as caches that need to be retained between different filebot calls.

Re: Opensubtitles.org auto-login

Posted: 11 Aug 2017, 14:14
by stavros
That workaround works for me, but it seems like there's an awful lot of workarounds just to avoid implementing a command-line switch. Is there a reason for not just doing that?

Re: Opensubtitles.org auto-login

Posted: 12 Aug 2017, 04:13
by rednoah
I don't really follow. It doesn't make sense to configure common FileBot settings with specialized custom scripts such as the amc script.

What use case (exactly, with examples) is currently not possible or difficult?

e.g. auto-login:

Code: Select all

FILEBOT="docker run -it -v $PWD:/volume1 -v data:/data rednoah/filebot"

$FILEBOT -script fn:configure --def osdbUser=$OSDB_USER --def osdbPwd=$OSDB_PASSWORD
$FILEBOT -script fn:amc ...

Re: Opensubtitles.org auto-login

Posted: 08 Nov 2017, 14:34
by thielj
At least on a Linux system, you can get away with the following:

Code: Select all

echo "net/filebot/osdb.user=USERNAME\:$(echo -n PASSWORD | md5sum - | cut -b -32)" > prefs.properties
The FileBot docker container expects prefs.properties in the container's /data folder.