mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 17:57:52 +01:00
add Region settings :3
This commit is contained in:
parent
87bdb45f0e
commit
c7a2c08bbb
1 changed files with 3 additions and 3 deletions
|
@ -63,7 +63,7 @@ class PokeTubeCore {
|
||||||
* @param {string} v - Video ID.
|
* @param {string} v - Video ID.
|
||||||
* @returns {Promise<object>} Promise resolving to the video information.
|
* @returns {Promise<object>} Promise resolving to the video information.
|
||||||
*/
|
*/
|
||||||
async video(v) {
|
async video(v, contentlang, contentregion) {
|
||||||
|
|
||||||
const { fetch } = await import("undici");
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ class PokeTubeCore {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [invComments, videoInfo, videoData] = await Promise.all([
|
const [invComments, videoInfo, videoData] = await Promise.all([
|
||||||
fetch(`${this.config.invapi}/comments/${v}?${this.language}`).then((res) => res.text()),
|
fetch(`${this.config.invapi}/comments/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()),
|
||||||
fetch(`${this.config.invapi}/videos/${v}`).then((res) => res.text()),
|
fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}`).then((res) => res.text()),
|
||||||
curly
|
curly
|
||||||
.get(`${this.config.tubeApi}video?v=${v}`, {
|
.get(`${this.config.tubeApi}video?v=${v}`, {
|
||||||
httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`),
|
httpHeader: Object.entries(headers).map(([k, v]) => `${k}: ${v}`),
|
||||||
|
|
Loading…
Reference in a new issue