remove some unneeded or broken downloads (closes #4)

This commit is contained in:
Ave
2023-02-07 23:10:52 -05:00
parent 5e57389ef9
commit b09c4c3bb3
4 changed files with 33 additions and 32 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
#msdl-ms-content, #msdl-ms-content,
#msdl-please-wait, #msdl-please-wait,
#msdl-processing-error, #msdl-processing-error,
#back-to-products { #back-to-products,
#use-shared-session {
display: none; display: none;
} }
-19
View File
@@ -29,26 +29,15 @@
"362": "Windows 10 1703 N", "362": "Windows 10 1703 N",
"363": "Windows 10 1703 Single Language", "363": "Windows 10 1703 Single Language",
"364": "Windows 10 1703 Home China", "364": "Windows 10 1703 Home China",
"388": "Windows Desktop App Converter Insider Preview",
"389": "Windows Desktop App Converter Insider Preview - 14393",
"390": "Windows Desktop App Converter Insider Preview - 15063",
"484": "Windows 10 1709", "484": "Windows 10 1709",
"485": "Windows 10 1709 Home China", "485": "Windows 10 1709 Home China",
"488": "Windows 10 Education 1709", "488": "Windows 10 Education 1709",
"489": "Media Feature Pack for N versions of Windows 10",
"490": "Windows Desktop App Converter Insider Preview",
"491": "Windows 10 IoT Core - Build 16299", "491": "Windows 10 IoT Core - Build 16299",
"493": "Windows Desktop App Converter Insider Preview - 16299",
"578": "Windows 10 IoT Core - Build 17110", "578": "Windows 10 IoT Core - Build 17110",
"590": "Windows 10 IoT Core - Build 17115", "590": "Windows 10 IoT Core - Build 17115",
"612": "Windows Desktop App Converter Base Image - 14393",
"613": "Windows Desktop App Converter Base Image -16299",
"614": "Windows Desktop App Converter Base Image - 15063",
"637": "Windows 10 1803", "637": "Windows 10 1803",
"638": "Windows 10 1803 Home China", "638": "Windows 10 1803 Home China",
"641": "Windows 10 Education 1803", "641": "Windows 10 Education 1803",
"642": "Media Feature - Version 1803 (April 2018)",
"643": "Windows Desktop App Converter Insider Preview",
"644": "Windows 10 IoT Core - Build 16299", "644": "Windows 10 IoT Core - Build 16299",
"651": "Windows 10 1803_1", "651": "Windows 10 1803_1",
"652": "Windows 10 1803_1 Home China", "652": "Windows 10 1803_1 Home China",
@@ -58,10 +47,8 @@
"1019": "Windows 10 1809", "1019": "Windows 10 1809",
"1020": "Windows 10 1809 Home China", "1020": "Windows 10 1809 Home China",
"1021": "Windows 10 Education 1809", "1021": "Windows 10 Education 1809",
"1022": "Media Feature - Version 1809 (October 2018)",
"1024": "Windows 10 IoT Core - Build 17763", "1024": "Windows 10 IoT Core - Build 17763",
"1056": "Windows 10 Education 1809 October", "1056": "Windows 10 Education 1809 October",
"1057": "Media Feature - Version 1809 (October 2018) October",
"1059": "Windows 10 IoT Core - Build 17763 October", "1059": "Windows 10 IoT Core - Build 17763 October",
"1060": "Windows 10 1809 October", "1060": "Windows 10 1809 October",
"1061": "Windows 10 1809 Home China October", "1061": "Windows 10 1809 Home China October",
@@ -72,15 +59,12 @@
"1214": "Windows 10 1903", "1214": "Windows 10 1903",
"1215": "Windows 10 1903 Home China", "1215": "Windows 10 1903 Home China",
"1216": "Windows 10 Education 1903", "1216": "Windows 10 Education 1903",
"1217": "Media Feature - Version 1903 (May 2019)",
"1218": "Windows Desktop App Converter Base Image - 18362",
"1384": "Windows 10 1903 V2", "1384": "Windows 10 1903 V2",
"1385": "Windows 10 1903 V2 Home China", "1385": "Windows 10 1903 V2 Home China",
"1386": "Windows 10 Education 1903 V2", "1386": "Windows 10 Education 1903 V2",
"1429": "Windows 10 1909", "1429": "Windows 10 1909",
"1430": "Windows 10 1909 Home China", "1430": "Windows 10 1909 Home China",
"1431": "Windows 10 Education 1909", "1431": "Windows 10 Education 1909",
"1460": "Media Feature - Version 1709 (October 2017)",
"1625": "Windows 10 Education 2004", "1625": "Windows 10 Education 2004",
"1626": "Windows 10 2004", "1626": "Windows 10 2004",
"1627": "Windows 10 2004 Home China", "1627": "Windows 10 2004 Home China",
@@ -93,7 +77,6 @@
"1882": "Windows 10 20H2 v2", "1882": "Windows 10 20H2 v2",
"1883": "Windows 10 20H2 v2 Home China", "1883": "Windows 10 20H2 v2 Home China",
"1884": "Windows 10 Education 20H2 v2", "1884": "Windows 10 Education 20H2 v2",
"1890": "Windows Desktop App Converter Base Image - 1803 - Redo",
"2032": "Windows 10 Education 21H1", "2032": "Windows 10 Education 21H1",
"2033": "Windows 10 21H1", "2033": "Windows 10 21H1",
"2034": "Windows 10 21H1 Home China", "2034": "Windows 10 21H1 Home China",
@@ -103,8 +86,6 @@
"2085": "Windows 10 21H2 Home China", "2085": "Windows 10 21H2 Home China",
"2093": "Windows 11 21H2 v1", "2093": "Windows 11 21H2 v1",
"2094": "Windows 11 21H2 v1 Home China", "2094": "Windows 11 21H2 v1 Home China",
"2360": "Windows 11 22H2",
"2361": "Windows 11 22H2 Home China",
"2370": "Windows 11 22H2 v1", "2370": "Windows 11 22H2 v1",
"2371": "Windows 11 22H2 v1 Home China", "2371": "Windows 11 22H2 v1 Home China",
"2377": "Windows 10 22H2", "2377": "Windows 10 22H2",
+6 -1
View File
@@ -63,7 +63,8 @@
<div id="msdl-processing-error"> <div id="msdl-processing-error">
<h2>Error</h2> <h2>Error</h2>
<p>An error has occurred while processing your request.</p> <p>An error has occurred while processing your request. Try clicking the use shared session button if reloading
the page does not work.</p>
</div> </div>
<div id="back-to-products"> <div id="back-to-products">
@@ -71,6 +72,10 @@
<button onClick="backToProducts();">Go back to the product list</button> <button onClick="backToProducts();">Go back to the product list</button>
</div> </div>
<div id="use-shared-session">
<button onClick="useSharedSession();">Use shared session (use if download keeps failing)</button>
</div>
<input id="msdl-session-id" type="hidden"> <input id="msdl-session-id" type="hidden">
</body> </body>
+25 -11
View File
@@ -1,5 +1,6 @@
const langsUrl = "https://www.microsoft.com/en-us/api/controls/contentinclude/html?pageId=cd06bda8-ff9c-4a6e-912a-b92a21f42526&host=www.microsoft.com&segments=software-download%2cwindows11&query=&action=getskuinformationbyproductedition&sdVersion=2"; const langsUrl = "https://www.microsoft.com/en-us/api/controls/contentinclude/html?pageId=cd06bda8-ff9c-4a6e-912a-b92a21f42526&host=www.microsoft.com&segments=software-download%2cwindows11&query=&action=getskuinformationbyproductedition&sdVersion=2";
const downUrl = "https://www.microsoft.com/en-us/api/controls/contentinclude/html?pageId=cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b&host=www.microsoft.com&segments=software-download%2Cwindows11&query=&action=GetProductDownloadLinksBySku&sdVersion=2"; const downUrl = "https://www.microsoft.com/en-us/api/controls/contentinclude/html?pageId=cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b&host=www.microsoft.com&segments=software-download%2Cwindows11&query=&action=GetProductDownloadLinksBySku&sdVersion=2";
const sessionUrl = "https://vlscppe.microsoft.com/fp/tags?org_id=y6jn8c31&session_id="
const sessionId = document.getElementById('msdl-session-id'); const sessionId = document.getElementById('msdl-session-id');
const msContent = document.getElementById('msdl-ms-content'); const msContent = document.getElementById('msdl-ms-content');
@@ -8,11 +9,16 @@ const processingError = document.getElementById('msdl-processing-error');
const productsList = document.getElementById('products-list'); const productsList = document.getElementById('products-list');
const backToProductsDiv = document.getElementById('back-to-products'); const backToProductsDiv = document.getElementById('back-to-products');
const useSharedSessionDiv = document.getElementById('use-shared-session');
const sharedSessionGUID = "47cbc254-4a79-4be6-9866-9c625eb20911";
var msdlXhr = new XMLHttpRequest(); var msdlXhr = new XMLHttpRequest();
var availableProducts = {}; var availableProducts = {};
var sharedSession = false;
function uuidv4() { function uuidv4() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
@@ -37,6 +43,7 @@ function checkForError(content) {
if (errorMessage) { if (errorMessage) {
processingError.style.display = "block"; processingError.style.display = "block";
useSharedSessionDiv.style.display = "block";
return true; return true;
} }
@@ -49,13 +56,15 @@ function updateContent(content, response) {
} }
function abortAndHide() { function abortAndHide() {
backToProductsDiv.style.display = 'none';
useSharedSessionDiv.style.display = 'none';
productsList.style.display = 'block';
msdlXhr.abort(); msdlXhr.abort();
msContent.style.display = 'none'; msContent.style.display = 'none';
pleaseWait.style.display = 'none'; pleaseWait.style.display = 'none';
processingError.style.display = 'none'; processingError.style.display = 'none';
window.location.hash = "";
} }
function fixSubmitSku() { function fixSubmitSku() {
@@ -100,8 +109,9 @@ function onDownloadsXhrChange() {
pleaseWait.style.display = "none"; pleaseWait.style.display = "none";
msContent.style.display = "block"; msContent.style.display = "block";
if (!updateContent(msContent, this.responseText)) if (updateContent(msContent, this.responseText) && !sharedSession) {
return; fetch(sessionUrl + sharedSessionGUID);
}
} }
function getLanguages(productId) { function getLanguages(productId) {
@@ -109,7 +119,7 @@ function getLanguages(productId) {
pleaseWait.style.display = "block"; pleaseWait.style.display = "block";
var url = langsUrl + "&productEditionId=" + encodeURIComponent(productId) + var url = langsUrl + "&productEditionId=" + encodeURIComponent(productId) +
"&sessionId=" + encodeURIComponent(sessionId.value); "&sessionId=" + (sharedSession ? sharedSessionGUID : sessionId.value);
msdlXhr.abort(); msdlXhr.abort();
msdlXhr.onreadystatechange = onLanguageXhrChange; msdlXhr.onreadystatechange = onLanguageXhrChange;
@@ -125,7 +135,7 @@ function getDownload() {
var url = downUrl + "&skuId=" + encodeURIComponent(id['id']) + var url = downUrl + "&skuId=" + encodeURIComponent(id['id']) +
"&language=" + encodeURIComponent(id['language']) + "&language=" + encodeURIComponent(id['language']) +
"&sessionId=" + encodeURIComponent(sessionId.value); "&sessionId=" + (sharedSession ? sharedSessionGUID : sessionId.value);
msdlXhr.abort(); msdlXhr.abort();
msdlXhr.onreadystatechange = onDownloadsXhrChange; msdlXhr.onreadystatechange = onDownloadsXhrChange;
@@ -135,20 +145,22 @@ function getDownload() {
function backToProducts() { function backToProducts() {
abortAndHide(); abortAndHide();
window.location.hash = "";
}
backToProductsDiv.style.display = 'none'; function useSharedSession() {
productsList.style.display = 'block'; sharedSession = true;
abortAndHide();
prepareDownload(window.location.hash.substring(1))
} }
function prepareDownload(id) { function prepareDownload(id) {
productsList.style.display = 'none'; productsList.style.display = 'none';
backToProductsDiv.style.display = 'block'; backToProductsDiv.style.display = 'block';
sessionId.value = uuidv4();
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => { getLanguages(id) }; xhr.onreadystatechange = () => { getLanguages(id) };
xhr.open("GET", "https://vlscppe.microsoft.com/fp/tags?org_id=y6jn8c31&session_id=" + sessionId.value, true); xhr.open("GET", sessionUrl + sessionId.value, true);
xhr.send(); xhr.send();
} }
@@ -232,6 +244,8 @@ xhr.onreadystatechange = function () {
preparePage(this.responseText); preparePage(this.responseText);
}; };
sessionId.value = uuidv4();
xhr.open("GET", 'data/products.json', true); xhr.open("GET", 'data/products.json', true);
xhr.send(); xhr.send();