mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 09:48:06 +01:00
remove unnecesary require()s
This commit is contained in:
parent
5445611e89
commit
f2096ad08d
1 changed files with 3 additions and 6 deletions
|
@ -12,20 +12,18 @@ const renderTemplate = async (res, req, template, data = {}) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ytSearch = require('youtube-search');
|
const search = require('youtube-search');
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
app.get("/watch", function(req, res) {
|
app.get("/watch", function(req, res) {
|
||||||
var url = req.query.v;
|
var url = req.query.v;
|
||||||
var uu = `https://www.youtube.com/watch?v=${url}`;
|
var uu = `https://www.youtube.com/watch?v=${url}`;
|
||||||
var search = require("youtube-search");
|
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
maxResults: 1,
|
maxResults: 1,
|
||||||
key: process.env.yt
|
key: process.env.yt
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetch = require("node-fetch");
|
|
||||||
search(uu, opts, function(err, results) {
|
search(uu, opts, function(err, results) {
|
||||||
var i = results[0].id;
|
var i = results[0].id;
|
||||||
fetch(`https://yt-proxy-api.herokuapp.com/get_player_info?v=${i}`)
|
fetch(`https://yt-proxy-api.herokuapp.com/get_player_info?v=${i}`)
|
||||||
|
@ -64,8 +62,7 @@ if(err) return
|
||||||
|
|
||||||
|
|
||||||
app.get('/youtube/ara', async (req, res) => {
|
app.get('/youtube/ara', async (req, res) => {
|
||||||
var url = req.query.query;
|
var url = req.query.query;
|
||||||
var search = require("youtube-search");
|
|
||||||
|
|
||||||
if (!req.query.query) {
|
if (!req.query.query) {
|
||||||
return res.redirect(`/`);
|
return res.redirect(`/`);
|
||||||
|
|
Loading…
Reference in a new issue