-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds requirements and necessary library items
- Loading branch information
1 parent
8e75b54
commit fc24c29
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
|
||
AUTH_USERNAME = os.getenv("AUTH_USERNAME") | ||
AUTH_PASSWORD = os.getenv("AUTH_PASSWORD") | ||
PORT = os.getenv("PORT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def errorMessage(message: str, error_code: str): | ||
""" | ||
Simply returns a well-formatted error message that works with Tinfoil. | ||
Requires: | ||
- message: a string which contains a human-readable message to the user about what went wrong. | ||
- error_code: a string which is a documented error code for a developer to know. For error code documenation, view here: https://api-docs.torbox.app | ||
Returns: | ||
- error: a dict with the 'error' key which is read by Tinfoil. Documentation here: https://blawar.github.io/tinfoil/custom_index/ | ||
""" | ||
|
||
return { | ||
"error": f"TorBox\n\n{message}\n\nError: {error_code}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
|
||
TORBOX_API_KEY = os.getenv("TORBOX_API_KEY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fastapi | ||
uvicorn | ||
python-dotenv | ||
httpx | ||
human-readable | ||
aiofiles |