Create profile.js

This commit is contained in:
2025-05-03 18:14:27 +05:00
committed by GitHub
parent 79463a25dd
commit 354f4b2e74

18
api/v1/src/profile.js Normal file
View File

@@ -0,0 +1,18 @@
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;
// Здесь можно модифицировать структуру данных, если нужно
return data;
} catch (error) {
console.error("Ошибка при запросе профиля Anixart:", error.message);
throw new Error("Ошибка при получении данных профиля из Anixart API");
}
}
module.exports = { getProfileFromAnixart };