Add uncanny, detect filename from image link

This commit is contained in:
Essem 2022-07-30 16:00:09 -05:00
parent e9a9680a7d
commit f3eea0d96a
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
18 changed files with 183 additions and 2 deletions

View file

@ -38,9 +38,12 @@ const videoFormats = ["video/mp4", "video/webm", "video/mov"];
// gets the proper image paths
const getImage = async (image, image2, video, extraReturnTypes, gifv = false, type = null, link = false) => {
try {
const fileNameSplit = new URL(image).pathname.split("/");
const fileName = fileNameSplit[fileNameSplit.length - 1].split(".")[0];
const payload = {
url: image2,
path: image
path: image,
name: fileName
};
const host = new URL(image2).host;
if (gifv || (link && combined.includes(host))) {