shhhh
This commit is contained in:
@@ -23,6 +23,8 @@ logger.addHandler(ch)
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||||
|
pixelget_token = os.getenv('PIXELGET_TOKEN')
|
||||||
|
copyparty_token = os.getenv('COPYPARTY_TOKEN')
|
||||||
|
|
||||||
#Bot intents
|
#Bot intents
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
@@ -42,7 +44,7 @@ def pixelget(url: str):
|
|||||||
except AssertionError:
|
except AssertionError:
|
||||||
logger.warning("Link was not a torrent")
|
logger.warning("Link was not a torrent")
|
||||||
else:
|
else:
|
||||||
response = requests.get(f'https://pixeldrain.com/api/file/{url.split("/")[-1]}?download', headers={"Authorization": (":bdf70819-9e47-4a3f-861a-41fd448939db")})
|
response = requests.get(f'https://pixeldrain.com/api/file/{url.split("/")[-1]}?download', headers={"Authorization": (f":{pixelget_token}")})
|
||||||
with open(title, "wb") as f:
|
with open(title, "wb") as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
|
|
||||||
@@ -63,7 +65,7 @@ def dayuploads_get(url: str):
|
|||||||
def uploadfile(file_name: str):
|
def uploadfile(file_name: str):
|
||||||
with open(file_name, "rb") as torrent_file:
|
with open(file_name, "rb") as torrent_file:
|
||||||
response = requests.put(f"https://upload.fieryeagle.org/torfiles/{file_name}",
|
response = requests.put(f"https://upload.fieryeagle.org/torfiles/{file_name}",
|
||||||
torrent_file, auth=("admin","TVcZRYhT5Cd#@eY8P9NxNN2mC"))
|
torrent_file, auth=("admin",copyparty_token))
|
||||||
try:
|
try:
|
||||||
assert response.status_code in range(200, 300)
|
assert response.status_code in range(200, 300)
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
|
|||||||
Reference in New Issue
Block a user