JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #41  
Old 22.12.2010, 11:38
brunano21
Guest
 
Posts: n/a
Default

Hello, I'm Italian and I apologize for my poor English.
I have rewritten the code CHRONOMASTER making it a bit more streamlined and simple.
Now the script simply emits a sound with a delay of 3 seconds and no window will appear
Below I will carry the full code:
Code:
cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         Brunano21

 Script Function:
    Captcha Sound Alert for JDownloader

 Script Version: 1.0

 Script Date: 12/20/2010

#ce ----------------------------------------------------------------------------

; ----------- Settings ------------- ;

; Set Captcha Window Title
; English Example: "fileserve.com: Please enter" -> "Please enter"
; Italian Example: "fileserve.com: Inserire" -> "Inserire"
; Spanish Example: "fileserve.com: Por favor ingresar" -> "Por favor ingresar"
; German  Example: "fileserve.com: Bitte eingeben!" -> "Bitte eingeben!"

; Already set for English. Don't add the Colon and Space in front as it will be added automatically. 
$Title = "Inserire"

; Set the sound intervals in milliseconds (1000 milliseconds = 1 second)
$SoundDelay = 3000

; Set path of the audio file (Example "C:\Users\USERNAME\Music\Somefile.wav")
$SoundFile = @WindowsDir & "\media\notify.wav"

; Do not change this unless needed
$DetectWindow = "[TITLE:: " & $Title & "; CLASS:SunAwtDialog]"


; When enabled it displays the current(not realtime) line number and command in the system tray icon tooltip.
$Debug = False

; -------- Settings  End ----------- ;


TraySetToolTip("Captcha Sound Alert")
Opt("TrayAutoPause",0)
Opt("WinTitleMatchMode",2)

If Not FileExists($SoundFile) Then
    MsgBox(262144,"Script Error - Captcha Sound Alert for JDownloader", 'The file "' & $SoundFile & '" was not found.' & @CRLF & 'Please set a valid audio file in the script.')
    Exit
EndIf
While 1
		Sleep(1000)
        If (WinExists($DetectWindow))then
			SoundPlay($SoundFile)
            Sleep($SoundDelay)
		EndIf
	
WEnd
Reply With Quote
  #42  
Old 16.02.2011, 15:54
freigeistlein
Guest
 
Posts: n/a
Default

i have downloaded autoit and copy paste the script into it.

afterwords i have started my pc again. i click on run the script and start jdownloader but when the field comes to put in the captcha no sounds are displayed... why can this happen? what i am doing wrong?



edit: i am a fool >-<

Last edited by freigeistlein; 16.02.2011 at 19:54.
Reply With Quote
  #43  
Old 17.02.2011, 11:44
remi
Guest
 
Posts: n/a
Default

Try "Captcha Alert : a simple tool solution.".
Reply With Quote
  #44  
Old 09.05.2011, 11:54
Iridos
Guest
 
Posts: n/a
Default overkill

I'd have expected a plugin/setting to be able to do that... but good idea to just watch for the window.
But the length of the scripts is a bit excessive... if you have wmctrl installed, this one-liner will do the same:
Code:
while true; do sleep 10; if  wmctrl -l |grep 'Please enter'  ; then beep -f 880 ; fi; done
I used beep (which you'd also have to install) for the higher-frequency beep here, probably you can just do "echo ^G" here (where ^G is the "beep" special character) or echo -e \\a

Cheers,
I.
Reply With Quote
  #45  
Old 30.05.2011, 23:11
wakillon
Guest
 
Posts: n/a
Default

A multi languages solution

Code:
#Include <WinAPI.au3>
#include <Array.au3>

While 1
    $_WinList = WinList ( "[REGEXPCLASS:SunAwt]" )
    For $_I = 1 To UBound ( $_WinList ) - 1
	    If WinGetHandle ( "JDownloader" ) = _WinAPI_GetParent ( $_WinList[$_I][1] ) And _
		_WinAPI_GetClassName ( $_WinList[$_I][1] ) = 'SunAwtDialog' Then SoundPlay ( @WindowsDir & '\media\notify.wav' )
    Next
    Sleep ( 2000 )
WEnd
Script ask for a child window of JDownloader and his classname...;)
Reply With Quote
  #46  
Old 31.05.2011, 10:14
remi
Guest
 
Posts: n/a
Default

Can you please explain how this should be installed and run?

Does it work for all pop-up windows of jD?
Reply With Quote
  #47  
Old 18.06.2011, 11:55
titus titus is offline
Peta Loader
 
Join Date: Jan 2010
Posts: 184
Default

Install AutoIt as usual, save the script as .au3 and start it.
Reply With Quote
  #48  
Old 09.07.2011, 13:48
wyxchari
Guest
 
Posts: n/a
Default

http://board.jdownloader.org/showpos...93&postcount=1
Reply With Quote
  #49  
Old 04.09.2011, 20:38
croote
Guest
 
Posts: n/a
Default

Hi,

Without installing xdotools, you can create a script like this:
Code:
#!/bin/sh 
  
while [ true ]; do
	WIN=`xwininfo -root -children -all | grep -i "Please enter"`

	if [ -n "$WIN" ]; then
		echo "Capcha Windows detected!"
		aplay /usr/share/sounds/speech-dispatcher/test.wav
	fi
	sleep 5
  
