JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12.09.2010, 14:58
CHRONOMASTER
Guest
 
Posts: n/a
Talking Captcha Sound Alert for JDownloader [AutoIt - Script Code] (Updated 9/20/2010)

Hello Everyone,


Today I'm bringing you a useful AutoIt script that should help out a few JDownloader users.

What this script does is it creates a sound alert that repeats every 5 seconds
until the alert is canceled when a captcha window in JDownloader pops up.

Requirements:
  • AutoIt v3
  • Windows XP/Vista/7

v1.1 (9/20/2010)
  • Added $Title variable to "Settings" to help non-English JDownloader users set captcha window detection.
  • Changed the default $SoundFile variable to a audio file available to all XP/Vista/7 users.

Code:
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         CRONOMASTER

 Script Function:
    Captcha Sound Alert for JDownloader

 Script Version: 1.1

 Script Date: 9/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 = "Please enter"  

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

; 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 ----------- ;



#include <ButtonConstants.au3>
#include <GUIButton.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

TraySetToolTip("Captcha Sound Alert for JDownloader")
If $Debug = True Then Opt("TrayIconDebug",1)
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
    While 1
        If WinExists($DetectWindow) Then
            ExitLoop
        Else
            Sleep(250)
        EndIf
    WEnd

    $Timer = TimerInit()
    SoundPlay($SoundFile)

    $FormMain = GUICreate("Captcha Sound Alert for JDownloader", 291, 91, 367, 575, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
    $ButtonOK = GUICtrlCreateButton("OK", 96, 56, 97, 25, $WS_GROUP)
    $LabelMessage = GUICtrlCreateLabel("Press OK to stop this alert.", 24, 16, 244, 27)
    GUICtrlSetFont(-1, 15, 400, 0, "Arial")
    GUICtrlSetState($ButtonOK, $GUI_FOCUS)
    GUISetState(@SW_SHOW)

    While 1
        $Msg = GUIGetMsg()

        Switch $Msg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $ButtonOK
                ExitLoop
        EndSwitch

        If TimerDiff($Timer) >= $SoundDelay Then
            SoundPlay($SoundFile)
            $Timer = TimerInit()
        EndIf
    WEnd
    GUIDelete()
    Sleep(60000)
WEnd

Last edited by CHRONOMASTER; 02.12.2010 at 16:51. Reason: Updated Script to v1.1
Reply With Quote
  #2  
Old 12.09.2010, 15:31
willemijns
Guest
 
Posts: n/a
Default

i only know autohotkey script, you detect a foreground windows change ?
Reply With Quote
  #3  
Old 12.09.2010, 15:56
CHRONOMASTER
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by willemijns View Post
i only know autohotkey script, you detect a foreground windows change ?
It will look for a window with the title "[somesite]: Please enter" with the class "SunAwtDialog" every 250ms, once the criteria is met weather in foreground or background the alert will trigger.
Reply With Quote
  #4  
Old 12.09.2010, 16:01
willemijns
Guest
 
Posts: n/a
Default

ok tks
Reply With Quote
  #5  
Old 13.09.2010, 01:44
george2002
Guest
 
Posts: n/a
Default

First i wanted to say:Great Work CHRONOMASTER !
But i have question - is there somewhere same program for linux ? i'm using puppy linux and jdownloader and i wanted to have same sound notification on linux - is there any chance for that ? or is there any trick for linux that it can play sound after popup of window ?

Thx for any answer and sorry for my poor English
george2002
Reply With Quote
  #6  
Old 13.09.2010, 04:02
CHRONOMASTER
Guest
 
Posts: n/a
Default

@george2002

I don't know of any, but you should be able to run JDownloader(Windows), Java, AutoIt and this script
under Wine to get it working on your Linux box.

This is only a guess as I have not tried this combo before.
Reply With Quote
  #7  
Old 13.09.2010, 08:10
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

For Linux, I would suggest checking the PS output for something with the specified name. You can even use wildcards.

I think there is a beep command in Linux.
Reply With Quote
  #8  
Old 13.09.2010, 20:14
george2002
Guest
 
Posts: n/a
Default

@CHRONOMASTER thx for that suggestion but i have HP Thin Client T5520 @ 800MHz/128MB RAM + external USB HDD and Puppy linux works great on this configuration, i tried windows xp and it was too slow and took too much RAM (when RAM goes above 128MB then windows started write on HDD as RAM and that was annoying because HDD worked all time)
In Linux i configured everything:SAMBA, UPnP,WIFI to act as AP, and jdownloader to start automaticly and now i wanted to have sound on popup window when jdownloader asks for type the captcha, and this question goes for drbits
Could you expand your idea more and describe how i can do that in linux with this ,,PS output" or ,,wildcards" ot somthing else, because i'm novice in linux and i I do not understand what you mean by ,,PS output" and ,,Wildcards"
Could you give here some examples or links to pages with some examples how to enable sound when window from jdownloader popups ?

PS.
Beep command is smallest problem

thank you in advance for your reply
george2002
Reply With Quote
  #9  
Old 14.09.2010, 05:00
CHRONOMASTER
Guest
 
Posts: n/a
Default

@george2002

All I can do is suggest that you give Wine a try.

**External links are only visible to Support Staff** http://en.wikipedia.org/wiki/Wine_(software)
Reply With Quote
  #10  
Old 14.09.2010, 09:46
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

The PS command (with the appropriate parameters) allows you to list information about all of the processes (and I think threads). If you grep the output of ps -e (I think) grep will return a different value when it finds an occurrence than when it does not.

It has been years since I did this, so this is probably not right (the parameters changed) You are looking for a script something like:

Code:
while (`ps -e | grep "java.*"') {
    if (`ps -e --windowtitle | grep "*.?\Please Enter"') beep 700 2
    sleep 2
    }
sleep sleeps up to that number of seconds. It is like cron in that it uses the end of a second to update, rather than the passage of time. So `sleep 2` should sleep 1 to 2 seconds.

If the beep parameters are as I remember them, this is a request for a 2 second beep at 700Hz (A above middle C). That is the same frequency as most beeping alarm clocks. Almost nobody can sleep through it. We used to play songs by using beep followed by pairs of numbers.

Note that the conditionals are enclosed in accent characters ` ` so that they will be interpreted each time. This would be more efficient in TEMACS or AWK, but a lot harder to write.

As to regular expressions, they have changed a little over the years. Look at the documentation in the JDownloader Wiki.

I have been locked in the Windows world almost full time since 1996. Every so often, I get a chance to work in *nix for things like build scripts.

Last edited by drbits; 14.09.2010 at 09:49.
Reply With Quote
  #11  
Old 14.09.2010, 18:49
george2002
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by CHRONOMASTER View Post
@george2002

All I can do is suggest that you give Wine a try.

**External links are only visible to Support Staff****External links are only visible to Support Staff**
http://en.wikipedia.org/wiki/Wine_(software)
Thx for that suggestion but i rather stay on linux in this case but of course everyday i use windows XP but in this case linux is more tailored to my needs
It will act only as a media centre: AP,SAMBA,FTP,and jdownloader.

Quote:
Originally Posted by drbits View Post
The PS command (with the appropriate parameters) allows you to list information about all of the processes (and I think threads). If you grep the output of ps -e (I think) grep will return a different value when it finds an occurrence than when it does not.

It has been years since I did this, so this is probably not right (the parameters changed) You are looking for a script something like:

Code:
while (`ps -e | grep "java.*"') {
    if (`ps -e --windowtitle | grep "*.?\Please Enter"') beep 700 2
    sleep 2
    }
sleep sleeps up to that number of seconds. It is like cron in that it uses the end of a second to update, rather than the passage of time. So `sleep 2` should sleep 1 to 2 seconds.

If the beep parameters are as I remember them, this is a request for a 2 second beep at 700Hz (A above middle C). That is the same frequency as most beeping alarm clocks. Almost nobody can sleep through it. We used to play songs by using beep followed by pairs of numbers.

Note that the conditionals are enclosed in accent characters ` ` so that they will be interpreted each time. This would be more efficient in TEMACS or AWK, but a lot harder to write.

As to regular expressions, they have changed a little over the years. Look at the documentation in the JDownloader Wiki.

I have been locked in the Windows world almost full time since 1996. Every so often, I get a chance to work in *nix for things like build scripts.
So this is only a theory ? as i wroted 1 post elier i'm novice in linux and things about operating on scripts overwhelm me :D if you could place a final solution for my problem from beggining to end i would be very thankful and of course other users that have same problem
Of course if someone other have a idea how to beat that problem i would be grateful for help in solving this problem


thx for any working solution
george2002
Reply With Quote
  #12  
Old 15.09.2010, 09:43
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

Please read http://board.jdownloader.org/showthread.php?t=15749
Reply With Quote
  #13  
Old 15.09.2010, 12:20
remi
Guest
 
Posts: n/a
Cool

Quote:
Originally Posted by george2002 View Post
So this is only a theory ? as i wroted 1 post elier i'm novice in linux and things about operating on scripts overwhelm me :D if you could place a final solution for my problem from beggining to end i would be very thankful and of course other users that have same problem
I admire drbits' efforts to put you on the right track with his script. You cannot expect from supporters that they write programs/scripts for you instantly.

Either you go to a linux scripting forum where scripting wizards will start discussing your problem and provide an optimal solution, or you wait until jD's devs have designed and programmed a more generic solution.
Reply With Quote
  #14  
Old 15.09.2010, 22:53
george2002
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by remi View Post
I admire drbits' efforts to put you on the right track with his script. You cannot expect from supporters that they write programs/scripts for you instantly.

Either you go to a linux scripting forum where scripting wizards will start discussing your problem and provide an optimal solution, or you wait until jD's devs have designed and programmed a more generic solution.
Hello again and thx for so quick reply but:

As i see this problem is longer than half year - in my opinion adding this future as: checkmark in options menu with link to audio file when windows with captcha appear can be done in one - maximum two days (of course, without unnecessary options) (if someone use firefox addon called download Statusbar - there is a checkmark option in options of that plugin that plays sound when downloading of file is finished - I think it should be enough and not so difficult to done) because jD's dev team are professionals in programming in my opinion and they could know that option is critical for large amount of users of jdownloader (many of them don't write here on this forum but i can bet that they would be very grateful for this option) and more users will use jdownloader then there be more $ support from them for upgrades etc
I wroted that suggestion about checkmark in options because this will resolve problems with external programs and operating systems problems - all will work on the go from jdownloader side without other programs/scripts.
This can be done faster before adding whole eventmanager

