Merge pull request #23 from uup-dump-dev/master

1.36.0
This commit is contained in:
eraseyourknees 2022-09-07 01:55:04 +02:00 committed by GitHub
commit 980863c20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 5 deletions

View File

@ -329,7 +329,7 @@ function uupGetFiles(
$filesNew = array();
foreach($filesInfoKeys as $val) {
$filesNew[$val] = $filesInfoList[$val];
$filesNew[$val]['url'] = str_replace('http://tlu.dl.delivery.mp.microsoft.com', 'https://uupdump.sf.tlu.dl.delivery.mp.microsoft.com', $filesInfoList[$val]['url']);
$filesNew[$val]['url'] = uupApiFixDownloadLink($filesInfoList[$val]['url']);
}
$files = $filesNew;

View File

@ -82,7 +82,7 @@ Parameters:
- **Supported values:** any update UUID
#### updateinfo.php: `uupUpdateInfo($updateId, $onlyInfo);`
#### updateinfo.php: `uupUpdateInfo($updateId, $onlyInfo, $ignoreFiles);`
Outputs specified information of specified `updateId`.
Parameters:
@ -92,12 +92,36 @@ Parameters:
- `onlyInfo` - Key to output
- **Supported values:** any string
- `ignoreFiles` - Skips the `files` key in the output
- **Supported values:** `true` or `false`
#### shared/main.php: `uupApiVersion();`
Returns version of the API.
Parameters:
- None
#### shared/utils.php: `uupApiCheckUpdateId($updateId);`
Checks if the provided update ID is correctly formatted.
Parameters:
- `updateId` - update ID to check
- **Supported values:** Any string
#### shared/utils.php: `uupApiIsServer($skuId);`
Checks if the provided SKU ID is a Windows Sever SKU.
Parameters:
- `skuId` - SKU ID to check
- **Supported values:** Any integer
#### shared/utils.php: `uupApiBuildMajor($build);`
Returns a build major of the build number.
Parameters:
- `build` - Build number (for example 22621.1) to split
- **Supported values:** Any correctly formatted build number
### Error codes thrown by API
**fetchupd.php**
- UNKNOWN_ARCH

View File

@ -16,7 +16,7 @@ limitations under the License.
*/
function uupApiVersion() {
return '1.35.0';
return '1.36.0';
}
require_once dirname(__FILE__).'/auths.php';

View File

@ -64,6 +64,8 @@ function sendWuPostRequest($url, $postData) {
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($req, CURLOPT_ENCODING, '');
curl_setopt($req, CURLOPT_POSTFIELDS, $postData);
curl_setopt($req, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($req, CURLOPT_TIMEOUT, 15);
curl_setopt($req, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($req, CURLOPT_HTTPHEADER, array(
'User-Agent: Windows-Update-Agent/10.0.10011.16384 Client-Protocol/2.50',
@ -145,8 +147,22 @@ function uupApiIsServer($skuId) {
}
function uupApiBuildMajor($build) {
if(!str_contains($build, '.')) {
if($build == null)
return null;
if(!str_contains($build, '.'))
return intval($build);
}
return intval(explode('.', $build)[0]);
}
function uupApiFixDownloadLink($link) {
if($link == null)
return null;
return str_replace(
'http://tlu.dl.delivery.mp.microsoft.com',
'https://uupdump.sf.tlu.dl.delivery.mp.microsoft.com',
$link
);
}