mirror of
https://github.com/NohamR/GoFileCLI.git
synced 2025-05-24 00:49:00 +00:00
fix env
This commit is contained in:
parent
6e768e7e4c
commit
4557f6c254
10
README.md
10
README.md
@ -1,2 +1,10 @@
|
||||
create .env based on .env.example
|
||||
python gopload.py -i 'file.txt'
|
||||
python gopload.py -i 'file.txt'
|
||||
|
||||
Windows :
|
||||
setx GOPLOAD_TOKEN = "XXXXXXX" (from https://gofile.io/myProfile)
|
||||
setx GOPLOAD_PRIVATE_PARENT_ID = "UUID"
|
||||
|
||||
Linux/MacOS :
|
||||
export GOPLOAD_TOKEN = "XXXXXXX" (from https://gofile.io/myProfile)
|
||||
export GOPLOAD_PRIVATE_PARENT_ID = "UUID"
|
16
gopload.py
16
gopload.py
@ -4,7 +4,6 @@ import random
|
||||
import time
|
||||
import argparse
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
import logging
|
||||
import sys
|
||||
|
||||
@ -192,18 +191,17 @@ if __name__ == "__main__":
|
||||
logging.basicConfig(level=getattr(logging, args.log_level.upper()),format=log_format,datefmt="%H:%M:%S",)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv("TOKEN")
|
||||
PRIVATE_PARENT_ID = os.getenv("PRIVATE_PARENT_ID")
|
||||
TOKEN = os.getenv("GOPLOAD_TOKEN")
|
||||
PRIVATE_PARENT_ID = os.getenv("GOPLOAD_PRIVATE_PARENT_ID")
|
||||
if not TOKEN:
|
||||
logger.error("Error: TOKEN not found, create a .env file with TOKEN")
|
||||
sys.exit("Error: TOKEN not found, create a .env file with TOKEN")
|
||||
logger.error("Error: TOKEN not found, add GOPLOAD_TOKEN to your environment variables")
|
||||
sys.exit("Error: TOKEN not found, add GOPLOAD_TOKEN to your environment variables")
|
||||
if not PRIVATE_PARENT_ID:
|
||||
logger.error("Error: PRIVATE_PARENT_ID not found, create a .env file with PRIVATE_PARENT_ID")
|
||||
sys.exit("Error: PRIVATE_PARENT_ID not found, create a .env file with PRIVATE_PARENT_ID")
|
||||
logger.error("Error: TOKEN not found, add GOPLOAD_PRIVATE_PARENT_ID to your environment variables")
|
||||
sys.exit("Error: TOKEN not found, add GOPLOAD_PRIVATE_PARENT_ID to your environment variables")
|
||||
|
||||
if args.name and not args.parent:
|
||||
logger.warning("Parent folder id not specified, PRIVATE_PARENT_ID will be used")
|
||||
logger.warning("Parent folder id not specified, GOPLOAD_PRIVATE_PARENT_ID will be used")
|
||||
|
||||
if args.file:
|
||||
if args.folder:
|
||||
|
Loading…
x
Reference in New Issue
Block a user