UE_morf_boon Posted November 25, 2020 Share Posted November 25, 2020 (edited) Hey. I am trying to make a program that will download the latest WinRar from the official site. (win-rar.com) or (rarlab.com) Tried using InetRead but it doesn't give an answer: Local $sRead = InetRead("https://www.rarlab.com/download.htm", 1) Msgbox(0,"link", $sRead) Although the VLC site does it successfully: Local $sRead = BinaryToString(InetRead('https://www.videolan.org/vlc/download-windows.ru.html', 1)) Msgbox(0,"link", StringRegExpReplace($sRead,'(?is).*?([^org]+\w+\.exe).*', "https://get.videolan.org$1")) Also tried to just download: InetGet("https://www.win-rar.com/postdownload.html", "C:\Users\Public\Documents\Data\winrar.exe", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Nothing helps, although everything worked correctly with vlc. Please, help. Edited November 26, 2020 by UE_morf_boon Link to comment Share on other sites More sharing options...
Exit Posted November 25, 2020 Share Posted November 25, 2020 4 hours ago, UE_morf_boon said: https://www.rarlab.com/download.htm use: https://www.rarlab.com/rar/wrar60b2.exe App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
UE_morf_boon Posted November 26, 2020 Author Share Posted November 26, 2020 14 hours ago, Exit said: https://www.rarlab.com/rar/wrar60b2.exe Doesn't download. And besides, I would like to download the latest version when using the script. Link to comment Share on other sites More sharing options...
Marc Posted November 26, 2020 Share Posted November 26, 2020 #include <Inet.au3> HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko") $source = _INetGetSource("https://www.rarlab.com",1) $pos = StringInStr($source, "English (", 0, 1) ; use 2 for the current release version. 1 = beta version) if $pos = 0 Then Exit MsgBox(16,"Oops", "Could not find tag in source code") $pos = StringInStr($source, "/rar/", 0, 2, $pos) ; use 1 for 32 Bit Version, 2 = 64 Bit $endstring = StringInStr($source, ".exe", 0, 1, $pos) $filename = StringMid($source, $pos+5, $endstring-$pos-1) $url = "https://www.rarlab.com/rar/" & $filename InetGet($url, $filename) Not stylish, but works. UE_morf_boon 1 Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
UE_morf_boon Posted November 26, 2020 Author Share Posted November 26, 2020 (edited) 31 minutes ago, Marc said: Not stylish, but works. Thank you very much! Works great! UPD: Reduced to the parameters that were at the beginning, thanks again! (Example for x64 ru) #include <InetConstants.au3> HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko") Local $winrar_read = BinaryToString(InetRead('https://www.win-rar.com/postdownload.html?&L=4', 1)) $winrar_down_link = StringRegExpReplace($winrar_read,'(?is).*?([^versions]\w+ru.exe).*', "https://www.win-rar.com/fileadmin/winrar-versions/winrar/winrar-x64$1") InetGet($winrar_down_link, "C:\Users\Public\Documents\winrar.exe", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Edited November 26, 2020 by UE_morf_boon Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now