mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 01:37:47 +01:00
add superfetch
This commit is contained in:
parent
acec59a9b7
commit
97c075a014
1 changed files with 10 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
WARNING:THIS FILE IS STILL ON WIP
|
|
||||||
Copyright (C) 2021-2022 POKETUBE CONTRUBUTORS (https://github.com/iamashley0/poketube)
|
Copyright (C) 2021-2022 POKETUBE CONTRUBUTORS (https://github.com/iamashley0/poketube)
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -15,8 +15,8 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see https://www.gnu.org/licenses/.
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fetch = require("node-fetch"); //2.5.x
|
const fetch = require("node-fetch"); //2.5.x
|
||||||
|
const superfetch = require("../src/modules/node-superfetch.js")
|
||||||
const lyricsFinder = require("lyrics-finder");
|
const lyricsFinder = require("lyrics-finder");
|
||||||
var youtube_url = `https://www.youtube.com/watch?v=`;
|
var youtube_url = `https://www.youtube.com/watch?v=`;
|
||||||
var dislike_api = `https://returnyoutubedislikeapi.com/votes?videoId=`
|
var dislike_api = `https://returnyoutubedislikeapi.com/votes?videoId=`
|
||||||
|
@ -28,7 +28,10 @@ module.exports = async function(video_id){
|
||||||
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) => res.json());
|
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) => res.json());
|
||||||
const dislikes = dislike.dislikes
|
const dislikes = dislike.dislikes
|
||||||
|
|
||||||
|
/*
|
||||||
|
This is a if else statment to check the lastest
|
||||||
|
format from the fetched url and return it lmao
|
||||||
|
*/
|
||||||
if(pro.formats[1].url){
|
if(pro.formats[1].url){
|
||||||
var url = pro.formats[1].url
|
var url = pro.formats[1].url
|
||||||
} else if(!pro.formats[1].url){
|
} else if(!pro.formats[1].url){
|
||||||
|
@ -37,8 +40,9 @@ module.exports = async function(video_id){
|
||||||
var url = lastItem.url
|
var url = lastItem.url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returner
|
* Returner object
|
||||||
*/
|
*/
|
||||||
const returner = {
|
const returner = {
|
||||||
video:pro,
|
video:pro,
|
||||||
|
|
Loading…
Reference in a new issue