Jump to content



Photo

Protectlinks decoder and Rapidshare links checker


  • Please log in to reply
4 replies to this topic

#1 Jex

Jex

    Polymath

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 19 November 2007 - 08:01 AM

That script decoding protectlinks ( Picture 1 = Decoding, Picture 2 = Decoded links. ) or checking rapidshare links for working or not ( Picture 2 = After check. ) .

For test example links :
1 - <a href='http://www.protectlinks.com/38282' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/38282</a> 2 - <a href='http://www.protectlinks.com/38283' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/38283</a> 3 - <a href='http://www.protectlinks.com/38284' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/38284</a> 4 - <a href='http://www.protectlinks.com/38285' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/38285</a> 5 - <a href='http://www.protectlinks.com/38286' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/38286</a>


Posted Image
Posted Image

AutoIt         
#include <GuiEdit.au3> #include <INet.au3> #include <IE.au3> #include <String.au3> #include <GUIConstants.au3> $Form = GUICreate("Protectlinks decoder and Rapidshare checker", 400, 300) $oIE = _IECreateEmbedded() $Edit = GUICtrlCreateEdit("", 10, 10, 380, 250) $Button = GUICtrlCreateButton("Protectlinks decode", 10, 265, 185, 25) $Button2 = GUICtrlCreateButton("Rapidshare links check", 200, 265, 190, 25) $GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 1, 1) GUICtrlSetState($GUIActiveX, $GUI_HIDE) GUISetState() While 1     $msg = GUIGetMsg()     Switch $msg         Case $Button             Hidecontrols()             $Count = _GUICtrlEdit_GetLineCount ($Edit)             $Data = ""             For $i = 0 To $Count - 1                 GUICtrlSetData($Button, $i + 1 & "/" & $Count & "  " & Round(((($i + 1) / ($Count)) * 100), 0) & "%")                 $Line = _GUICtrlEdit_GetLine ($Edit, $i)                 Check()             Next             GUICtrlSetData($Edit, $Data)             Showcontrols()         Case $Button2             Hidecontrols()             GUICtrlSetState($Button2, $GUI_DISABLE)             GUICtrlSetState($Button, $GUI_DISABLE)             GUICtrlSetState($Edit, $GUI_DISABLE)             GUICtrlSetData($Button2, "Loading...")             _IENavigate($oIE, "<a href='http://rapidshare.com/en/checkfiles.html' class='bbc_url' title='External link' rel='nofollow external'>http://rapidshare.com/en/checkfiles.html"</a>)             $Box = _IEGetObjByName($oIE, "urls")             $Count = _GUICtrlEdit_GetLineCount ($Edit)             For $i = 0 To $Count                 $Line = _GUICtrlEdit_GetLine ($Edit, $i)                 If $i = 0 Then                     $Data = $Line                 Else                     $Data = $Data & @CRLF & $Line                 EndIf             Next             _IEFormElementSetValue($Box, $Data)             $Submit = _IEFormGetCollection($oIE, 0)             _IEFormSubmit($Submit)             $Source2 = _IEDocReadHTML($oIE)             Check2()             Showcontrols()         Case - 3             Exit     EndSwitch WEnd Func Check()     If StringInStr($Line, "protectlinks") Then         $Split = StringSplit($Line, "com/", 1)         $Source = _INetGetSource("<a href='http://www.protectlinks.com/redirected.php?id=' class='bbc_url' title='External link' rel='nofollow external'>http://www.protectlinks.com/redirected.php?id="</a> & $Split[2])         $Link = _StringBetween($Source, 'width="100%" src="', '"></iframe>')         If $i = 0 Then             $Data = $Link[0]         Else             $Data = $Data & $Link[0]         EndIf     EndIf EndFunc   ;==>Check Func Check2()     $Strings = _StringBetween($Source2, '<font color="red">File ', ') not found!</font>\n')     If IsArray($Strings) Then         $Broken = ""         $Count = _GUICtrlEdit_GetLineCount ($Edit)         For $i = 0 To UBound($Strings) - 1             $Split2 = StringSplit($Strings[$i], " (", 1)             For $z = 0 To $Count                 $Line = _GUICtrlEdit_GetLine ($Edit, $z)                 If StringInStr($Line, $Split2[1]) Then                     If $Broken = "" Then                         $Broken = $Line                     Else                         $Broken = $Broken & @CRLF & $Line                     EndIf                 EndIf             Next         Next         MsgBox("", "", "Found " & UBound($Strings) & " broken link." & @CRLF & $Broken)     Else         If StringInStr($Source2, '<font color="green">') Then MsgBox("", "", "All links working!")     EndIf EndFunc   ;==>Check2 Func Hidecontrols()     GUICtrlSetState($Button, $GUI_DISABLE)     GUICtrlSetState($Button2, $GUI_DISABLE)     GUICtrlSetState($Edit, $GUI_DISABLE) EndFunc Func Showcontrols()     GUICtrlSetData($Button, "Protectlinks Decode")     GUICtrlSetData($Button2, "Rapidshare links check")     GUICtrlSetState($Edit, $GUI_ENABLE)     GUICtrlSetState($Button2, $GUI_ENABLE)     GUICtrlSetState($Button, $GUI_ENABLE) EndFunc