PS
Or i'm wrong and service of sounds/links to files in java is very hard to code ?
As i said i don't have programmer skills and if I am wrong then please accept my apology
And of course I could go to another forum/ programmers for solution but i think this friendly forum is for such needs
I do not expect that someone write this solution in 5 minutes but in 3-7 days is enough time for that - dodn't you agree with this ? whether there are other inhibition to do that ?
As i said:this problem is not just about me - it concerns a large number of users

Best Regards
George2002

Last edited by george2002; 15.09.2010 at 23:07.
Reply With Quote
  #15  
Old 16.09.2010, 11:20
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

It is not the difficulty, but the lack of development volunteers makes it take much longer before these convenience features are implemented.

Besides, an update of this kind would not be released in an update (those are for Host Plugins), but would be included in a Major release. Since I don't expect this in the next major release, it will probably be early next year before it is part of JDownloader. That is why we have been trying to find external files to solve your problem.

One of the things you should be aware of is that Linux scripting is not intended to be user friendly, just very powerful. I used to be a unix expert, but I have been stuck in Windows since 1985. The man pages are a good resource for finding out about features (start with "man tsh"). I also recommend books by O'Reilly such as Linux in a nutshell.
Reply With Quote
  #16  
Old 16.09.2010, 12:00
remi
Guest
 
