Skip to content

Commit

Permalink
Fixed VPS usage and added an example .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 22, 2023
1 parent 3045c8c commit 8ac6109
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ celerybeat.pid
*.sage.py

# Environments
.env
.venv
env/
venv/
Expand Down
Binary file removed go-ul_linux_x64
Binary file not shown.
Empty file removed modules/__init__.py
Empty file.
1 change: 0 additions & 1 deletion modules/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import os
import shutil
import subprocess
Expand Down
2 changes: 0 additions & 2 deletions modules/ddl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
import requests
import requests
from modules.upload import upload
import subprocess
import re
Expand Down
10 changes: 4 additions & 6 deletions modules/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseDownload
import os
from dotenv import load_dotenv
load_dotenv()

SCOPES = ['https://www.googleapis.com/auth/drive.readonly']
gdriveIDRe = re.compile('([-\w]{25,})')

try:
creds = Credentials.from_authorized_user_info(json.loads(os.getenv('token_json')), SCOPES)
service = build('drive', 'v3', credentials=creds)
except:
print("token_json ENV error!", flush=True)
raise Exception("token_json ENV error!")
creds = Credentials.from_authorized_user_info(json.loads(os.getenv('token_json')), SCOPES)
service = build('drive', 'v3', credentials=creds)


def gdriveDownload(message: Message, serviceID: int, progressMessage: Message):
Expand Down
7 changes: 6 additions & 1 deletion modules/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from pyrogram.types import Message
import subprocess

if os.name == 'nt':
APP = "./go-ul_x64.exe"
else:
APP = "./go-ul_x64"

SERVICES = ['anonfiles', 'catbox', 'fileio', 'filemail', 'gofile', 'krakenfiles', 'letsupload', 'megaup',
'mixdrop', 'pixeldrain', 'racaty', 'transfersh', 'uguu', 'wetransfer', 'workupload', 'zippyshare']

Expand All @@ -18,7 +23,7 @@ def upload(filePath: str, serviceID: int, message: Message, progressMessage: Mes
progressMessage.edit_text(
f"Uploading to {SERVICES[serviceID]}...\n`{file_name}` ")

subprocess.Popen(["./go-ul_linux_x64", SERVICES[serviceID],
subprocess.Popen([APP, SERVICES[serviceID],
'-f', filePath, '-j', 'response.json']).wait()

response = json.load(open('response.json'))
Expand Down

0 comments on commit 8ac6109

Please sign in to comment.