Edited by Jex, 23 November 2007 - 05:57 PM.






#2 phillip123adams

phillip123adams

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 325 posts

Posted 19 November 2007 - 07:46 PM

Hi Jex,

Your script caught my attention and I though I would give it a try, but ran into a few problems:

First, functions _GUICtrlEdit_GetLineCount and _GUICtrlEdit_GetLine are not included in your post.

I assumed those functions are based upon _GUICtrlEditGetLineCount and _GUICtrlEditGetLine found in the latest GuiEdit.au3 file, so I removed the underscore from their names to see what would happen. When the GUI appeared I pasted the test url's you provided into the $Edit control, and pressed the Decode button. It processed the url's but failed to update the $Edit control with the RapidShare url's or to reset its state to "enabled". That's because the _GUICtrlEditGetLine function is using ByRef (for some reason) for its first parameter and the value of $Edit is being altered.

To get around that issue, I assigned the value of $Edit to variable $XX and used $XX as the parameter to the _GUICtrlEditGetLine function.

I also ran into a counting issue where the last url was not being processed (perhaps with your "GetLine" functions you do not have these issues). I changed "For $i = 0 To $Count - 1" to "For $i = 1 To $Count".

One other issue is if $Edit contains blank lines (including trailing blank lines), or leading spaces, the results are incorrect. I did not do anything about that.

