Add uncanny, detect filename from image link
This commit is contained in:
parent
e9a9680a7d
commit
f3eea0d96a
18 changed files with 183 additions and 2 deletions
|
@ -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))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue