<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=17073</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17073&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Не скачивает файл Беру url (файла) из файла txt на сервере».]]></description>
		<lastBuildDate>Mon, 25 Apr 2022 12:26:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=152840#p152840</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Должно брать ссылку из файла https://raw.githubusercontent.com/Agressorx1/efttorg/main/file.txt<br />и потом из той ссылки из файла происходит скачивание.</p>]]></description>
			<author><![CDATA[null@example.com (Shamankingx)]]></author>
			<pubDate>Mon, 25 Apr 2022 12:26:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=152840#p152840</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=152839#p152839</link>
			<description><![CDATA[<div class="quotebox"><cite>Shamankingx пишет:</cite><blockquote><div class="codebox"><pre><code>url = https://cdn.filesend.jp%Variable%
msgbox, % url -----------Вывод ссылки на файл и она правильная</code></pre></div></blockquote></div><p>Нет, не правильная, смотрите внимательно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 25 Apr 2022 11:31:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=152839#p152839</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=152838#p152838</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />вот реальная ссылка https://raw.githubusercontent.com/Agressorx1/efttorg/main/file.txt</p>]]></description>
			<author><![CDATA[null@example.com (Shamankingx)]]></author>
			<pubDate>Mon, 25 Apr 2022 10:53:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=152838#p152838</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=152833#p152833</link>
			<description><![CDATA[<p>Мало что понятно. Во всяком случае, без реальной ссылки.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 25 Apr 2022 10:25:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=152833#p152833</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Не скачивает файл Беру url (файла) из файла txt на сервере]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=152831#p152831</link>
			<description><![CDATA[<p>Я беру ссылку из файла на сервере .<br />В переменной&nbsp; Variable в msgbox появляется нужна и правильная ссылка ,но появляется process bar скачивая и сразу закрывается скачивание не начинается.<br /></p><div class="codebox"><pre><code>
#SingleInstance,Force
url=https://raw.githubusercontent.com/Agressorx1/efttorg/main/file.txt----------Пример ссылки
Gui,Add,Edit,w800 h500 -Wrap,% URLDownloadToVar(url)
URLDownloadToVar(url){
	hObject:=ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
	hObject.Open(&quot;GET&quot;,url)
	hObject.Send()
	return hObject.ResponseText
}
variable:=% URLDownloadToVar(url) 
url = % variable
msgbox, % url -----------Вывод ссылки на файл и она правильная ,но скачивание нету
SplitPath,url,name, dir, ext, name_no_ext, drive
DownloadAs := &quot;C:\Windows\SysWOW64\downlevel\lodsh\edit\&quot; . name
	Overwrite      := True
	UseProgressBar := True
	DownloadFile(Url, DownloadAs, Overwrite, UseProgressBar)
return
;=================== Start Functions =====================================================================

DownloadFile(UrlToFile, SaveFileAs, Overwrite := True, UseProgressBar := True) {
    ;Check if the file already exists and if we must not overwrite it
      If (!Overwrite &amp;&amp; FileExist(SaveFileAs))
          Return
    ;Check if the user wants a progressbar
      If (UseProgressBar) {
          ;Initialize the WinHttpRequest Object
            WebRequest := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
          ;Download the headers
            WebRequest.Open(&quot;HEAD&quot;, UrlToFile)
            WebRequest.Send()
          ;Store the header which holds the file size in a variable:
            FinalSize := WebRequest.GetResponseHeader(&quot;Content-Length&quot;)
          ;Create the progressbar and the timer
		 Progress, H80 Cb018AF3, , Downloading..., %UrlToFile%
            SetTimer, __UpdateProgressBar, 100
      }
    ;Download the file
      UrlDownloadToFile, %UrlToFile%, %SaveFileAs%
    ;Remove the timer and the progressbar because the download has finished
      If (UseProgressBar) {
          Progress, Off
          SetTimer, __UpdateProgressBar, Off
      }
    Return

    ;The label that updates the progressbar
      __UpdateProgressBar:
          ;Get the current filesize and tick
            CurrentSize := FileOpen(SaveFileAs, &quot;r&quot;).Length ;FileGetSize wouldn&#039;t return reliable results
            CurrentSizeTick := A_TickCount
          ;Calculate the downloadspeed
            Speed := Round((CurrentSize/1024-LastSize/1024)/((CurrentSizeTick-LastSizeTick)/1000)) . &quot; Kb/s&quot;
          ;Save the current filesize and tick for the next time
            LastSizeTick := CurrentSizeTick
            LastSize := FileOpen(SaveFileAs, &quot;r&quot;).Length
          ;Calculate percent done
            PercentDone := Round(CurrentSize/FinalSize*100)
          ;Update the ProgressBar
            Progress, %PercentDone%, %PercentDone%`% Готовность, Подготовка к запуску, Подготовка к запуску (%PercentDone%`%)
      Return
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Shamankingx)]]></author>
			<pubDate>Mon, 25 Apr 2022 06:11:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=152831#p152831</guid>
		</item>
	</channel>
</rss>
