Comparing version 2.0.2 to 2.0.3
24
index.js
@@ -60,6 +60,9 @@ const fetch = require("node-fetch"); | ||
let data = r[0].data.children[0].data; | ||
if (this.isImgurUpload(data.url_overridden_by_dest)) | ||
data.url_overridden_by_dest = this.getRawImgur( | ||
data.url_overridden_by_dest | ||
); | ||
console.log(data); | ||
try { | ||
if (this.isImgurUpload(data.url_overridden_by_dest)) | ||
data.url_overridden_by_dest = this.getRawImgur( | ||
data.url_overridden_by_dest | ||
); | ||
} catch {} | ||
let newdata = { | ||
@@ -77,6 +80,12 @@ title: data.title, | ||
return ( | ||
url.startsWith("https://www.imgur.com/gallery") || | ||
url.startsWith("https://imgur.com/gallery") | ||
url.startsWith("https://www.imgur.com/gallery/") || | ||
url.startsWith("https://imgur.com/gallery/") | ||
); | ||
} | ||
isImgurMultiUpload(url) { | ||
return ( | ||
url.startsWith("https://www.imgur.com/a/") || | ||
url.startsWith("https://imgur.com/a/") | ||
); | ||
} | ||
isImgurUpload(url) { | ||
@@ -86,3 +95,4 @@ return ( | ||
url.startsWith("https://www.imgur.com/")) && | ||
!this.isImgurGallery(url) | ||
!this.isImgurGallery(url) && | ||
!this.isImgurMultiUpload(url) | ||
); | ||
@@ -89,0 +99,0 @@ } |
{ | ||
"name": "trev", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Getting random nsfw images, hentai images and memes from reddit. Fast and tons of features supported.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,6 +7,4 @@ # Trev | ||
The list of methods is too long to mention but check subreddits.json for all the random nsfw images categories (accessible in this.nsfw) that represent each method. | ||
For support, join this discord server.: [https://discord.gg/PrVRHPh](https://discord.gg/PrVRHPh) | ||
Join this discord server for help: [https://discord.gg/PrVRHPh](https://discord.gg/PrVRHPh) | ||
## Full list of functions | ||
@@ -13,0 +11,0 @@ |
20244
696
45