|
|
@@ -1,4 +1,6 @@ |
|
|
|
import os |
|
|
|
import json |
|
|
|
import random |
|
|
|
import discord |
|
|
|
from discord.ext import commands |
|
|
|
from discord.ext.commands import bot |
|
|
@@ -140,17 +142,16 @@ class Util(): |
|
|
|
Uploads selected file to the host, thanks to the fact that |
|
|
|
every pomf.se based site has pretty much the same architecture. |
|
|
|
""" |
|
|
|
# Fucking broke because uploading is impossible whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy |
|
|
|
sites = [ |
|
|
|
"https://comfy.moe/", |
|
|
|
"https://mixtape.moe/", |
|
|
|
"https://doko.moe/", |
|
|
|
#"https://pomfe.co/", |
|
|
|
#"https://pomf.space/", |
|
|
|
##"https://pomfe.co/", |
|
|
|
##"https://pomf.space/", |
|
|
|
"https://vidga.me/", |
|
|
|
"https://pomf.pyonpyon.moe/" |
|
|
|
] # List of pomf clone sites and upload limits |
|
|
|
"""if ctx.message.attachments: |
|
|
|
if ctx.message.attachments: |
|
|
|
# Site choice, shouldn't need an upload size check since max upload for discord atm is 50MB |
|
|
|
site = random.choice(sites) |
|
|
|
urls = [] |
|
|
@@ -160,17 +161,15 @@ class Util(): |
|
|
|
name = attachment.url.split("/")[-1] |
|
|
|
# Download File |
|
|
|
await roxbot.http.download_file(attachment.url, name) |
|
|
|
# Upload file |
|
|
|
#with open(name, 'rb') as f: |
|
|
|
# answer = requests.post(url=site + "upload.php", files={'files[]': (name, f.read())}) |
|
|
|
#response = answer.json() |
|
|
|
|
|
|
|
response = await roxbot.http.upload_file(site+"upload.php", name) |
|
|
|
file_name_1 = response["files"][0]["url"].replace("\\", "") |
|
|
|
urls.append(file_name_1) |
|
|
|
os.remove(name) |
|
|
|
msg = "".join(urls) |
|
|
|
return await ctx.send(msg) |
|
|
|
else: |
|
|
|
return await ctx.send("Send me stuff to upload.")""" |
|
|
|
return await ctx.send("Send me stuff to upload.") |
|
|
|
|
|
|
|
@upload.error |
|
|
|
async def upload_err(self, ctx, error): |