diff --git a/generate-playlists-stats.mjs b/generate-playlists-stats.mjs index 953e127b..2b5e125b 100644 --- a/generate-playlists-stats.mjs +++ b/generate-playlists-stats.mjs @@ -5,14 +5,14 @@ import { resolve as resolvePath } from "path"; // Download from // https://studio.youtube.com/channel/UCG0N7IV-C43AM9psxslejCQ/analytics/tab-content/period-default/explore?entity_type=CHANNEL&entity_id=UCG0N7IV-C43AM9psxslejCQ&r_dimensions=IN_CURATED_CONTENT&r_values=%27IN_CURATED_CONTENT%27&r_inclusive_starts=&r_exclusive_ends=&time_period=4_weeks&explore_type=TABLE_AND_CHART&metric=VIEWS&granularity=DAY&t_metrics=VIEWS&t_metrics=WATCH_TIME&dimension=PLAYLIST&o_column=VIEWS&o_direction=ANALYTICS_ORDER_DIRECTION_DESC const csvFilePath = 'Informations relatives aux tableaux.csv'; -const basePicturesPath = "D:/workspace/yt_gaming_library/public" +const basePicturesPath = "./public" const outputFilePath = 'playlists_stats.json'; // First line are headers, second a total summary const numberOfHeaders = 2; // Functions -const generateImagePath = (playlistId) => `${basePicturesPath}/covers/${playlistId}/cover.webp`; +const generateImagePath = (playlistId) => resolvePath(`${basePicturesPath}/covers/${playlistId}/cover.webp`); async function readCSV(filePath) { const data = await readFile(filePath, 'utf8');