Posts: n/a
Cool

Quote:
Originally Posted by george2002 View Post
they could know that option is critical for large amount of users of jdownloader
A year ago there was a possibility to set a sound theme in earlier versions of jD, but that feature was taken out because the devs thought it wasn't used. I'm not sure there was a sound for pop-up windows though. You see that the world can change quickly.

I think it's better to integrate such features in a more generic function such as an event/task manager, but nothing forbids you to find a good java developer to develop it now.
Reply With Quote
  #17  
Old 16.09.2010, 22:24
george2002
Guest
 
Posts: n/a
Default

Thx for drbits and remi for reply
So there is no chance to have that wish done until next christmas... :(
Maybe there will be someone who will provide this function before next year
It would be awesome

Regards
George2002
Reply With Quote
  #18  
Old 17.09.2010, 11:37
remi
Guest
 
Posts: n/a
Default

As I said nothing is impossible if you can find a good java programmer. It depends on how much you want to invest in it. A few bottles of wine might be sufficient.
Reply With Quote
  #19  
Old 19.09.2010, 19:10
arsenic0
Guest
 
Posts: n/a
Default

Hi to all! I've a problem: script don't work!
I have copied the script code with correct variable sound file for my operating system (Windows xp SP3) into SciTE Script Editor (AutoIT v3) and saved without errors. After I open script, it's open in TrayIcon, but the sound don't work when a captcha window in JDownloader pops up.

Excuse for bad english!:unsure:
Reply With Quote
  #20  
Old 20.09.2010, 10:37
CHRONOMASTER
Guest
 
Posts: n/a
Default

@arsenic0

Does the message "Press OK to stop this alert." pop up when the captcha window is displayed?

If it does, then maybe the sound file format is incompatible and is not being played.

I will test it in Windows XP to check compatibly, although I don't anticipate a problem other than the audio file not existing.

Last edited by CHRONOMASTER; 20.09.2010 at 10:46.
Reply With Quote
  #21  
Old 20.09.2010, 13:40
arsenic0
Guest
 
Posts: n/a
Default

No, the message isn't displayed.
Sound format is wav.
Reply With Quote
  #22  
Old 20.09.2010, 15:31
CHRONOMASTER
Guest
 
Posts: n/a
Default

I just tested it in a new VMwared copy of Windows XP Pro SP3 and I didn't have a problem after changing the sound file path.

Oh, I just thought of something.

Is JDownloader set to a language other than English?
The reason I ask is because the script is set to look for the window title "[somesite]: Please enter", but if it's in Spanish for example it will say "[somesite]: Por favor ingresar" and will not be detected.

You can fix this by changing the "Please enter" in the $DetectWindow variable to what the window says in your language.
Reply With Quote
  #23  
Old 20.09.2010, 16:32
arsenic0
Guest
 
Posts: n/a
Default

Ok, solved! JDownloader was set to italian, now It's set up to English and work! (message and wav file)

Thank you very much!;)
Reply With Quote
  #24  
