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 profileData = response.data; let isVerified = false; // Проверка верификации try { const verifiedResponse = await axios.get('https://anixart.seele.su/api/is_verified'); const verifiedList = verifiedResponse.data; if (Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) { isVerified = true; profileData.profile.is_verified = true; } } catch { // Ошибку верификации игнорируем } // Подгружаем кастомные роли try { const rolesResponse = await axios.get('https://anixart.seele.su/api/is_roles'); const rolesList = rolesResponse.data; const userRoles = rolesList.find(entry => entry.id === Number(profileId)); if (userRoles && Array.isArray(userRoles.roles)) { profileData.profile.roles = userRoles.roles; } } catch { // Ошибку загрузки ролей игнорируем } // // Тестовое поле privilege_level (можно отключить) // profileData.profile.privilege_level = 0; profileData.profile.avatar = "https://giffiles.alphacoders.com/170/170278.gif"; profileData.profile.is_sponsor = true; profileData.profile.is_sponsor_transferred = true; profileData.profile.rating_score = 10000; profileData.profile.plan_count = 9999999; profileData.profile.completed_count = 9999999; profileData.profile.hold_on_count = 9999999; profileData.profile.favorite_count = 9999999; profileData.profile.watching_count = 9999999; profileData.profile.dropped_count = 9999999; return { ...profileData, is_verified: isVerified, }; } catch { return { code: 2, profile: null, is_my_profile: false, }; } } module.exports = { getProfileFromAnixart };