rsshub
Version:
Make RSS Great Again!
60 lines (57 loc) • 2.2 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import path from "node:path";
//#region lib/routes/themoviedb/api-key.ts
const KEYS = [
"fb7bb23f03b6994dafc674c074d01761",
"e55425032d3d0f371fc776f302e7c09b",
"8301a21598f8b45668d5711a814f01f6",
"8cf43ad9c085135b9479ad5cf6bbcbda",
"da63548086e399ffc910fbc08526df05",
"13e53ff644a8bd4ba37b3e1044ad24f3",
"269890f657dddf4635473cf4cf456576",
"a2f888b27315e62e471b2d587048f32e",
"8476a7ab80ad76f0936744df0430e67c",
"5622cafbfe8f8cfe358a29c53e19bba0",
"ae4bd1b6fce2a5648671bfc171d15ba4",
"257654f35e3dff105574f97fb4b97035",
"2f4038e83265214a0dcd6ec2eb3276f5",
"9e43f45f94705cc8e1d5a0400d19a7b7",
"af6887753365e14160254ac7f4345dd2",
"06f10fc8741a672af455421c239a1ffc",
"fb7bb23f03b6994dafc674c074d01761",
"09ad8ace66eec34302943272db0e8d2c"
];
const keys = () => KEYS[Math.floor(Math.random() * KEYS.length)];
var api_key_default = keys;
//#endregion
//#region lib/routes/themoviedb/utils.ts
init_esm_shims();
const handleDescription = (item) => {
const poster_path = item.poster_path ?? item.still_path;
return art(path.join(__dirname, "templates/description-b490ca62.art"), {
poster: poster_path ? `https://image.tmdb.org/t/p/original${poster_path}` : null,
description: item.overview.trim(),
vote_average: item.vote_average,
vote_count: item.vote_count
});
};
const handleMovieItem = (item, lang) => ({
title: lang ? item.title : item.original_title,
link: `https://www.themoviedb.org/movie/${item.id}`,
description: handleDescription(item),
pubDate: item.release_date ? parseDate(item.release_date) : void 0
});
const handleTVShowItem = (item, lang) => ({
title: lang ? item.name : item.original_name,
link: `https://www.themoviedb.org/tv/${item.id}`,
description: handleDescription(item),
pubDate: item.first_air_date ? parseDate(item.first_air_date) : void 0
});
const MEDIA_TYPE_TO_ITEM_HANDLE = {
tv: handleTVShowItem,
movie: handleMovieItem
};
//#endregion
export { api_key_default as i, handleDescription as n, handleMovieItem as r, MEDIA_TYPE_TO_ITEM_HANDLE as t };