add superfetch

This commit is contained in:
Ashley 2022-03-03 00:00:46 +03:00 committed by GitHub
parent acec59a9b7
commit 97c075a014

View file

@ -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,