+1
Declined

API or access to launch a scan from localhost

Hayden Jones 4 years ago updated 4 years ago 4

Hi,


I would like to be able to launch a scan of my comic directory from a script. This could be done via a web call to http://localhost/admin/scan/?rescan=true however the admin page requires authentication. Is there anyway to bypass the authentication from localhost or using an apikey?


Thanks,

Declined

Hello, this is not planned at the moment.

See this discussion.

Bottom line is that the scanning process is almost "free" in terms of CPU and memory cost when no new file is added, so doing it every 15 min should cover all use cases.

I have recently started playing around with VBS. I found a simple little script and modified it to do what your asking, or at least get you past the login part:


set WshShell = WScript.CreateObject("WScript.Shell")
sub shell(cmd)
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub



shell """E:\Program Files (x86)\Mozilla Firefox\firefox""192.168.0.110:2202/admin/"



WScript.Sleep 3000
WshShell.SendKeys "PASSWORD"
WScript.Sleep 2000
WshShell.SendKeys "{TAB}"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Quit()


Copy that into notepad and save it as a .VBS file. U will have to change the path to your firefox location and Ubooquity location and change PASSWORD to your password. I have only tested this with firefox not IE. Enjoy!


Here's another version that automatically launches the scan by sending "TAB" keystrokes til it gets to the Launch New Scan link then it sends an "Enter" command, it takes about 10 seconds for the script to run and the scan to launch, but it is automated. NOTICE: Once u launch the script don't click on anything else until it finishes or u could get some weird results.


set WshShell = WScript.CreateObject("WScript.Shell")
sub shell(cmd)
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub



shell """E:\Program Files (x86)\Mozilla Firefox\firefox""192.168.0.110:2202/admin/"



WScript.Sleep 3000
WshShell.SendKeys "PASSWORD"
WScript.Sleep 2000
WshShell.SendKeys "{TAB}"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 5000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WScript.Quit()

Cheers for the suggestions. :)