diff --git a/api/v1/src/profile.js b/api/v1/src/profile.js index e53db54..eeb0f0b 100644 --- a/api/v1/src/profile.js +++ b/api/v1/src/profile.js @@ -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 + }; } }