Update profile.js

This commit is contained in:
2025-05-03 18:32:39 +05:00
committed by GitHub
parent 120b43694a
commit c00a5f3eeb

View File

@@ -3,15 +3,29 @@ const axios = require('axios');
// Функция для запроса профиля Anixart
async function getProfileFromAnixart(profileId, token = '') {
const url = `https://api.anixart.tv/profile/${profileId}${token ? `?token=${token}` : ''}`;
try {
const response = await axios.get(url);
const data = response.data;
// Здесь можно модифицировать структуру данных, если нужно
// По умолчанию флаг is_verified — false
data.is_verified = false;
// Проверка, есть ли ID в списке verified
const verifiedResponse = await axios.get('https://anixart.seele.su/api/is_verified');
const verifiedList = verifiedResponse.data;
if (Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) {
data.is_verified = true;
}
return data;
} catch (error) {
console.error("Ошибка при запросе профиля Anixart:", error.message);
throw new Error("Ошибка при получении данных профиля из Anixart API");
} catch {
return {
code: 2,
profile: null,
is_my_profile: false
};
}
}