Jump to content

_INetGetSource with only TLS 1.3 website


 Share

Recommended Posts

Ditto (simpler)

$source = "https://www.treshaut.net/tels/Installations_Auto/date_maj2.txt"
$dest = "test.txt"
RunWait('curl -L -s -k ' & $source & ' -o "' & $dest & '"', "", @SW_HIDE)

or

$out = _Get("https://www.treshaut.net/tels/Installations_Auto/date_maj2.txt")
ConsoleWrite($out & @crlf)

Func _Get($url)
   Local $cmd = "curl -L -s -k " & $url
   Local $iPID = Run($cmd, "", @SW_HIDE, 2)  ;$STDOUT_CHILD
   ProcessWaitClose($iPID)
   Local $output = StdoutRead($iPID)
   Return $output
EndFunc

 

Edited by mikell
Link to comment
Share on other sites

Curl is the more reliable way

BTW you can populate a progressbar while downloading using curl, example below

#include <AutoItConstants.au3>

$source = "https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.14.5.zip"
$file = StringRegExpReplace($source, '.*/([^/]+)$', "$1")

$cmd = 'curl -L -k ' & $source & ' -o "' & @scriptdir & '\' & $file & '"'
Local $iPID = Run($cmd, "", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD)
ProgressOn($file, "")
While 1
    $tmp = StderrRead($iPID)
    If @error Then Exitloop
    If $tmp <> "" and StringRegExp($tmp, '(?i)[kmg]') Then
        $pc = StringRegExp($tmp, '(\d+)', 1)
        If not @error Then ProgressSet($pc[0], $pc[0] & " %")
    EndIf
Wend
ProgressOff()
Msgbox(0,"", $file & " : done")

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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