Before the Quixel Store closes, I would like to download my models.
I cobbled together this initial script just to see how far I'd get:
const axios = require('axios');
const APP_ID = 'copied from quixel website';
const APP_KEY = 'copied from quixel website';
const USERNAME = 'tried all of the 4 options from below';
async function authenticate() {
try {
const response = await axios.post(AUTH_URL, {
secret: APP_KEY
}, {
auth: {
username: USERNAME,
password: ''
},
headers: {
'Content-Type': 'application/json'
}
});
const { token, refreshToken } = response.data;
console.log("Authentication Token:", token);
console.log("Refresh Token:", refreshToken);
return token;
} catch (error) {
if (error.response) {
console.error('Error Response:', error.response.data);
console.error('Error Status:', error.response.status);
console.error('Error Headers:', error.response.headers);
} else if (error.request) {
console.error('Error Request:', error.request);
} else {
console.error('Error Message:', error.message);
}
console.error('Error Config:', error.config);
}
}
authenticate();
Unfortunately I get a 401 error running the javascript file via npm.
When running this directly in the Chrome Devtools while having the quixel site open:
console.log(document.cookie)
actually retrieves the token, so the API has to be working.
Which means that my credentials have to be wrong.
As app key and app id are easily retrievable from the megascans page, I fear I do not get the username correctly.
I registered to Quixel even before it merged with Epic, so I have 4 different potential options for the username(as seen in the attached images):
- my epicgames account has two options: a "user-randomnumber", which is the display name, or the mail I use for the Epicgames Store, "MyNewMail@web.de"
- my quixel account has "MyOldMail@web.de"
- the unrealengine account shows the "user-randomnumber"
- the unrealengine forums shows "FirstletterOfMyNameFullLastName"
But although I tried all combinations, I can not find why it is not working at all.
I am a bit bummed out to fail at even logging in...
Is there someone who can help me spot the obvious? This cant be so hard, can it?
Is this even the correct spot to post? I think there are some Quixel members floating around here, no?
Is there a better place, perhaps the Unreal Engine forums? I have not seen a "Quixel Support" anywhere...
Replies
I am happy to help as far as I can:
1.) The login combination was what I referred to as "MyOldMail@web.de", which is the name displayed in the Quixel account on the upper left quadrant, and the Quixel Account login. This could be different from your Epicgames password (at least it was for me).
You can log out, go to the login page and on the lower half, where you can log into you quixel account (not the epic account), you can reset your password to be sure what you need to input.
I think its working in the browser console for you, because you are already logged in and you get the token from the cookie?
(I really dont know what I am talking about here!)
2.) I have been bothering a dude from Quixel's support for about a week now, I am currently awaiting his response to exactly the same question about the refresh tokens. I think the approach I will take, if I can not get them to work, is that I will just request a new token before each download.
P.S.: I am also already in talks with Quixel about the EULA.
https://www.unrealengine.com/en-US/eula/content
As far as I can see sharing this script is not legal up to this point.
See "c. General Restrictions".
But I will keep you all updated with the response