Sign in to follow this  
Followers 0
Affe

Multimedia Web Crawler

4 posts in this topic

I am writing a multimedia web crawler that uses google to find media files. (Note: I do know that this is in violation of Google TOS).

I use two embedded IE windows that are hidden to navigate. This brings my first question:

How can I disable the "clicking" sound that is made when the program navigates to a new URL?

Now, the search results are populated into a listview on the GUI. The search is SUPPOSED to continue until the user clicks "Stop". This brings my next question:

I have the search in a "While" loop, with the condition being $search = True. I have a "Stop" button that sets $search to False. However, this doesn't seem to have an effect. The search keeps going until it errors out. This also freezes the GUI, keeping the user from being able to download the files or being able to sort the listview. I tried adding a GuiGetMsg into the loop, but it seems to have no effect. The code for the "While" loop is below:

$search = True
    While $search = True
        $msg = GUIGetMsg()
        If $msg = $cancel_btn Then
            $search = False
            ExitLoop
        EndIf
        $oLinks = _IELinkGetCollection($oIE)
        $iNumLinks = @extended
        For $oLink In $oLinks
            $str = String($oLink.href)
            $check = StringInStr($str, "google")
            If $check = 0 Then
                $check = StringInStr($str, "blogger")
                If $check = 0 Then
                    $check = StringInStr($str, "orkut")
                    If $check = 0 Then
                        $check = StringInStr($str, "cache")
                        If $check = 0 Then
                            $check = StringInStr($str, "e-mp3s")
                            If $check = 0 Then
                                $check = StringInStr($str, "fast-mp3")
                                If $check = 0 Then
                                    _IENavigate($oDownload, $oLink.href)
                                    _IELoadWaitTimeout(15000)
                                    LinkGet()
                                EndIf
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
        Next
        _IELinkClickByText($oIE, "Next")
    WEnd

The LinkGet() Function code is below:

Func LinkGet()
    $oDLs = _IELinkGetCollection($oDownload)
    For $oDL In $oDLs
        $msg = GUIGetMsg()
        If $msg = $cancel_btn Then
            $search = False
            ExitLoop
        EndIf
        $a = StringSplit($search_goal, ".")
        $str = String($oDL.outertext)
        $check = StringInStr($str, $a[1])
        If $check = 0 Then
        Else
            $check = StringRight($str, 3)
            If $check = "mp3" Or $check = "mp4" Or $check = "wma" Or $check = "avi" Or $check = "wmv" Or $check = "exe" Then
                $a = StringSplit($oDL.href, "/")
                $pingstr = $a[1] & "//" & $a[3]
                $ping = Ping($pingstr, 250)
                If $ping = 0 Then
                    $ping = "?"
                EndIf
                $Search_Array[@extended][0] = $oDL.href
                $Search_Array[@extended][1] = $oDL.outertext
                $Search_Array[@extended][2] = $ping
                $Search_Array[@extended][3] = InetGetSize($oDL.href)
                $Search_Array[@extended][4] = $check
                $str = StringFormat("%s|%s|%s|%s|%s|%s|", $search_count, $Search_Array[@extended][4], $Search_Array[@extended][1], $Search_Array[@extended][3], $Search_Array[@extended][2], $Search_Array[@extended][0])
                GUICtrlCreateListViewItem($str, $listView)
                $search_count = $search_count + 1
            EndIf
        EndIf
    Next
EndFunc  ;==>LinkGet

Does anyone have any suggestions?


[center][/center]

Share this post


Link to post
Share on other sites



I found a way to make the IE window hidden. So instead of using an embedded Activex, it is now in windows, which seems to make the program more efficient, and removes those unsightly boxes created by "hidden" embedded windows.

But I would still like to disable the clicking sound, and I still need help to stop the search...


[center][/center]

Share this post


Link to post
Share on other sites

My main problem is being able to exit the loop, and allow the GUI to operate while the search is going on.

Does anyone have a suggestion for this???


[center][/center]

Share this post


Link to post
Share on other sites

I found a way to get out of the loop and prevent the program from locking up, so this is no longer needed.


[center][/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0