done
have fun!

bye
Reply With Quote
  #50  
Old 06.09.2011, 13:46
Dumah Brazorf
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wakillon View Post
A multi languages solution

Code:
#Include <WinAPI.au3>
#include <Array.au3>

While 1
    $_WinList = WinList ( "[REGEXPCLASS:SunAwt]" )
    For $_I = 1 To UBound ( $_WinList ) - 1
	    If WinGetHandle ( "JDownloader" ) = _WinAPI_GetParent ( $_WinList[$_I][1] ) And _
		_WinAPI_GetClassName ( $_WinList[$_I][1] ) = 'SunAwtDialog' Then SoundPlay ( @WindowsDir & '\media\notify.wav' )
    Next
    Sleep ( 2000 )
WEnd
Script ask for a child window of JDownloader and his classname...;)
For whom don't have speakers i suggest to change the part
SoundPlay ( @WindowsDir & '\media\notify.wav' )
with
Beep(500,500)

Beep(x,y) where x is the frequency pitch of the beep and y the duration. It should be possibile use multiple beep to reproduce a multitone siren.
If the case speaker doesn't beep remove/disable the sound card.

I'm not so happy to have this thing work every 2 seconds, I beg developers to reintroduce an option in jdownloader.

Last edited by Dumah Brazorf; 06.09.2011 at 13:49.
Reply With Quote
  #51  
Old 13.09.2011, 14:43
randomthing
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by drbits View Post
Code:
while (`ps -e | grep "java.*"') {
    if (`ps -e --windowtitle | grep "*.?\Please Enter"') beep 700 2
    sleep 2
    }
Code:
#!/usr/bin/python

from Xlib import display, X
import re
import time 
import os

display = display.Display()
while 1:

    win_list = display.screen().root.query_tree().children
    for win in win_list:
        try:
            name = win.get_wm_name()
            if name is not None and name.find("Please enter") >= 0:
                os.system("aplay /myspecialpath/sounds/error.wav")
        except Exception as e:
            print e
    print 
    time.sleep(5)
Works nicely for me on linux.
Reply With Quote
  #52  
Old 06.01.2012, 13:05
jDoX jDoX is offline
JD Fan
 
Join Date: Jan 2012
Posts: 71
Default

Thanks. I use Mac OS X 10.6.8. Any solution for Mac?
Reply With Quote
  #53  
Old 06.01.2012, 13:41
remi
Guest
 
Posts: n/a
Default

Most Linux scripting solutions should work on the Mac as well.
Reply With Quote
  #54  
Old 06.01.2012, 15:18
jDoX jDoX is offline
JD Fan
 
Join Date: Jan 2012
Posts: 71
Default

Quote:
Originally Posted by remi View Post
Most Linux scripting solutions should work on the Mac as well.
Thanks. How to use it on Mac? A step-by-step procedure will be most appreciated. Please, note that I am not a programmer but a simple plain Mac user.
Reply With Quote
  #55  
Old 07.01.2012, 12:09
remi
Guest
 
Posts: n/a
Default

All you need is your preferred text editor and the Terminal application.

1) Copy the script in post #49 from this thread and paste it in your text editor window;

2) Replace the "#!/bin/sh" with "#!/bin/bash";

3) Save the file as "captchalert.sh".

4) Make the file executable with the command "chmod +x captchalert.sh" instruction. You can do that with the Terminal application.

The script should work without installing additional programs. In other threads of this forum there are other shell scripts you can try. I've seen one written in one line.

This script searches for a window containing "Please enter" in its title. This might change in future versions of the program. In my .ahk script for Windoze I use the string ": Please enter" which is more precise.
Reply With Quote
  #56  
Old 13.04.2012, 23:30
wakillon
Guest
 
Posts: n/a
Default

A small improvement :

For avoid to play wav sound for all pop-up windows of jD,
script ask for the Window size as additional condition.
The use of _DateDiff permit the use of a sleep with a little value
who doesn't "slows" the loop, then you can add anything else in the loop.
If you are interested by this powerfull and free scripting language, take a look
to autoitscript.com and his forums.

Code:
#Include <Date.au3>

Global  $_ITimer = _NowCalc ( )

While 1
    $_NowCalc = _NowCalc ( )
    If _DateDiff ( "s", $_ITimer, $_NowCalc ) >= 2 And ProcessExists ( 'javaw.exe' ) Then _CheckCaptchaDialog ( ) ; check every 2 sec
    Sleep ( 30 )
WEnd

Func _CheckCaptchaDialog ( )
    $_ITimer = $_NowCalc
    $_WinList = WinList ( "[REGEXPCLASS:SunAwt]" )
    For $_I = 1 To UBound ( $_WinList ) - 1
        If WinGetHandle ( "JDownloader" ) = _WinAPI_GetParent ( $_WinList[$_I][1] ) And _
            _WinAPI_GetClassName ( $_WinList[$_I][1] ) = 'SunAwtDialog' Then
	    $_WinPos = WinGetPos ( $_WinList[$_I][1] )
	    If Not @error And $_WinPos[2] = 320 And $_WinPos[3] = 150 Then SoundPlay ( @WindowsDir & '\media\notify.wav' )
	EndIf
    Next
EndFunc ;==> _CheckCaptchaDialog ( )
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 05:12.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.