Skip to content
This repository was archived by the owner on Mar 25, 2023. It is now read-only.

Commit 3d2d3c2

Browse files
committed
[NSFW] fix
1 parent 4dfffa3 commit 3d2d3c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/NSFW.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def getPostList(msg,sitetype,tags):
8181
postList = requests.get("https://danbooru.donmai.us/posts.json?limit=100&tags="+tags).text
8282
loaded = json.loads(postList)
8383
for i in loaded:
84-
if not exists(i,"id") or i["is_banned"] == True:
84+
if not exists(i,"id") or i["is_banned"] == True or not ("file_url" in i):
8585
continue #Posts without an ID? probably account requirements
8686
postInfo = {}
8787
postInfo["postPage"] = "https://danbooru.donmai.us/posts/"+str(i["id"])
@@ -106,7 +106,7 @@ async def nsfwScrape(msg,args,sitetype): #I spent hours on this and idk if i sho
106106
try:
107107
postList = await getPostList(msg,sitetype,"+".join(args[1:])) #HTTP Requests, therefore try: it
108108
except Exception as exc:
109-
log(f"[NSFW] {sitetype} GetPosts Exception: "+str(exc))
109+
log(f"[NSFW] {sitetype} GetPosts Exception: {exc}\n{traceback.format_exc()}")
110110
await msg.channel.send(embed=fromdict({"title":"Unexpected Error","description":"Something unexpected went wrong, hopefully it wont happen again","color":colours["error"]}),delete_after=10)
111111
return
112112
if postList:

0 commit comments

Comments
 (0)