diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 033cabb5..45f9df12 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -63,7 +63,7 @@ class PokeTubeCore { * @param {string} v - Video ID. * @returns {Promise} Promise resolving to the video information. */ - async video(v) { + async video(v, contentlang, contentregion) { const { fetch } = await import("undici"); @@ -79,8 +79,8 @@ class PokeTubeCore { try { const [invComments, videoInfo, videoData] = await Promise.all([ - fetch(`${this.config.invapi}/comments/${v}?${this.language}`).then((res) => res.text()), - fetch(`${this.config.invapi}/videos/${v}`).then((res) => res.text()), + fetch(`${this.config.invapi}/comments/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()), + fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()), curly .get(`${this.config.tubeApi}video?v=${v}`, { httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`),