Jump to content

iRapid BETA v0.1


Uriziel01
 Share

Recommended Posts

Hi ! :mad:

This release is v0.1 BETA. I have added all simple functions and I'm working now at those more advanced,

my script can search Clipboard for links and collect them in groups, download selected link from RS or download all files in list (You can manually edit the list as you wish)

Script in this version works only with Happyhours !

FILES BELOW CONTAINS SOURCE, UDF'S,COMPILED EXE's AND GRAPHICS ! ALL NEEDED TO RUN MY SCRIPT :)

Speedyshare Link to compiled application and sources: http://www.speedyshare.com/529794990.html

Rapidsahre Link to compiled application and sources:http://rapidshare.de/files/39837194/iRapid.rar.html

_INetGetSourcePost function was maded by GtaSpider

Sorry but I dont remember rest of functions creators (esspecially from progress bar) but I want to say  BIG "thank you all !" right now and apologise for this little misteake.

>> Screen:

Posted Image

>> TODO list:

-Other serwers like netload, speedyshare etc

-Make it reconnect your connection with the internet when download is finished

-Create own downloading UDF, in pure TCPSend/TCPRecv

-Own Image ProgressBar

-Many, many more :P

>>Example file list (from Board in internet for example :P )

http://rapidshare.com/files/115409167/P.S.I.Love.You_2007_DvDrip.part1.rar
http://rapidshare.com/files/115413645/P.S.I.Love.You_2007_DvDrip.part2.rar
http://rapidshare.com/files/115497732/P.S.I.Love.You_2007_DvDrip.part3.rar
http://rapidshare.com/files/115501078/P.S.I.Love.You_2007_DvDrip.part4.rar
http://rapidshare.com/files/115501307/P.S.I.Love.You_2007_DvDrip.part5.rar

Oh! And in this version application is saving downloaded files in @ScriptDir, in next release this will be variable patch. !

I'm giving the source only as addon, because script cannot work without graphics and one extra UDF for ProgressBar :D