Here's your original code with the changes I made (mine are all outdented):
AutoIt         
#include <GuiEdit.au3> #include <INet.au3> #include <IE.au3> #include <String.au3> #include <GUIConstants.au3> $Form = GUICreate("Protectlinks decoder and Rapidshare checker", 400, 300) $oIE = _IECreateEmbedded() $Edit = GUICtrlCreateEdit("", 10, 10, 380, 250) $Button = GUICtrlCreateButton("Protectlinks decode", 10, 265, 185, 25) $Button2 = GUICtrlCreateButton("Rapidshare links check", 200, 265, 190, 25) $GUIActiveX = GUICtrlCreateObj($oIE, 1, 1, 1, 1) GUICtrlSetState($GUIActiveX, $GUI_HIDE) GUISetState() While 1     $msg = GUIGetMsg()     Switch $msg         Case $Button             Hidecontrols()             $Count = _GUICtrlEditGetLineCount ($Edit)             $Data = "" $XX = $Edit ;~             For $i = 0 To $Count - 1 For $i = 1 To $Count                 GUICtrlSetData($Button, $i + 1 & "/" & $Count & "  " & Round(((($i + 1) / ($Count)) * 100), 0) & "%") ;~                 $Line = _GUICtrlEditGetLine ($Edit, $i) $Line = _GUICtrlEditGetLine ($XX, $i)                 Check()             Next             GUICtrlSetData($Edit, $Data)             Showcontrols()         Case $Button2             Hidecontrols()             GUICtrlSetState($Button2, $GUI_DISABLE)             GUICtrlSetState($Button, $GUI_DISABLE)             GUICtrlSetState($Edit, $GUI_DISABLE)             GUICtrlSetData($Button2, "Loading...")             _IENavigate($oIE, "[url="http://rapidshare.com/en/checkfiles.html"]http://rapidshare.com/en/checkfiles.html[/url]")             $Box = _IEGetObjByName($oIE, "urls")             $Count = _GUICtrlEditGetLineCount ($Edit) $XX = $Edit             For $i = 0 To $Count ;~                 $Line = _GUICtrlEditGetLine ($Edit, $i) $Line = _GUICtrlEditGetLine ($XX, $i)                 If $i = 0 Then                     $Data = $Line                 Else                     $Data = $Data & @CRLF & $Line                 EndIf             Next             _IEFormElementSetValue($Box, $Data)             $Submit = _IEFormGetCollection($oIE, 0)             _IEFormSubmit($Submit)             $Source2 = _IEDocReadHTML($oIE)             Check2()             Showcontrols()         Case - 3             Exit     EndSwitch WEnd Func Check()     If StringInStr($Line, "protectlinks") Then         $Split = StringSplit($Line, "com/", 1)         $Source = _INetGetSource("[url="http://www.protectlinks.com/redirectedl.php?id"]http://www.protectlinks.com/redirectedl.php?id[/url]=" & $Split[2])         $Link = _StringBetween($Source, 'width="100%" src="', '"></iframe>')         If $i = 0 Then             $Data = $Link[0]         Else             $Data = $Data & $Link[0]         EndIf     EndIf EndFunc   ;==>Check Func Check2()     $Strings = _StringBetween($Source2, '<font color="red">File ', ') not found!</font>\n')     If IsArray($Strings) Then         $Broken = ""         $Count = _GUICtrlEditGetLineCount ($Edit)         For $i = 0 To UBound($Strings) - 1             $Split2 = StringSplit($Strings[$i], " (", 1) $XX = $Edit             For $z = 0 To $Count ;~                 $Line = _GUICtrlEditGetLine ($Edit, $z) $Line = _GUICtrlEditGetLine ($XX, $z)                 If StringInStr($Line, $Split2[1]) Then                     If $Broken = "" Then                         $Broken = $Line                     Else                         $Broken = $Broken & @CRLF & $Line                     EndIf                 EndIf             Next         Next         MsgBox("", "", "Found " & UBound($Strings) & " broken link." & @CRLF & $Broken)     Else         If StringInStr($Source2, '<font color="green">') Then MsgBox("", "", "All links working!")     EndIf EndFunc   ;==>Check2 Func Hidecontrols()     GUICtrlSetState($Button, $GUI_DISABLE)     GUICtrlSetState($Button2, $GUI_DISABLE)     GUICtrlSetState($Edit, $GUI_DISABLE) EndFunc Func Showcontrols()     GUICtrlSetData($Button, "Protectlinks Decode")     GUICtrlSetData($Button2, "Rapidshare links check")     GUICtrlSetState($Edit, $GUI_ENABLE)     GUICtrlSetState($Button2, $GUI_ENABLE)     GUICtrlSetState($Button, $GUI_ENABLE) EndFunc

Phillip

Phillip

#3 MadBoy

MadBoy

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 829 posts

Posted 19 November 2007 - 07:56 PM

First, functions _GUICtrlEdit_GetLineCount and _GUICtrlEdit_GetLine are not included in your post.


If you would get a newest beta you can find there what you are looking for :P


#4 phillip123adams

phillip123adams

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 325 posts

Posted 19 November 2007 - 08:42 PM

If you would get a newest beta you can find there what you are looking for :P
</FONT>

Thanks MadBoy! I had beta 3.2.9.12, but didn't think to check it. All of the issues I noted are resolved by it, although I see beta 3.2.9.13 is out today.

Phillip
Phillip

#5 Jex

Jex

    Polymath

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 20 November 2007 - 12:00 AM

I'm tested my script many times before publish and working without single problem :P ( I have AutoIt Beta 3.2.9.9 )




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users