Opensubtitles.org auto-login

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Opensubtitles.org auto-login

Post 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.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Opensubtitles.org auto-login

Post by xflak »

You only have to login once.... You say you're lazy but what you're doing is actually more work
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Re: Opensubtitles.org auto-login

Post 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.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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)
:idea: Please read the FAQ and How to Request Help.
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Re: Opensubtitles.org auto-login

Post 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..
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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.
:idea: Please read the FAQ and How to Request Help.
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Re: Opensubtitles.org auto-login

Post 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
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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.
:idea: Please read the FAQ and How to Request Help.
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Re: Opensubtitles.org auto-login

Post 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..
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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
:idea: Please read the FAQ and How to Request Help.
wilda23
Posts: 6
Joined: 03 Apr 2015, 11:03

Re: Opensubtitles.org auto-login

Post 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
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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.
:idea: Please read the FAQ and How to Request Help.
stavros
Posts: 2
Joined: 11 Aug 2017, 10:57

Re: Opensubtitles.org auto-login

Post 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.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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.
:idea: Please read the FAQ and How to Request Help.
stavros
Posts: 2
Joined: 11 Aug 2017, 10:57

Re: Opensubtitles.org auto-login

Post 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?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Opensubtitles.org auto-login

Post 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 ...
:idea: Please read the FAQ and How to Request Help.
thielj
Posts: 55
Joined: 05 Nov 2017, 22:15

Re: Opensubtitles.org auto-login

Post 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.
Post Reply