Skip to content

Commit

Permalink
let's see
Browse files Browse the repository at this point in the history
  • Loading branch information
prono69 committed Sep 19, 2024
1 parent cd48200 commit 81d6f32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
23 changes: 15 additions & 8 deletions userbot/helpers/nsfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,28 @@
"checker": "url",
},
"v8": {
"end": ["fingering", "lesbian", "pussy", "fuck"],
"api": "https://api.maher-zubair.tech/nsfw/",
"end": ["hboobs", "gonewild", "tentacle", "paizuri", "hthigh", "hmidriff", "pgif", "hkitsune"],
"api": "https://api.night-api.com/images/nsfw/",
"headers": {"Authorization": "s0cOd5GB0T-zqEzmtbN9E2KQdEDHizc-8wRsLtIscp"},
"checker": "url",
},
}


def nekos(endpoint=None, endpoints=endpoints):
if endpoint:
for i in endpoints:
if endpoint in endpoints[i]["end"]:
api = endpoints[i]["api"]
checker = endpoints[i]["checker"]
result = requests.get(api + endpoint).json()
return result[checker]
for version, details in endpoints.items():
if endpoint in details["end"]:
api = details["api"]
headers = details.get("headers", {})
checker = details["checker"]
result = requests.get(api + endpoint, headers=headers).json()
if checker in result:
return result[checker]
elif "content" in result and "url" in result["content"]:
return result["content"]["url"]
else:
raise ValueError(f"Unexpected response format: {result}")
return (
endpoints["v1"]["end"]
+ endpoints["v2"]["end"]
Expand Down
7 changes: 3 additions & 4 deletions userbot/plugins/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,16 @@ async def search_func(event):
filepath = inspect.getfile(source)
caption = f"**Source:** `{filepath}`"
text = inspect.getsource(source)

await catevent.delete()
if len(text) > 4096:
with open(filename, "w") as f:
f.write(text)
await catub.send_file(
await catub.send_file(
event.chat_id,
filename,
caption=caption,
allow_cache=False,
reply_to=event.message.reply_to_msg_id,
)
os.remove(filename)
await edit_or_reply(event, f"{caption} \n\n**OUTPUT:**\n`{text}`")
return await catevent.delete()
await catevent.edit(f"{caption} \n\n**OUTPUT:**\n`{text}`")

0 comments on commit 81d6f32

Please sign in to comment.