@@ -128,7 +128,10 @@ RetryStart:
|
||||
'下载
|
||||
ActualSource = LoadingSource '显示加载中图片
|
||||
TempDownloadingPath = TempPath & RandomInteger(0, 10000000)
|
||||
NetDownload(Url, TempDownloadingPath, True)
|
||||
Directory.CreateDirectory(GetPathFromFullPath(TempPath))
|
||||
Using Client As New System.Net.WebClient
|
||||
Client.DownloadFile(Url, TempDownloadingPath)
|
||||
End Using
|
||||
If Url <> Source AndAlso Url <> FallbackSource Then
|
||||
'已经更换了地址
|
||||
File.Delete(TempDownloadingPath)
|
||||
|
||||
@@ -109,7 +109,9 @@ Friend Module ModSecret
|
||||
Client.Headers("User-Agent") = "PCL2/" & VersionStandardCode
|
||||
End If
|
||||
Client.Headers("Referer") = "http://" & VersionCode & ".pcl2.open.server/"
|
||||
Client.Headers("x-api-key") = CurseForgeAPIKey
|
||||
If Url.Contains("api.curseforge") Then
|
||||
Client.Headers("x-api-key") = CurseForgeAPIKey
|
||||
End If
|
||||
End Sub
|
||||
''' <summary>
|
||||
''' 设置 Headers 的 UA、Referer。
|
||||
@@ -123,7 +125,9 @@ Friend Module ModSecret
|
||||
Request.UserAgent = "PCL2/" & VersionStandardCode
|
||||
End If
|
||||
Request.Referer = "http://" & VersionCode & ".pcl2.open.server/"
|
||||
Request.Headers("x-api-key") = CurseForgeAPIKey
|
||||
If Url.Contains("api.curseforge") Then
|
||||
Request.Headers("x-api-key") = CurseForgeAPIKey
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Reference in New Issue
Block a user