Scoop
Scoop copied to clipboard
useragent in checkver should be used duing autoupdate
When providing useragent
in checkver
, that useragent is not used during autoupdate, nor for hash extraction, etc.
Fixed
It is still not used with autoupdate, is that something you can fix as well?
Can you provide an example?
I have below in my manifest, after adding useragent checkver
works as expected, but fails to get hash after taking a long time (roughly 90 seconds, this was the behavior with checkver before adding useragent). It could be our corporate network or the oracle website itself that needs this useragent set.
"checkver": {
"url": "https://www.oracle.com/database/sqldeveloper/technologies/download/",
"useragent": "Mozilla/5.0",
"re": "Version ([\\d\\.]+)"
},
"autoupdate": {
"url": "https://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-$version-x64.zip",
"hash": {
"url": "https://www.oracle.com/database/sqldeveloper/technologies/download/",
"find": "SHA1: ([^<]+)"
}
I was able to fix this issue for myself, and created this pull request.
are you able to review and approve it?
It will get reviewed
From @antonoks in #5586:
Feature Request
Add a global "useragent" key, which, if defined, overwrites what
https://github.com/ScoopInstaller/Scoop/blob/f93028001fbe5c78cc41f59e3814d2ac8e595724/lib/core.ps1#L26
returns
Is your feature request related to a problem? Please describe.
Some websites seem to ban"scoop". One of them is "filezilla-project.org". Sometimes manifests work around this ban and refer to other websites, see also the filezilla manifest. Seems like to address this kind of issue, "checkver" introduces the "useragent" key here . So now one can check if a new version is available based on "scoop banning sites", but still cannot "autoupdate" such manifests.
Describe the solution you'd like
I'd like to see an "useragent" root key in the manifests, which, if defined, overwrites all respective user agents everywhere in the scoop tools and manifests.
Describe alternatives you've considered
I thought about extending "autosupport" in the same way as commit 8feb386 extended "checkver", but then again I'm convinced a general "useragend" key would be the better solution.