Old 20.09.2010, 17:39
CHRONOMASTER
Guest
 
Posts: n/a
Default

Script Updated to v1.1

v1.1 (9/20/2010)
  • Added $Title variable to "Settings" to help non-English JDownloader users set captcha window detection.
  • Changed the default $SoundFile variable to a audio file available to all XP/Vista/7 users.
Reply With Quote
  #25  
Old 20.09.2010, 19:58
Fudgeman
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by CHRONOMASTER View Post
Hello Everyone,


Today I'm bringing you a useful AutoIt script that should help out a few JDownloader users.

What this script does is it creates a sound alert that repeats every 5 seconds
until the alert is canceled when a captcha window in JDownloader pops up.

[/CODE]

Chronomaster you rule!!!!!!!!!

thank you so much! I can now get other stuff done! : )

not sure why its so difficult to have the program do this (yes, I feel entitled to complain cuz even though this program is FREAKING GENIUS, I donated a tidy sum so there! thanks again chrono! I bow to your programmyness
Reply With Quote
  #26  
Old 02.10.2010, 18:10
wojtek492
Guest
 
Posts: n/a
Default

Sorry, someone help me with this script?? I don't now how to add it to my jdownloader (0.9.580).
Reply With Quote
  #27  
Old 02.10.2010, 18:42
CHRONOMASTER
Guest
 
Posts: n/a
Default

This is not a script you can add to JDownloader.

For this script you must install AutoIt then you need to right click on your desktop and choose 'New -> AutoIt v3 Script' after that, right click on the file and choose "Edit Script". Once the editor window appears, replace the content with my script then save. Close the window and double click on the file to run it. While it's running it will be located in the system tray by your clock. To quit the script, right click on the icon in the system tray and choose "Exit".
Reply With Quote
  #28  
Old 03.10.2010, 17:48
wojtek492
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by CHRONOMASTER View Post
This is not a script you can add to JDownloader.

For this script you must install AutoIt then you need to right click on your desktop and choose 'New -> AutoIt v3 Script' after that, right click on the file and choose "Edit Script". Once the editor window appears, replace the content with my script then save. Close the window and double click on the file to run it. While it's running it will be located in the system tray by your clock. To quit the script, right click on the icon in the system tray and choose "Exit".


I did as you wrote, and still no sound when capatacha code displays. Tell me what I have to change in order was the sound of the display capatacha code from servers such as hotfile.com, fileserve.com.
Reply With Quote
  #29  
Old 03.10.2010, 23:18
CHRONOMASTER
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by wojtek492 View Post
I did as you wrote, and still no sound when capatacha code displays. ...
1. Check to see that the script is running.
Look for this icon in the system tray and the hidden tray icons, if it not there the script is not running.

2. Is JDownloader set to a language other then English?
Reply With Quote
  #30  
Old 27.10.2010, 13:06
l0co
Guest
 
Posts: n/a
Default Linux solution

Working for me linux solution written as bash scrips is following:

Code:
#!/bin/sh 
  
PLAY=0

while [ true ]; do
  WIN=`xdotool search --title 'please enter'`
  
  if [ -n "$WIN" ]; then
    PLAY=1
  else
    PLAY=0
  fi
  
  if [ $PLAY = 1 ]; then
    aplay /path/to/sound/file/jdsound.wav
  fi
  
  sleep 5
  
done

It requires xdotools and aplay installed (usually from given distribution repository).

Copy code to text file, name it somehow (eg. jdsound.sh), chmod it to 0755, provide wav sound file, replace "/path/to/sound/file/jdsound.wav" part with your sound file path and execute. Sound should appear when window with 'please enter' text in title will be opened.

Tested on gnome (ubuntu hardy).
Reply With Quote
  #31  
Old 27.10.2010, 16:08
remi
Guest
 
Posts: n/a
Default

Thanks, this looks very nice.
Reply With Quote
  #32  
Old 27.10.2010, 20:46
Tyop
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by l0co View Post
Code:
    aplay /path/to/sound/file/jdsound.wav
Instead:
Code:
echo CAPTCHA! | sendxmpp --tls --user user --jserver yourserver.com --password password recipient@jabberserver.com

Gives XMPP/jabber notification. Needs sendxmpp package.
Reply With Quote
  #33  
Old 27.10.2010, 21:55
george2002
Guest
 
Posts: n/a
Default

Hello there
i also have my version of enabling sound on linux when desired window popups
This is the script that wroted my buddy:
Code:
#    title_window
#    Copyright (C) 2010  Rafal Pogorzelec (mail:http://www.google.com/recaptcha/mailhide/d?k=01we46RSAUuqHSIbxuEMpsSQ==&c=SGoWxLS_x56S5_ScSXPXwCtmTBN5-ln181pkuq2_xpg=)
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <**External links are only visible to Support Staff**
import subprocess,re

if __name__ == '__main__':
    xprop = subprocess.Popen(('xprop', '-root', '-spy'),stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    while True:
        line = xprop.stdout.readline()
        if not line:
            break
        if re.match('_NET_ACTIVE_WINDOW', line):
            try:
                id = re.split(' ', line)[4]
                xwininfo = subprocess.Popen(('xwininfo', '-id', id),stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                while True:
                    line = xwininfo.stdout.readline()
                    if not line:
                        break
                    if re.match('xwininfo', line):
                        m = re.compile('".*"').search(line)
                        if m:
                            title = m.group()
                            print title
                            if re.search('', title):                           
                                play = subprocess.Popen(('aplay','sound/sound.wav'),stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                       
            except IndexError:
                pass
and i must say it works awesome
Its writed in python language and for working python 2.6 must be installed - pet file of python 2.6 (for puppy linux - i work on that version of linux ) can be found here:dotpups.de/puppy4/dotpups/Programming/python-2.6.4-i386.pet
Small description/howto:
In attached file there is 2 catalogs:
license - GPL license
tw - in that catalog there is python script that plays sound when wanted window popups and catalog with sound file (default - sound.wav, i added 2 more sounds from windows )
edit line
Code:
if re.search('', title):
for eg jdownloader
Code:
if re.search('Please enter', title):
- for english language version of course eg for Polish it will be:
Code:
if re.search('Prosz wprowadzi', title):


and one file:
start_tw - it's start file for python script - i added this file to my-documents/Startup (autostart catalog in puppy)


PS
Whole popup catalog must be in root catalog

PS2
Ups i can't attache file :( it can be found here:megaupload.com/?d=OQ2WLJX9


PS3
Hello there again
I uploaded here:megaupload.com/?d=500C3JBQ new version of script.
My buddy added very cool feature:
Now sound is played in loop with additional delay between played sound as long as window appears, if window disappears then sound stops playing and waiting for next appear of window


Regards
George2002

Last edited by george2002; 27.10.2010 at 21:58.
Reply With Quote
  #34  
Old 28.10.2010, 07:46
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

The python script should need very little change to run in Activestate Python (a free distribution that includes some Windows libraries - you do not have to buy any of their products to make this work).
Reply With Quote
  #35  
Old 28.10.2010, 12:45
l0co
Guest
 
Posts: n/a
Default

For Windows IMO there's a simple solution using windows script host, doing exactly the same as my script, and being able to be executed on any windows version without any additional tools. But isn't really simplier to add this single line of code to captcha window in jdowloader?
Reply With Quote
  #36  
Old 29.10.2010, 08:35
drbits's Avatar
drbits drbits is offline
JD English Support (inactive)
 
Join Date: Sep 2009
Location: Physically in Los Angeles, CA, USA
Posts: 4,434
Default

Quote:
Originally Posted by l0co
But isn't really simplier to add this single line of code to captcha window in jdowloader?
Go ahead. Here is a roadmap:

This requires a Setting line (or two) on Modules -> AntiCaptcha to supply the path to the sound file (empty=quiet).

The Java code requires importing more classes that are related to sound. Then, function must be written to contain the statement(s) for playing the sound files. Exception handling (to log and then ignore any errors adds more code. Finally, there is the call to the function.

Technically, there should be synchronization to avoid overlapping sound calls, but we can let the library deal with it (that is one of the exceptions that must be caught).

Research 1-2 hours,
Coding test program for the function, 1 hour (must test existing and non-existing sound files)).
Coding function and call to function 1 hour.
Rework, because we forgot to load the Codecs (Nobody ever specified the Container type or the data format - both of these require Codecs).

Under Windows, the sound standard for this type of alert is still WAV (uncompressed binary values fed directly to the sound software). However, WAV codecs are not available for all Linux distributions.

MP3 is an alternative. This is the container type. Usually data is clipped, frequency limited, and then compressed. The compression/decompression requires a codec. This should be available on Java 1.6 or later. I don't know about 1.5.
Reply With Quote
  #37  
Old 29.10.2010, 12:35
l0co
Guest
 
Posts: n/a
Default

OK, well done job takes more than a while. But I've been thinking about something much simplier, which is adding a command line option --exec-on-captcha="command" as a workaround. The command could be system-dependend and could give a sound, send jabber message, and do whatever you want. On the other hand, if you plan to add fully-functional event manager within a fair amount of time, there's no reason to clutter the code with such solutions. But if we will be waiting longer time for that, why not to do it?
Reply With Quote
  #38  
Old 17.11.2010, 23:07
hostx9
Guest
 
Posts: n/a
Default

I really don't want to waste you're time but for some odd reason this script isn't working for me. I got installed a English version of Windows XP Professional, running the latest version of JDownloader v 0.9.580 and using the English language interface. I also installed the AutoIt v3 program package for their official site. So there can't be any problem with the language and any other programs I use.

I'm downloading form a site called "filesonic. com" so I changed this correctly in your script like this (oh and yes the pop-up window for CAPTCHA input is entitled with exactly the same title as it is written below)
Code:
$Title = "filesonic.com: Please enter"
After I run the script (yes there is this icon in the taskbar, running the correct script) it seems that it isn't able to recognize the popped-up captcha window. I've enabled the debug mode and it's always running on the line
Code:
Sleep(250)
whatever I do. To test, if the script is even working/running I've deleted the
Code:
    While 1
        If WinExists($DetectWindow) Then
            ExitLoop
        Else
            Sleep(250)
        EndIf
    WEnd
from the code. After I ran it this nice window appears which popped-up when the captcha window is recognized. (if I'm not wrong - the captcha window can't be recognized because I deleted the command which is ordering to detect it.)

Well I would love to see this working on my computer and I'm also really thankful for his great script of you.

Thank you for any help in advance
Reply With Quote
  #39  
Old 18.11.2010, 11:24
remi
Guest
 
Posts: n/a
Default

Why do you want it to recognise the filesonic captcha alerts only?

The script works fine with ": Please enter". If you want to be sure, only use "filesonic.com", because there might be invisible, special characters in that window title.

I'm using "Captcha Alert : a simple tool solution.". It's similar but you don't need AutoIt and you can set several window titles at once. I'm already using it for 4 different applications and I'm no longer missing 'hidden' or 'silent' alerts.
Reply With Quote
  #40  
Old 18.11.2010, 11:37
hostx9
Guest
 
Posts: n/a
Default

Thank you for help remi
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 15:54.
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.