Skip to content

Commit

Permalink
feat: adds requirements and necessary library items
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymous-org-za committed Jul 8, 2024
1 parent 8e75b54 commit fc24c29
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/server.py
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")
15 changes: 15 additions & 0 deletions library/tinfoil.py
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}"
}
5 changes: 5 additions & 0 deletions library/torbox.py
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")
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fastapi
uvicorn
python-dotenv
httpx
human-readable
aiofiles

0 comments on commit fc24c29

Please sign in to comment.