>> SOURCE:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=ico.ico
#AutoIt3Wrapper_outfile=IRapid v0_1.exe
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include-once
#include <GUIConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <Misc.au3>
#include <String.au3>
#include <Process.au3>
#include <GuiTreeView.au3>
#include <GuiImageList.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include 'ProgressBar.au3'
Opt("TrayIconDebug", 0) 
Global $clip_b[1], $n_element[100], $clip_s = " ",$linka,$sRecv2[5000],$dane=0,$sRecvp,$site,$lamane,$faza2=0,$referer, $referer2 = "",$xx = 0,$faza=0,$sRecv
Global $aPics[6] = ['1.bmp', '2.bmp', '3.bmp', '4.bmp', '5.bmp', '6.bmp']
$dll = DllOpen("user32.dll")
$gui = GUICreate("Rapid Downloader", 600, 400)
GUISetBkColor("0xffddcc", $gui)
$delete_all = GUICtrlCreateButton("Delete all", 400, 120, 100, 50)
$delete = GUICtrlCreateButton("Delete selected", 400, 180, 100, 50)
$download = GUICtrlCreateButton("Download selected", 400, 240, 100, 50)
$ALL = GUICtrlCreateButton("GO ALL!", 400, 300, 100, 50)
$background = GUICtrlCreatePic("logo.jpg", 0, 0, 600, 100)
$lista = GUICtrlCreateTreeView(10, 120, 340, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
_GUICtrlTreeView_SetBkColor($lista, "0xffcc99")
$aProgressBar1 = ProgressBarCreate(20, 360, 540, $aPics, $gui)
ProgressBarSetState($aProgressBar1)
GUISetState(@SW_SHOW)
Do
    $msg = GUIGetMsg()
    Sleep(15)
    szukaj_mem()
    If $xx < 100 Then $xx += 1
    If _IsPressed("11", $dll) And _IsPressed("43", $dll) Then szukaj_mem()
    If _IsPressed("44", $dll) And _IsPressed("11", $dll) And WinActive("Rapid Downloader", "") = 1 Or $msg = $delete_all Then czyszczenie()
    If $msg = $ALL Then GO()
    If $msg = $delete Then wyczysc_jeden()
    If $msg = $download Then go_one()
Until $msg = $GUI_EVENT_CLOSE
Func szukaj_mem()
    $clip = ClipGet()
    If $clip = $clip_s Then Return 0
    $clip_s = $clip
    If StringInStr($clip, "rapidshare") = 0 Then Return 0
    $clip_a = StringSplit($clip, @CRLF)
    For $i = 0 To UBound($clip_a) - 1 Step 1
        If StringLen($clip_a[$i]) > 25 And StringInStr($clip_a[$i], "/files/") <> 0 And StringInStr($clip_a[$i], "rapidshare") <> 0 And StringInStr($clip_a[$i], "http://") <> 0 And StringInStr($clip_a[$i], ".") <> 0 Then _ArrayAdd($clip_b, $clip_a[$i])
    Next
    $clip_b[0] = UBound($clip_B) - 1
    $result = StringInStr($clip_b[1], "/", 0, -1)
    $tytul = StringTrimLeft($clip_b[1], $result)
    If StringInStr($tytul, "part") <> 0 Then $tytul = StringLeft($tytul, StringInStr($tytul, "part") - 2)
    If _GUICtrlTreeView_FindItem($lista, $clip_b[1]) <> 0 Then
        $box = MsgBox(1, "UWAGA !", " Masz juz linki o tej nazwie, czy chcesz dodac je PONOWNIE do iRapid ?!" & @CRLF & $tytul & "  >>" & $clip_b[0] & " linkow.")
        If $box <> 1 Then Return 0
    Else
        $box = MsgBox(1, "Znalazlem Linki", "W schowku znaleziono linki, dodac do listy iRapid ?" & @CRLF & $tytul & "  >>" & $clip_b[0] & " linkow.")
        If $box <> 1 Then Return 0
    EndIf
    _ArrayAdd($clip_b, $tytul)
    add_links($clip_B)
EndFunc   ;==>szukaj_mem
Func add_links($linki_nowe)
    For $i = 1 To UBound($clip_B) - 1
        _ArrayDelete($clip_b, $i)
    Next
    $s_element = GUICtrlCreateTreeViewItem(_ArrayPop($linki_nowe) & "  >" & $linki_nowe[0] & " Links inside", $lista)
    GUICtrlSetColor(-1, 0xc01010)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    For $i = 1 To $linki_nowe[0]
        $n_element[$i] = GUICtrlCreateTreeViewItem($linki_nowe[$i], $s_element)
    Next
EndFunc   ;==>add_links
Func czyszczenie()
    _GUICtrlTreeView_DeleteAll($lista)
EndFunc   ;==>czyszczenie
Func wyczysc_jeden()
    $wybrany = _GUICtrlTreeView_GetSelection($lista)
    _GUICtrlTreeView_Delete($lista, $wybrany)
EndFunc   ;==>wyczysc_jeden
Func GO()
    Local $licznik = 0
    Do
        Do
            $licznik += 1
            $linka = _GUICtrlTreeView_GetText($lista, $n_element[$licznik])
        Until StringInStr($linka, "http") > 0
        $coo = _INetGetSourcePost($linka, "dl.start=Free")
        $referer = _StringBetween($coo[1], "action", "method")
        $referer[1] = StringTrimLeft($referer[1], 2)
        $referer[1] = StringTrimRight($referer[1], 2)
        $referer2 = $referer[1]
        $coo = _INetGetSourcePost($referer2, "dl.start=Free")
        $site = _StringBetween($coo[1], "dlf.action", ";")
        If IsArray($site) = 0 Then
            _RunDOS("rasdial Neo /disconnect")
            TrayTip("WAIT", "RECONNECTING INTERNET !", 28)
            Do
                Sleep(50)
            Until Ping("www.google.pl", 7) <> 0
            $coo = _INetGetSourcePost($linka, "dl.start=Free")
            $referer = _StringBetween($coo[1], "action", "method")
            $referer[1] = StringTrimLeft($referer[1], 2)
            $referer[1] = StringTrimRight($referer[1], 2)
            $referer2 = $referer[1]
            $coo = _INetGetSourcePost($referer2, "dl.start=Free")
            $site = _StringBetween($coo[1], "dlf.action", ";")
        EndIf
        If StringInStr($coo[1], "Happy", 0) = 0 Then
            MsgBox(0, "UWAGA !", "There are No HappyHours, sorry :( ")
            Return 0
        EndIf
    $site[1] = StringTrimLeft($site[1], 3)
    $site[1] = StringTrimRight($site[1], 2)
    $lamane = StringInStr($site[1], "/", 0, -1)
        $coo = _INetDownload($site[1], "actionstring=1")
            TrayTip("Downloaded", "File Downloading Completed !", 5)
        _GUICtrlTreeView_Delete($lista, $n_element[$licznik])
    Until _GUICtrlTreeView_GetCount($lista) < 1
EndFunc   ;==>GO
Func _INetGetSourcePost($sURL, $sPost)
    Local $iSocket, $sHeader, $sRecv, $iIP, $sHost, $aRegExp, $sHttp1, $iErr, $iSend, $aReturn[2]
    If $sURL = '' Or $sPost = '' Then Return SetError(1, 0, 0)
    If StringLeft($sURL, 7) <> 'http://' And StringLeft($sURL, 8) <> 'https://' Then $sURL = "http://" & $sURL
    If StringRight($sURL, 1) <> "/" Then $sURL &= "/"
    $aRegExp = StringRegExp($sURL, "http?://(.*?)/", 3)
    If @error Then Return SetError(2, 0, 0)
    $sHost = $aRegExp[0]
    If $sHost = '' Then Return SetError(3, 0, 0)
    $sHttp1 = StringTrimLeft($sURL, StringInStr($sURL, "/", -1, 3) - 1)
    If $sHttp1 = '' Then Return SetError(3, 0, 0)
    $sHeader = "POST " & $sHttp1 & " HTTP/1.1" & @CRLF & _
            "Host: " & $sHost & @CRLF & _
            "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0" & @CRLF & _
            "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & @CRLF & _
            "Accept-Language: pl,en-us;q=0.7,en;q=0.3" & @CRLF & _
            "Accept-Encoding: gzip,deflate" & @CRLF & _
            "Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7" & @CRLF & _
            "Keep-Alive: 300" & @CRLF & _
            "Referer: " & $referer2 & @CRLF & _
            "Content-Type: application/x-www-form-urlencoded" & @CRLF & _
            "Content-Length: " & StringLen($sPost) & @CRLF & @CRLF & $sPost
    TCPStartup() 
    $iIP = TCPNameToIP($sHost)
    If $iIP = '' Or StringInStr($iIP, ".") = 0 Then Return SetError(4, 0, 0)
    $iSocket = TCPConnect($iIP, 80)
    If @error Or $iSocket < 0 Then Return SetError(5, 0, 0)
    $iSend = TCPSend($iSocket, $sHeader)
    If @error Or $iSend < 1 Then Return SetError(6, 0, 0)
    While 1
        $sRecv = TCPRecv($iSocket, 1024)
        $iErr = @error
        If $sRecv <> '' Then
            While 1
            $sRecv &= TCPRecv($iSocket, 1024)
                If @error Then ExitLoop 2
            WEnd
        EndIf
        If $iErr Then Return SetError(7, 0, 0)
    WEnd
    $aReturn[0] = StringLeft($sRecv, StringInStr($sRecv, @CRLF & @CRLF) - 1)
    $aReturn[1] = StringTrimLeft($sRecv, StringLen($aReturn[0]) + 4)
    Return $aReturn
EndFunc   ;==>_INetGetSourcePost
;
Func go_one()
    $wybrany = _GUICtrlTreeView_GetSelection($lista)
    $linka = _GUICtrlTreeView_GetText($lista, $wybrany)
    If StringInStr($linka, "http://", 0) = 0 Then
        MsgBox(0, "ERROR!", "This IS'NT link from RapidShare!")
        return 0
    EndIf
    $coo = _INetGetSourcePost($linka, "dl.start=Free")
    TrayTip("Downloading", "Downloading File Ticket",7)
    $referer = _StringBetween($coo[1], "action", "method")
    $referer[1] = StringTrimLeft($referer[1], 2)
    $referer[1] = StringTrimRight($referer[1], 2)
    $referer2 = $referer[1] 
    $coo = _INetGetSourcePost($referer2, "dl.start=Free")
    TrayTip("Downloading", "Finishing preperations to Download",7)
    $site = _StringBetween($coo[1], "dlf.action", ";")
    If IsArray($site) = 0 Then
        _RunDOS("rasdial Neo /disconnect")
        TrayTip("WAIT", "RECONNECTING INTERNET !", 28)
        Do
            Sleep(90)
        Until Ping("www.google.pl", 6) <> 0
        $coo = _INetGetSourcePost($linka, "dl.start=Free")
        TrayTip("Trwa Pobieranie", "Checking the received Link",7)
        $referer = _StringBetween($coo[1], "action", "method")
        $referer[1] = StringTrimLeft($referer[1], 2)
        $referer[1] = StringTrimRight($referer[1], 2)
        $referer2 = $referer[1]
        $coo = _INetGetSourcePost($referer2, "dl.start=Free")
        $site = _StringBetween($coo[1], "dlf.action", ";")
    EndIf
    If StringInStr($coo[1], "Happy", 0) = 0 Then
        MsgBox(0, "UWAGA !", "There are No HappyHours, sorry :( ")
        Return 0
    EndIf
    $faza=1
    $site[1] = StringTrimLeft($site[1], 3)
    $site[1] = StringTrimRight($site[1], 2)
    $lamane = StringInStr($site[1], "/", 0, -1)
        $coo = _INetDownload($site[1], "actionstring=1")
            TrayTip("Downloaded", "File Downloading Completed !", 5)
    _GUICtrlTreeView_Delete($lista, $wybrany)
EndFunc   ;==>GO
;
;
Func _INetDownload($sURL, $sPost)
    Local $iSocket, $sHeader, $sRecv, $iIP, $sHost, $aRegExp, $sHttp1, $iErr, $iSend, $aReturn[2]
    If $sURL = '' Or $sPost = '' Then Return SetError(1, 0, 0)
    If StringLeft($sURL, 7) <> 'http://' And StringLeft($sURL, 8) <> 'https://' Then $sURL = "http://" & $sURL
    If StringRight($sURL, 1) <> "/" Then $sURL &= "/"
    $aRegExp = StringRegExp($sURL, "http?://(.*?)/", 3)
    If @error Then Return SetError(2, 0, 0)
    $sHost = $aRegExp[0]
    If $sHost = '' Then Return SetError(3, 0, 0)
    $sHttp1 = StringTrimLeft($sURL, StringInStr($sURL, "/", -1, 3) - 1)
    If $sHttp1 = '' Then Return SetError(3, 0, 0)
    $sHeader = "POST " & $sHttp1 & " HTTP/1.1" & @CRLF & _
            "Host: " & $sHost & @CRLF & _
            "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0" & @CRLF & _
            "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & @CRLF & _
            "Accept-Language: pl,en-us;q=0.7,en;q=0.3" & @CRLF & _
            "Accept-Encoding: gzip,deflate" & @CRLF & _
            "Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7" & @CRLF & _
            "Keep-Alive: 300" & @CRLF & _
            "Referer: " & $referer2 & @CRLF & _
            "Content-Type: application/x-www-form-urlencoded" & @CRLF & _
            "Content-Length: " & StringLen($sPost) & @CRLF & @CRLF & $sPost
    TCPStartup() 
    $iIP = TCPNameToIP($sHost)
    If $iIP = '' Or StringInStr($iIP, ".") = 0 Then Return SetError(4, 0, 0)
    $iSocket = TCPConnect($iIP, 80)
    If @error Or $iSocket < 0 Then Return SetError(5, 0, 0)
    $iSend = TCPSend($iSocket, $sHeader)
    _filecreate(@ScriptDir&"\"&StringTrimLeft($site[1],$lamane))
    sleep(250)
    If @error Or $iSend < 1 Then Return SetError(6, 0, 0)
    $plik=FileOpen(@ScriptDir&"\"&StringTrimLeft($site[1],$lamane),1)
        sleep(100)
        TrayTip("Downloading...", "Starting Download",7)
    While 1
        $sRecv = TCPRecv($iSocket, 1024)
        $iErr = @error
        If $sRecv <> '' Then
            While 1
            $sRecv = TCPRecv($iSocket, 2048)
            If @error Then ExitLoop 2
            if StringLen($sRecv)>1024 then $dane+=1
            if StringInStr($sRecv,@CRLF & @CRLF)<>0 then 
                StringTrimLeft($sRecv,StringInStr($sRecv,@CRLF & @CRLF)-1)
    else
                FileWrite($plik,$sRecv)
endif
                ProgressBarSetData($aProgressBar1, round((((StringLen($sRecv)*$dane)/8)/104857000)*1000,1))
                If @error Then ExitLoop 2
            WEnd
        EndIf
        If $iErr Then Return SetError(7, 0, 0)
    WEnd
    Return 1
EndFunc   ;==>_INetGetSourcePost
Edited by Uriziel01
Link to comment
Share on other sites

They got rid of the cats n dogs.

Now they r into sometinhg new.

Basically they keep changin things every few months. So if the proposed script cud work even after such capta changes r made then it wud be really AWESOME! :)

I'm not a programmer. Just a Power User.

Link to comment
Share on other sites

Check first link for NEW version, it is having status BETA now :P ! Comment Pls ! And give me some nice ideas for new functions ! :D

p.s-Progress will be quite smaller now because I'm making also a Game with editor and simulateously moving 99 elements (using global Move table) :) Will release soon with "WYSIWYG" type simple to use editor :P

Edited by Uriziel01
Link to comment
Share on other sites

  • 2 weeks later...

Hmmm, I cant check this now because Im in Netherland in Work :) I will fix it in next week muttley

Nice work, but there are some error than I can't download any url on rapidshare...can you fix new version and update it ?

Thanks in advance ^^

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE
Link to comment
Share on other sites

@d3mon:

Rapidshare has changed few things in previous few weeks but I have tested it today and it downloads files correctly for me. What is the problem ? Any error or something occurs?

I copy rapidshare link to clipboard then your Irapid add it to the list, I click on Download Selected or go All and then an error : Subscript used with non-Array Variable...

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE
Link to comment
Share on other sites

  • 5 weeks later...

Oh :P Sorry, I didnt want to steal any of your functions and describe them as maded by me. Im really very sorry about that, I just use UDF from other people quite often and forgoten to write this info. It wasnt my intention. I hope that this little misteake will not set my programs/scripts in "bad light" ?

Uriziel01

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...