mirror of
https://github.com/Viren070/tmdb-addon.git
synced 2025-12-01 23:18:11 +01:00
14 lines
402 B
JavaScript
14 lines
402 B
JavaScript
const axios = require('axios');
|
|
|
|
async function getImdbRating(imdbId, type) {
|
|
try {
|
|
const response = await axios.get(`https://v3-cinemeta.strem.io/meta/${type}/${imdbId}.json`);
|
|
const data = response.data.meta;
|
|
return data?.imdbRating || undefined
|
|
} catch (error) {
|
|
console.error('Erro ao obter dados do Cinemeta:', error);
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
module.exports = { getImdbRating } |