POST-Daten mit URL übergeben?

  • Hi8)

    Sorry ich weiß nicht ob das so ganz hier hin passt aber ich bin an nem programm am basteln und wollte mal fragen wie man POST-Daten mit Hyperlink übergeben kann?:P

    Wenn ich z.b ein Captcha habe und das dann direkt per URL übergeben möchste , also kein _IEcreate oder so sonder über _inetgetsource:comp2:

    z.B. auf dieser Seite:

    http://85.17.177.195/sjsafe/f-4d7d2…_Sp_S01E01.html

    Hier habe ich ein Inputfeld und muss dann die eingegebenen daten Abschicken.
    Geht das nicht einfach auch als URL direckt oben in den Browser eingegeben... zB so...

    http://85.17.177.195/sjsafe/f-4d7d2d77432ceaac/rc_Sp_S01E01.html?s=322a2f9ec370b6444130be511ead0fca&c=zef

    Hoffe mir kann jemand Helfen...

    MFG chris:D

  • Hoi,

    wenn Du inetget oder _inetgetsource verwendest wird ein Request mit der Methode GET an den Webserver geschickt ... also per URI/URL. Daten mit der Methode Post über eine URL zu senden ist nicht vorgesehen ... dann währe es nämlich wieder ein GET. Post-Daten werden im Header des Request's mitgeschickt.

    weiter infos findest Du zum Beispiel bei wikipedia ...

    Du kannst es ja mal mit der HTTP-UDF aus dem englischen Forum versuchen, die enthält eine _httpPost Methode.

    http.au3

    Spoiler anzeigen
    [autoit]


    ; ===================================================================
    ; HTTP UDF's
    ; v0.5
    ;
    ; By: Greg "Overload" Laabs
    ; Last Updated: 07-22-06
    ; Tested with AutoIt Version 3.1.1.131
    ; Extra requirements: Nothing!
    ;
    ; A set of functions that allow you to download webpages and submit
    ; POST requests.
    ;
    ; Main functions:
    ; _HTTPConnect - Connects to a webserver
    ; _HTTPGet - Submits a GET request to a webserver
    ; _HTTPPost - Submits a POST request to a webserver
    ; _HTTPRead - Reads the response from a webserver
    ; ===================================================================

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    TCPStartup()

    [/autoit] [autoit][/autoit] [autoit]

    Global $_HTTPUserAgent = "AutoItScript/"&@AutoItVersion
    Global $_HTTPLastSocket = -1
    Global $_HTTPRecvTimeout = 5000

    [/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPSetUserAgent($Program, $Version)
    ;
    ; Sets the User-Agent that will be sent with all future _HTTP
    ; functions. If this is never called, the user agent is set to
    ; AutoItScript/[YourAutoItVersion]
    ; Parameters:
    ; $Program - IN - The name of the program
    ; $Version - IN - The version number of the program
    ; Returns:
    ; None
    ; ===================================================================
    Func _HTTPSetUserAgent($Program, $Version)
    $_HTTPUserAgent = $Program&"/"&$Version
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPConnect($host, [$port])
    ;
    ; Opens a connection to $host on the port you supply (or 80 if you don't supply a port. Returns the socket of the connection.
    ; Parameters:
    ; $host - IN - The hostname you want to connect to. This should be in the format "www.google.com" or "localhost"
    ; $port - OPTIONAL IN - The port to connect on. 80 is default.
    ; Returns:
    ; The socket of the connection.
    ; Remarks:
    ; Possible @errors:
    ; 1 - Unable to open socket - @extended is set to Windows API WSAGetLasterror return
    ; ===================================================================
    Func _HTTPConnect($host, $port = 80)
    Dim $ip = TCPNameToIP ( $host )
    Dim $socket = TCPConnect ( $ip, 80 )

    [/autoit] [autoit][/autoit] [autoit]

    If ($socket == -1) Then
    SetError(1, @error)
    Return -1
    EndIf

    $_HTTPLastSocket = $socket
    SetError(0)
    Return $socket
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Possible @errors:
    ; 1 - No socket
    Func _HTTPClose($socket = -1)
    If $socket == -1 Then
    If $_HTTPLastSocket == -1 Then
    SetError(1)
    Return 0
    EndIf
    $socket = $_HTTPLastSocket
    EndIf
    TCPCloseSocket($socket)

    SetError(0)
    Return 1
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPGet($host, $page, [$socket])
    ;
    ; Executes a GET request on an open socket.
    ; Parameters:
    ; $host - IN - The hostname you want to get the page from. This should be in the format "www.google.com" or "localhost"
    ; $page - IN - The the file you want to get. This should always start with a slash. Examples: "/somepage.php" or "/somedirectory/somefile.zip"
    ; $socket - OPTIONAL IN - The socket opened by _HTTPConnect. If this is not supplied, the last socket opened with _HTTPConnect will be used.
    ; Returns:
    ; The number of bytes sent in the request.
    ; Remarks:
    ; Possible @errors:
    ; 1 - No socket supplied and no current socket exists
    ; 2 - Error sending to socket. Check @extended for Windows API WSAGetError return
    ; ===================================================================
    Func _HTTPGet($host, $page, $socket = -1)
    Dim $command

    If $socket == -1 Then
    If $_HTTPLastSocket == -1 Then
    SetError(1)
    Return
    EndIf
    $socket = $_HTTPLastSocket
    EndIf

    $command = "GET "&$page&" HTTP/1.1"&@CRLF
    $command &= "Host: " &$host&@CRLF
    $command &= "User-Agent: "&$_HTTPUserAgent&@CRLF
    $command &= "Connection: close"&@CRLF
    $command &= ""&@CRLF

    Dim $bytessent = TCPSend($socket, $command)

    If $bytessent == 0 Then
    SetExtended(@error)
    SetError(2)
    return 0
    EndIf

    SetError(0)
    Return $bytessent
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPPost($host, $page, [$socket])
    ;
    ; Executes a POST request on an open socket.
    ; Parameters:
    ; $host - IN - The hostname you want to get the page from. This should be in the format "www.google.com" or "localhost"
    ; $page - IN - The the file you want to get. This should always start with a slash. Examples: "/" or "/somedirectory/submitform.php"
    ; $socket - OPTIONAL IN - The socket opened by _HTTPConnect. If this is not supplied, the last socket opened with _HTTPConnect will be used.
    ; $data - OPTIONAL IN - The data to send in the post request. This should first be run through _HTTPEncodeString()
    ; Returns:
    ; The number of bytes sent in the request.
    ; Remarks:
    ; Possible @errors:
    ; 1 - No socket supplied and no current socket exists
    ; 2 - Error sending to socket. Check @extended for Windows API WSAGetError return
    ; ===================================================================
    Func _HTTPPost($host, $page, $socket = -1, $data = "")
    Dim $command

    If $socket == -1 Then
    If $_HTTPLastSocket == -1 Then
    SetError(1)
    Return
    EndIf
    $socket = $_HTTPLastSocket
    EndIf

    Dim $datasize = StringLen($data)

    $command = "POST "&$page&" HTTP/1.1"&@CRLF
    $command &= "Host: " &$host&@CRLF
    $command &= "User-Agent: "&$_HTTPUserAgent&@CRLF
    $command &= "Connection: close"&@CRLF
    $command &= "Content-Type: application/x-www-form-urlencoded"&@CRLF
    $command &= "Content-Length: "&$datasize&@CRLF
    $command &= ""&@CRLF
    $command &= $data&@CRLF

    Dim $bytessent = TCPSend($socket, $command)

    If $bytessent == 0 Then
    SetExtended(@error)
    SetError(2)
    return 0
    EndIf

    SetError(0)
    Return $bytessent
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPRead([$socket], [$flag])
    ;
    ; Retrieves data from an open socket. This should only be called after _HTTPGet or _HTTPPost is called.
    ; Parameters:
    ; $socket - OPTIONAL IN - The socket you want to receive data from. If this is not supplied, the last socket opened with _HTTPConnect will be used.
    ; $flag - OPTIONAL IN - Determines how the data will be returned. See Remarks.
    ; Returns:
    ; See "Flags" in remarks, below.
    ; Remarks:
    ; Possible @errors:
    ; 1 - No socket
    ; 3 - Timeout reached before any data came through the socket
    ; 4 - Some data came through, but not all of it. Return value is the number of bytes received.
    ; 5 - Unable to parse HTTP Response from server. Return value is the HTTP Response line
    ; 6 - Unexpected header data returned. Return value is the line that caused the error
    ; 7 - Invalid flag
    ; 8 - Unable to parse chunk size. Return value is the line that caused the error
    ; Flags:
    ; 0 - Return value is the body of the page (default)
    ; 1 - Return value is an array:
    ; [0] = HTTP Return Code
    ; [1] = HTTP Return Reason (human readable return code like "OK" or "Forbidden"
    ; [2] = HTTP Version
    ; [3] = Two dimensional array with the headers. Each item has:
    ; [0] = Header name
    ; [1] = Header value
    ; [4] = The body of the page
    ; ===================================================================
    Func _HTTPRead($socket = -1, $flag = 0)
    If $socket == -1 Then
    If $_HTTPLastSocket == -1 Then
    SetError(1)
    Return
    EndIf
    $socket = $_HTTPLastSocket
    EndIf

    Dim $timer = TimerStart()
    Dim $performancetimer = TimerStart()
    Dim $downloadtime = 0

    Dim $headers[1][2] ; An Array of the headers found
    Dim $numheaders = 0 ; The number of headers found
    Dim $body = "" ; The body of the message
    Dim $HTTPVersion ; The HTTP version of the server (almost always 1.1)
    Dim $HTTPResponseCode ; The HTTP response code like 200, or 404
    Dim $HTTPResponseReason ; The human-readable response reason, like "OK" or "Not Found"
    Dim $bytesreceived = 0 ; The total number of bytes received
    Dim $data = "" ; The entire raw message gets put in here.
    Dim $chunked = 0 ; Set to 1 if we get the "Transfer-Encoding: chunked" header.
    Dim $chunksize = 0 ; The size of the current chunk we are processing.
    Dim $chunkprocessed = 0 ; The amount of data we have processed on the current chunk.
    Dim $contentlength ; The size of the body, if NOT using chunked transfer mode.
    Dim $part = 0 ; Refers to what part of the data we're currently parsing:
    ; 0 - Nothing parsed, so HTTP response should come next
    ; 1 - Currently parsing headers
    ; 2 - Currently waiting for the next chunk size - this is skipped if the transfer-encoding is not chunked
    ; 3 - Currently waiting for or parsing body data
    ; 4 - Currently parsing footers
    While 1
    Sleep(10)
    Dim $recv = TCPRecv($socket,16)
    If @error <> 0 Then
    ;ConsoleWrite("Server closed connection")
    ;@error appears to be -1 after the server closes the connection. A good way to tell that we're finished, because we always send
    ;the "Connection: close" header to the server.
    ; !!! This is no longer used because we can now tell that we're done by checking the content-length header or properly handling
    ; chunked data.
    EndIf

    If $recv <> "" Then
    $bytesreceived = $bytesreceived + StringLen($recv)
    $timer = TimerStart()
    $data &= $recv
    ;~ ConsoleWrite("Bytes downloaded: "&$bytesreceived&@CRLF)
    EndIf

    Dim $split = StringSplit($data,@CRLF,1)
    $data = ""
    Dim $i
    For $i=1 To $split[0]
    If $i=$split[0] Then
    If $part < 2 OR $chunked = 1 Then
    ; This is tricky. The last line we've received might be truncated, so we only want to process it under special cases.
    ; Non chunked data doesn't always send a CRLF at the end so there's no way to tell if this is truly the last line without parsing it.
    ; However, we don't want to parse it if it's only a partial header or something.
    ; The solution: We will only process this last line if we're at the body section and the transfer-encoding is NOT chunked.
    $data = $split[$i]
    ExitLoop
    EndIf
    EndIf

    Dim $newpart = $part
    Switch $part
    Case 0 ; Nothing parsed, so HTTP response should come next
    If $split[$i] <> "" Then
    Dim $regex = StringRegExp($split[$i],"^HTTP/([0-9.]+) ([0-9]+) ([a-zA-Z0-9 ]+)$",3)
    If @extended = 0 Then
    SetError(5)
    Return $split[$i]
    Else
    $HTTPVersion = $regex[0]
    $HTTPResponseCode = $regex[1]
    $HTTPResponseReason = $regex[2]
    If $HTTPResponseCode <> 100 Then
    $newpart = 1
    EndIf
    EndIf
    EndIf
    Case 1, 4 ; Currently parsing headers or footers
    ;If the line is blank, then we're done with headers and the body is next
    If $split[$i] == "" Then
    If $part = 1 Then
    If $chunked Then
    $newpart = 2
    Else
    $newpart = 3
    EndIf
    ElseIf $part = 4 Then
    ; If $part is 4 then we're processing footers, so we're all done now.
    ExitLoop 2
    EndIf
    Else ;The line wasn't blank
    ;Check to see if the line begins with whitespace. If it does, it's actually
    ;a continuation of the previous header
    Dim $regex = StringRegExp($split[$i],"^[ \t]+([^ \t].*)$",3)
    If @extended = 1 Then
    If $numheaders == 0 Then
    SetError(6)
    Return $split[$i]
    EndIf
    $headers[$numheaders-1][1] &= $regex[0]
    Else;The line didn't start with a space
    Dim $regex = StringRegExp($split[$i],"^([^ :]+):[ \t]*(.*)$",3)
    If @extended = 1 Then
    ;This is a new header, so add it to the array
    $numheaders = $numheaders + 1
    ReDim $headers[$numheaders][2]
    $headers[$numheaders-1][0] = $regex[0]
    $headers[$numheaders-1][1] = $regex[1]

    ; There are a couple headers we need to know about. We'll process them here.
    If $regex[0] = "Transfer-Encoding" AND $regex[1] = "chunked" Then
    $chunked = 1
    ElseIf $regex[0] = "Content-Length" Then
    $contentlength = Int($regex[1])
    EndIf
    Else
    SetError(6)
    Return $split[$i]
    EndIf
    EndIf
    EndIf
    Case 2 ; Awaiting chunk size
    $regex = StringRegExp($split[$i],"^([0-9a-f]+);?.*$",3)
    If @extended = 0 Then
    SetError(8)
    Return $split[$i]
    EndIf
    $chunksize = $regex[0]
    $chunksize = Dec($chunksize)
    $chunkprocessed = 0

    If $chunksize == 0 Then
    $newpart = 4
    Else
    $newpart = 3
    EndIf
    Case 3 ; Awaiting body data
    $body &= $split[$i]

    $chunkprocessed = $chunkprocessed + StringLen($split[$i])

    If $chunked Then
    If $chunkprocessed >= $chunksize Then
    $newpart = 2
    Else
    $body &= @CRLF
    $chunkprocessed = $chunkprocessed + 2; We add 2 for the CRLF we stipped off.
    EndIf
    Else
    If $chunkprocessed >= $contentlength Then
    ExitLoop 2
    Else
    If $i < $split[0] Then
    ; Only add a CRLF if this is not the last line received.
    $body &= @CRLF
    $chunkprocessed = $chunkprocessed + 2; We add 2 for the CRLF we stipped off.
    EndIf
    EndIf
    EndIf
    Case Else
    ; This should never happen
    EndSwitch
    $part = $newpart
    Next

    If $bytesreceived == 0 AND TimerDiff($timer) > $_HTTPRecvTimeout Then
    SetError(3)
    Return 0
    ElseIf $bytesreceived > 0 AND TimerDiff($timer) > $_HTTPRecvTimeout Then
    ConsoleWrite($body)
    SetError(4)
    Return $bytesreceived
    EndIf
    WEnd
    $downloadtime = TimerDiff($performancetimer)
    ;ConsoleWrite("Performance: Download time: "&$downloadtime&@CRLF)

    Switch $flag
    Case 0
    SetError(0)
    Return $body
    Case 1
    Dim $return[5]
    $return[0] = $HTTPResponseCode
    $return[1] = $HTTPResponseReason
    $return[2] = $HTTPVersion
    $return[3] = $headers
    $return[4] = $body
    SetError(0)
    Return $return
    Case Else
    SetError(7)
    Return 0
    EndSwitch
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; ===================================================================
    ; _HTTPEncodeString($string)
    ;
    ; Encodes a string so it can safely be transmitted via HTTP
    ; Parameters:
    ; $string - IN - The string to encode
    ; Returns:
    ; A valid encoded string that can be used as GET or POST variables.
    ; ===================================================================
    Func _HTTPEncodeString($string)
    Local Const $aURIValidChars[256] = _
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _
    0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, _
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, _
    0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, _
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

    Local $sEncoded = ""
    For $i = 1 To StringLen($string)
    Local $c = StringMid($string, $i, 1)
    If $c = " " Then $c = "+"
    If Number($aURIValidChars[Asc($c) ]) Then
    $sEncoded &= $c
    Else
    $sEncoded &= StringFormat("%%%02X", Asc($c))
    EndIf
    Next

    Return $sEncoded
    EndFunc ;==>_WebComposeURL

    [/autoit]

    ein Beispiel:

    Spoiler anzeigen
    [autoit]


    #include <HTTP.au3>
    $host = "www.apartment167.com"
    $page = "/overload/autoit/postpage.php"
    $vars = "examplevariable=examplevalue&anothervar=anotherval&yetanothervariable=yet another value, this time with spaces and puncuation!"
    $vars = _HTTPEncodeString($vars)

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite(@CRLF&@CRLF&"Example POST Request:"&@CRLF)
    $socket = _HTTPConnect($host)
    ConsoleWrite("Socket Created: "&$socket&@CRLF)
    $get = _HTTPPost($host, $page, $socket, $vars)
    ConsoleWrite("Bytes sent: "&$get&@CRLF)
    $recv = _HTTPRead($socket,1)
    If @error Then
    ConsoleWrite("_HTTPRead Error: "&@error&@CRLF)
    ConsoleWrite("_HTTPRead Return Value: "&$recv &@CRLF)
    Else
    ConsoleWrite("HTTP Return Code: "&$recv[0]&@CRLF)
    ConsoleWrite("HTTP Return Response: "&$recv[1]&@CRLF)
    ConsoleWrite("Number of headers: "&UBound($recv[3])&@CRLF)
    ConsoleWrite("Size of data downloaded: "&StringLen($recv[4])&" bytes"&@CRLF)
    ConsoleWrite("Page downloaded: "&@CRLF&$recv[4]&@CRLF)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _HTTPClose($socket)

    [/autoit]

    Einmal editiert, zuletzt von jonk (18. Oktober 2007 um 23:49)

  • .. naja illegal? Komm darauf an wofür man es nutzt. Es könnte ja auch dem Faulpelztum dienen ... einer völlig zu unrecht unterschätzten Sportart ;)

    Einmal editiert, zuletzt von jonk (18. Oktober 2007 um 23:55)

    • Offizieller Beitrag

    Hallo

    Naja, aber Capatchas haben ja einen Sinn. Nämlich hauptsächlich den, dass man es eben nicht Automatisiert. Ich glaube das Serienjunkies da nicht allzu Streng ist, aber bei Rapidshare wird es dann doch schon etwas brenzlicher. Ich meine wenn schon ein Administrator von ner kleinen Seite die SMS versendet kommt, wie sieht es denn erst bei Rapidshare aus?

    Mfg Spider

  • Moin

    Erstmal danke für die Antworten.

    @jonk

    Das war eigentlich genau das was ich gesucht habe^^ denke ich mal...
    Big THX

    GtaSpider

    Serienjunkies war eigentlich nur eine Bsp. Seite von mir.
    Ich habe das Script mit _iecreate und _ieBodyReadHTML schon am laufen nur ist mir das leider zu langsam.


    MFG chris

    (Der völlig unterschätze Sportteilnehmer)

  • ich kann eingentlich nur sagen, dass du wget probieren solltest, weil man damit genau das machen kann.

    ShellExecute('wget.exe','--output-document logfile.txt --save-cookies=login --keep-session-cookies --post-data "aaan" http://www.autoit.de')
    ShellExecute('wget',' --output-document=nul --load-cookies=login --keep-session-cookies --post-data "mean" https://autoit.de/www.autoit.de/index?goto=shout')

    Hab ach gleich 2 Beispiele gemacht wie genau du post daten senden kannst.
    Hoffe konnte dir helfen.

    Einmal editiert, zuletzt von energy (19. Oktober 2007 um 15:10)

  • Hi

    THX @energy Nur leider komme ich damit noch nicht so richtig weiter...
    Habe mal folgendes ausprobiert... :comp2:

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <inet.au3>
    #include <array.au3>
    #include <string.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $link = 'http://85.17.177.195/sjsafe/f-f4a18bb61df218d2/rs_sga401.html'

    [/autoit] [autoit][/autoit] [autoit]

    $quelltext = _INetGetSource ( $link );quelltext holen
    $SessionID = _StringBetween ( $quelltext,'VALUE="','">');SessionID ermitteln
    ;_ArrayDisplay ($SessionID)
    $captcha_add = _StringBetween ($quelltext,'src="/sjsafe/secure/','.gif"',-1);captcha adresse herausfiltern
    InetGet ("http://85.17.177.195/sjsafe/secure/"&$captcha_add[0]&'.gif',"captcha.gif",1);Captcha herunterladen
    SplashImageOn ( '','captcha.gif',100,30,25,25,1)
    $captcha_code = InputBox ( '','Captcha eingeben')

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ShellExecuteWait('wget.exe','--output-document quelltext.txt --save-cookies=login --keep-session-cookies --post-data "'&'s='&$SessionID&'&c='&$captcha_code&'" '&$link)

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Das gibt mir aber den gleichen Quelltext in der quelltext.txt raus wie auf der Seite http://85.17.177.195/sjsafe/f-f4a18…/rs_sga401.html
    Habe mir auch mal die Hilfe zu wget durchgelesen.... nur übersteigt das bei weiten meinen Wissen...
    Vieleicht kannst du mir ja noch nen Tip geben

    Vielen Dank schonmal!!!

    MFG chris

  • so habs mir auch mal angekuckt.

    Hab den fehler gefunden.^^

    _stringbetween giebt ein array raus. Deswegen ach direkt drunter _arraydisplay.

    Des muss so heißen, damit wget auch genau weis was gesendet werden soll.

    ShellExecuteWait('wget.exe','--output-document quelltext.txt --save-cookies=login --keep-session-cookies --post-data "'&'s='&$SessionID[0]&'&c='&$captcha_code&'" '&$link)

  • Moin,
    die 3 ? must du schon selber ersetzen...

    Spoiler anzeigen
    [autoit]

    #include <IE.au3> $oIE = _IECreate ("http://85.17.177.195/sjsafe/f-f4a18bb61df218d2/rs_sga401.htm") $oForm = _IEFormGetCollection ($oIE, 0) $oQuery = _IEFormElementGetCollection ($oForm, 1) _IEFormElementSetValue ($oQuery, "???") _IEFormSubmit ($oForm)

    [/autoit]

    Ohne IE-Schnittstelle fällt mir so schnell auch keine Lösung ein.


    Gruß
    Westi

  • Ohhhh mein Gott ...
    schande auf mich....!!!

    Das hätte ich aber auch sehen müssen........
    energy DAFÜR LIEBE ICH DICH :P
    genau nach sowas habe ich schon lange lange gesucht und jetzt klappt es ^^

    BIG BIG THX

    MFG chris:D

    EDIT:

    Werde dann das fertige Programm mal hier Posten....

  • ich weis des gehört nicht in die Topic, aber ich hoffe du kennst bereits, dass
    youcrypt plugin für den RSD und USD.

  • es giebt/gab im Moment eine Autocaptchamethode für serienjunkies nur jetzt haben sie neue captchas und deswegen geht diese nicht mehr.
    Für eine neue Methode brauchst du circa 1700 richtige Captcha eingaben.

    Also ich weis zwar nicht für was du die direkt links brauchst wenn es containerfiles giebt.

    Bin gespannt ob du die Links entschlüsseln kannst.

    Gruß energy

  • So fertig ^^ ;(

    Ich hoffe das ich das hier Posten darf.... ansonsten bitte einfach löschen^^ ?(

    Ist nur ne Testversion (Sind also bestimmt noch Bugs drin) :comp2:

    h**p://www.datenschleuder.eu/get_87500d104a4458fe7503c49892da2645.html

    Spoiler anzeigen
    [autoit]


    #include <Inet.au3>
    #include <array.au3>
    #include <string.au3>
    #include <file.au3>
    #include <GUIConstants.au3>
    #include <Date.au3>

    [/autoit] [autoit][/autoit] [autoit]

    FileInstall ( "data.ini", 'data.ini')
    FileInstall ( "wget.exe", 'wget.exe')

    [/autoit] [autoit][/autoit] [autoit]

    ToolTip ("starte ...",25,25)

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form= ;Gui erstellen für Captcha abfrage.....
    $Form1 = GUICreate("Captcha", 117, 91, 193, 115, -1,BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    $Pic1 = GUICtrlCreatePic("", 8, 8, 100, 30, BitOR($SS_NOTIFY,$WS_GROUP))
    $Input1 = GUICtrlCreateInput("", 8, 40, 100, 21)
    $OK_Button = GUICtrlCreateButton("OK", 8, 64, 100, 25, 1,$BS_DEFPUSHBUTTON);$BS_DEFPUSHBUTTON = reagiert auf {ENTER}
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet ('^i','_zeigeHilfe');Hotkey setzen für Strg+i
    HotKeySet ('^l','_zeigeListe');Hotkey setzen für Strg+l

    [/autoit] [autoit][/autoit] [autoit]

    Opt("TrayOnEventMode",1);Traymenu reagiert auf klick
    Opt("TrayMenuMode",1);Um ein Traymenu zu erstellen

    [/autoit] [autoit][/autoit] [autoit]

    $tray_exit = TrayCreateItem("Hilfe";)
    TrayItemSetOnEvent(-1,"_zeigeHilfe";)
    $tray_exit = TrayCreateItem("Exit";);Trayitem erstellen
    TrayItemSetOnEvent(-1,"_gui_exit";);Traymenu reagiert auf klick und geht in die Func _gui_exit()

    [/autoit] [autoit][/autoit] [autoit]

    ;ClipPut ( 'http://85.17.177.195/sjsafe/f-f4a18bb61df218d2/rs_sga401.html');****************************************************
    ; Den ClipPut nur aktivieren um zu testen

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    ToolTip ("such nach Serienjunkie Links im Zwischenspeicher.... [STRG] + [ i ] = Help",25,25)
    If _IsPressed ('1B') = True Then _gui_exit();Wenn ESC gedrückt wird in Func _gui_exit() springen
    While 1
    Sleep (50);Lass dem Rechner etwas Luft ^^
    If _IsPressed ('1B') = True Then _gui_exit();Wenn ESC gedrückt wird in Func _gui_exit() springen
    If StringInStr ( ClipGet(),"/sjsafe/";) = True Then;Wenn im Clip /sjsafe/ vorhanden ist ....
    ;Bsp: http://85.17.177.195/sjsafe/f-cfb24…rc_stga301.html
    $linkverschluesselt = _StringBetween (ClipGet(),"/sjsafe/",".html";);suche die ID des verschlüsselten Links
    ;_ArrayDisplay ($linkverschluesselt)
    ClipPut (''); Clip leer machen da er sonst den gleichen link nochmal entschlüsselt!!
    If IsArray($linkverschluesselt) == 1 Then
    $link = 'http://85.17.177.195/sjsafe/'&$linkverschluesselt[0]&'.html' ;Link zusammensetzen
    ExitLoop ;aus dem While herausspringen...
    EndIf
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ToolTip ("Suche Captcha....",25,25)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;####################################################### Solange Captacha fragen bis es richtig ist!!! ANFANG
    Do
    $quelltext = _INetGetSource ( $link );quelltext holen
    $SessionID = _StringBetween ( $quelltext,'VALUE="','">');SessionID ermitteln
    $captcha_add = _StringBetween ($quelltext,'src="/sjsafe/secure/','.gif"',-1);captcha adresse herausfiltern
    InetGet ("http://85.17.177.195/sjsafe/secure/"&$captcha_add[0]&'.gif',"captcha.gif",1);Captcha herunterladen
    GUICtrlSetImage($Pic1,@ScriptDir&"\captcha.gif";);Captcha in den Gui setzen
    GUICtrlSetData ($Input1,'');Input leeren von der vorherigen Eingabe
    GUISetState(@SW_SHOW);Gui zeigen
    ToolTip ("Captcha eingeben....",25,25)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

    [/autoit] [autoit][/autoit] [autoit]

    Case $GUI_EVENT_CLOSE ;Wenn [x] gedrückt dann springe in Funktion _gui_exit()
    _gui_exit()

    [/autoit] [autoit][/autoit] [autoit]

    Case $OK_Button ; Wenn OK gedrückt dann...
    $captcha_eingabe = GUICtrlRead ($Input1);Eingabefeld lesen
    GUISetState(@SW_HIDE);Gui verstecken
    ExitLoop ;aus dem While herausspringen...
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    FileDelete ( @ScriptDir&'\quelltext.htm');vorhandene datei löschen

    [/autoit] [autoit][/autoit] [autoit]

    ToolTip ("prüfe Captcha....",25,25)
    ShellExecuteWait('wget.exe','--output-document quelltext.htm --save-cookies=login --keep-session-cookies --post-data "s='&$SessionID[0]&'&c='&$captcha_eingabe&'" '&$link,'','',@SW_HIDE)
    ; ### Wget.exe ###
    ; --output-document = Ausgabe der Ziehldatei(gewünschte Seite mit den Downloadlinks)
    ; --save-cookies=login = Cookie speichern
    ; --keep-session-cookies = Cookie benutzen um neue Seite zu laden
    ; --post-data = Die SessionID und die Captchaeingabe übertragen
    ; link = Die Form-Action Seite angeben
    ; kompliziert aber funzt ^^ und 10 mal schneller als das ganze mit _IEcreate zu machen!!!
    Do
    Sleep (10)
    Until FileExists (@ScriptDir&'\quelltext.htm'); Warten bis die neue .htm erstellt wurde...

    [/autoit] [autoit][/autoit] [autoit]

    Dim $quelltext_array ;array erstellen
    _FileReadToArray (@ScriptDir&'\quelltext.htm', $quelltext_array);neue quelltext.htm in ein array einlesen
    ;_ArrayDisplay ( $quelltext_array)

    [/autoit] [autoit][/autoit] [autoit]

    $quelltext = _ArrayToString ( $quelltext_array,'',1);neues quelltextarray in string umwandeln
    Until StringInStr ($quelltext , 'http://85.17.177.195/sjsafe/go-') > 0 ;so lange Prüfen bis Download min 2x im Quelltextstring vorhanden ist.
    ;####################################################### / Solange Captacha fragen bis es richtig ist!!! ENDE
    Dim $array_download_links[1];array erstellen
    $i2 = 0
    Do ;mache solange...
    $i2 = $i2 +1
    If StringInStr ( $quelltext_array[$i2],'http://85.17.177.195/sjsafe/go-') Then;Prüfen ob in der Zeile überhaupt ein SJ-Link ist wenn ja, dann....
    $link_gefiltert = _StringBetween ($quelltext_array[$i2],'http://85.17.177.195/sjsafe/go-','/') ;Herausfiltern des Links
    _ArrayAdd ($array_download_links,$link_gefiltert[0]&'/');zum download array hinzufügen
    EndIf
    Until $i2 = $quelltext_array[0] ;.... bis Zähler = array max

    [/autoit] [autoit][/autoit] [autoit]

    $array_download_links[0] = UBound ($array_download_links)-1;UBOUND = Um maximale Anzahl des Arrays herauszufinden
    ;_ArrayDisplay ($array_download_links,"test";)
    ;############################################################ Rapidshare Links holen für die Downloads

    [/autoit] [autoit][/autoit] [autoit]

    Dim $entschluesselte_links_liste[1];array erstellen
    _FileReadToArray ( @ScriptDir&'\entschluesselt.txt',$entschluesselte_links_liste);array mit den schon entschlüsselten daten füllen.
    _ArrayAdd ($entschluesselte_links_liste,'----------------------- '&_Now()&' -----------------------');Trennung dem array hinzufügen mit Datum/Uhrzeit

    [/autoit] [autoit][/autoit] [autoit]

    For $i=1 to $array_download_links[0] Step +1 ;jeden download einzelnd bearbeiten bis $i auf $download_links_anzahl ist
    ;MsgBox(0,$i,"Download = "&$array_download_links[$i])
    ToolTip ($i&" / "&$array_download_links[0]&" gefunden/hinzugefügt",25,25);Tooltip setzen
    $quelltext1 = _INetGetSource ( 'http://85.17.177.195/sjsafe/go-'&$array_download_links[$i]&'/');Quelltext ermitteln und in $quelltext1 speichern
    $link2 = _StringBetween ($quelltext1,'SRC="','/"');Ersten Link herausfiltern
    ;_ArrayDisplay ($link2)
    $quelltext2 = _INetGetSource ($link2[0]&'/');Quelltext holen
    ;ClipPut ($quelltext2)
    ;Exit
    $i3 = 0
    While 1
    $i3 = $i3 +1
    Select ; Auswählen
    Case StringInStr ($quelltext2,'http://rapidshare.com/files/') = True ;Wenn der Quelltext RS.com enthält dann mach....
    $link3 = _StringBetween ($quelltext2,'http://rapidshare.com/files/','</b>');Zweiten Link herausfiltern RS.com
    If IniRead ( 'data.ini','Allgemein','zwischenablage','') = 1 Then ;Wenn in den Einstellungen zwischenablage 1 ist dann...
    ClipPut ('http://rapidshare.com/files/'&$link3[0]);Fertig entschlüsselte Rapidshare.com Link in den Zwischenspeicher legen
    EndIf
    _ArrayAdd ($entschluesselte_links_liste,'http://rapidshare.com/files/'&$link3[0]) ;zu Liste hinzufügen
    ExitLoop

    [/autoit] [autoit][/autoit] [autoit]

    Case StringInStr ($quelltext2,'http://rapidshare.de') = True ;Wenn der Quelltext RS.de enthält dann mach....
    $link3 = _StringBetween ($quelltext2,'files/','.html">');Zweiten Link herausfiltern RS.de
    If IniRead ( 'data.ini','Allgemein','zwischenablage','') = 1 Then ;Wenn in den Einstellungen zwischenablage 1 ist dann...
    ClipPut ('http://rapidshare.de/files/'&$link3[0]);Fertig entschlüsselte Rapidshare.de Link in den Zwischenspeicher legen
    EndIf
    _ArrayAdd ($entschluesselte_links_liste,'http://rapidshare.de/files/'&$link3[0]) ;zu Liste hinzufügen
    ExitLoop

    [/autoit] [autoit][/autoit] [autoit]

    Case StringInStr ($quelltext2,'http://netload.in/') = True ;Wenn der Quelltext RS.de enthält dann mach....
    $link3 = _StringBetween ($quelltext2,'http://netload.in/','.htm');Zweiten Link herausfiltern RS.de
    If IniRead ( 'data.ini','Allgemein','zwischenablage','') = 1 Then ;Wenn in den Einstellungen zwischenablage 1 ist dann...
    ClipPut ('http://netload.in/'&$link3[0]&'.htm');Fertig entschlüsselte Rapidshare.de Link in den Zwischenspeicher legen
    EndIf
    _ArrayAdd ($entschluesselte_links_liste,'http://netload.in/'&$link3[0]&'.htm') ;zu Liste hinzufügen
    ExitLoop

    [/autoit] [autoit][/autoit] [autoit]

    EndSelect ;Auswählen ende
    If $i3 > 10 Then
    MsgBox (16,"error",'Kenne den Download-Hoster nicht!?'&@CRLF _
    &'www.rapidstalker.dl.am')
    Exit
    EndIf
    WEnd
    Next

    [/autoit] [autoit][/autoit] [autoit]

    _ArrayAdd ($entschluesselte_links_liste,'-------------------------------------------------------------------');Trennung dem array hinzufügen
    _ArrayAdd ($entschluesselte_links_liste,' ');leere Zeile einfügen
    $entschluesselte_links_liste[0] = UBound($entschluesselte_links_liste)-1 ;Array[0] setzten
    ;_ArrayDisplay($entschluesselte_links_liste)
    _FileWriteFromArray(@ScriptDir&'\entschluesselt.txt',$entschluesselte_links_liste,1);Vom array in txt schreiben...

    [/autoit] [autoit][/autoit] [autoit]

    WEnd ;While Ende
    ;#####################################################
    Func _gui_exit() ;Funktion EXIT
    ToolTip ('') ;Alle Tooltips löschen, da das hochsetzen des Counters etwas dauern kann...(Kommt blöd wenn das Programm noch da ist wenn man exit gedrückt hat^^)
    _INetGetSource ( 'http://www.counter.de/cgi-bin/counter.pl?member=1192451610');Counter aufrufen und damit den Zähler 1 hochsetzen
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _zeigeHilfe() ;Funk Help/Einstellungen
    Run("notepad " & @WorkingDir & "\data.ini" )
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _zeigeListe() ;Funk Liste
    if FileExists( @ScriptDir&'\entschluesselt.txt' ) = 1 Then ;Wenn die Datein entschluesselt.txt vorhanden ist dann...
    Run("notepad " & @WorkingDir & "\entschluesselt.txt" );öffne sie
    Else ;ansonsten
    MsgBox (32,"","Liste ist noch leer";) ;Meckern ^^
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Also der Quelltext ist komplett Komentiert... :D
    Werden aber vieleicht nicht alle Komentare stimmen aber das liegt daran das ich es einfach nicht besser weiß... :P
    Also viel Spass^^

    MFG chris :D

    EDIT:

    @energy
    Ich weiß das es für SJ eine gab...
    Bin auch eine am entwickeln nur die Erkennungsrate liegt noch bei 45% also viel zu niedrig^^ Aber die captcha sind auch verdammt schwer ich glaube 4 Schriftarten und dann meist ne andere Schriftgröße usw...^^

  • So habs mir mal angekuckt.
    Wget braucht libeay32.dll,ssleay32.dll damit es funkt.
    des wegen mein kleiner tipp die beiden auch noch per Fileinstall mit einzubinden.

    Ist aber ein ganz gutes script geworden. Solltest eventuel noch ein richtige GUI einbauen und nicht nur ein kleines Traymenü.

    Bist du sicher dass du bei dem skellexecutewait(wget...)
    "--save-cookies=login --keep-session-cookies" brauchst?

    2 Mal editiert, zuletzt von energy (20. Oktober 2007 um 14:16)

  • Hi

    Habe es jetzt auf 4 Rechnern getestet keiner von denen hat gemeckert.
    Welches Betriebsystem hast du drauf.. ?

    Edit:

    @energy

    Habe es nicht vor gehabt das in nen gui einzubauen ^^ mal gucken...
    Mit dem --save-cookies=login habe ich noch nicht probiert ob es ohne geht^^

    MFG chris:D

  • Hey jonk

    leider funzt die http.au3 bei mir nicht.
    Fehler ist folgender:
    C:\PROGRA~1\AutoIt3\Include\http.au3(219,26) : ERROR: TimerStart(): undefined function.
    Dim $timer = TimerStart()

    ausserdem habe ich im englischen forum keine http.au3 gefunden. (Ein Link wäre sehr nett:))


    LG Blubkuh

    Dieser Beitrag wurde 9521 mal editiert, zum letzten Mal von Blubkuh: Morgen, 02:28.

    [autoit]

    If Not $Elephant Then $Irelephant = True

    [/autoit]
  • Hi...

    Hatte auch das Problem mit der HTTP.au3 deswegen habe ich die wget.exe benutzt^^ Aber wenn du raus bekommst was das mit dem TimerStart() auf sich hat dann lass es uns wissen ... :]

    MFG chris :D