Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't download URLs that require special headers, eg. audacity-lame #18

Open
laggingreflex opened this issue Feb 16, 2018 · 0 comments
Open

Comments

@laggingreflex
Copy link

laggingreflex commented Feb 16, 2018

I get this error when downloading audacity-lame

Reading package 'audacity-lame'
package URL: 'https://chocolatey.org/api/v2/package/audacity-lame/3.99.3.20171217'
Downloading: audacity-lame.3.99.3.20171217.nupkg
Download Failed: https://lame.buanzo.org/Lame_v3.99.3_for_Windows.exe
System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.GetResponse()
   at ChocolateStore.PackageCacher.DownloadFile(String url, String destination) in C:\...\ChocolateStore\src\ChocolateStore\PackageCacher.cs:line 83
Downloading:
Download Failed: https://lame.buanzo.org/
System.UnauthorizedAccessException: Access to the path 'D:\...\source\audacity-lame' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at ChocolateStore.PackageCacher.DownloadFile(String url, String destination) in C:\...\ChocolateStore\src\ChocolateStore\PackageCacher.cs:line 94

It seems like it requires some headers to be acquired from their homepage before downloading the installer otherwise it results in a 403. This seems to be specified in it's install file:

chocolateyInstall.ps1

$options =
@{
  Headers = @{
    Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
    Referer = 'https://lame.buanzo.org/';
  }
}

When installing directly there's an error at first but it tries again and downloads correctly

Installing the following packages:
audacity-lame
By installing you accept licenses for the packages.
Progress: Downloading audacity-lame 3.99.3.20171217... 100%

audacity-lame v3.99.3.20171217 [Approved]
audacity-lame package files install completed. Performing other installation steps.
Attempt to get headers for https://lame.buanzo.org/Lame_v3.99.3_for_Windows.exe failed.
  The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://lame.buanzo.org/Lame_v3.99.3_for_Windows.exe'. Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
Downloading audacity-lame
  from 'https://lame.buanzo.org/Lame_v3.99.3_for_Windows.exe'
Progress: 100% - Completed download of C:\Users\x\AppData\Local\Temp\chocolatey\audacity-lame\3.99.3.20171217\audacity-lameInstall.EXE (515.06 KB).
Download of audacity-lameInstall.EXE (515.06 KB) completed.
Hashes match.
Installing audacity-lame...
audacity-lame has been installed.
  audacity-lame can be automatically uninstalled.
 The install of audacity-lame was successful.
  Software installed to 'C:\Program Files (x86)\Lame For Audacity\'
@laggingreflex laggingreflex changed the title Can't download audacity-lame Can't download URLs that require special headers, eg. audacity-lame Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant