refactor: variable names

This commit is contained in:
ihatespawn 2024-05-31 17:55:43 +02:00
parent e88f2dc8e2
commit ae04bc032b

View File

@ -1,7 +1,7 @@
import { genericUserAgent } from "../../config.js"; import { genericUserAgent } from "../../config.js";
export default async function({ id }) { export default async function({ id }) {
const req = await fetch(`https://odysee.com/${id}`, { const requestText = await fetch(`https://odysee.com/${id}`, {
method: "GET", method: "GET",
headers: { headers: {
"user-agent": genericUserAgent "user-agent": genericUserAgent
@ -11,8 +11,8 @@ export default async function({ id }) {
.catch(() => {}); .catch(() => {});
// i couldn't find any other way to do this // i couldn't find any other way to do this
var reqlines = req.split('\n'); var requestLines = requestText.split('\n');
var contentline = reqlines[reqlines.length - 32]; var contentline = requestLines[reqlines.length - 32];
var videoUrl = contentline.split('"')[3]; var videoUrl = contentline.split('"')[3];
if (videoUrl?.includes('.mp4')) { if (videoUrl?.includes('.mp4')) {