torrent-downloader-react 1.0.10__py3-none-any.whl → 1.0.12__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- torrent_downloader/server.py +25 -1
- {torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/METADATA +1 -1
- {torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/RECORD +6 -6
- {torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/WHEEL +0 -0
- {torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/entry_points.txt +0 -0
- {torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/top_level.txt +0 -0
torrent_downloader/server.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from fastapi import FastAPI, HTTPException
|
2
2
|
from fastapi.middleware.cors import CORSMiddleware
|
3
|
+
from fastapi.staticfiles import StaticFiles
|
4
|
+
from fastapi.responses import FileResponse
|
3
5
|
from pydantic import BaseModel
|
4
6
|
import libtorrent as lt
|
5
7
|
import os
|
@@ -21,6 +23,20 @@ app.add_middleware(
|
|
21
23
|
allow_headers=["*"],
|
22
24
|
)
|
23
25
|
|
26
|
+
# Get the directory containing the static files
|
27
|
+
static_dir = Path(__file__).parent / "static"
|
28
|
+
|
29
|
+
# Mount static files
|
30
|
+
app.mount("/assets", StaticFiles(directory=str(static_dir / "assets")), name="assets")
|
31
|
+
|
32
|
+
@app.get("/")
|
33
|
+
async def read_root():
|
34
|
+
return FileResponse(str(static_dir / "index.html"))
|
35
|
+
|
36
|
+
@app.get("/favicon.ico")
|
37
|
+
async def favicon():
|
38
|
+
return FileResponse(str(static_dir / "favicon.ico"))
|
39
|
+
|
24
40
|
# Set up platform-specific paths
|
25
41
|
def get_downloads_dir() -> Path:
|
26
42
|
if sys.platform == 'win32':
|
@@ -143,4 +159,12 @@ async def open_downloads():
|
|
143
159
|
success = open_folder(str(DOWNLOAD_PATH))
|
144
160
|
if not success:
|
145
161
|
raise HTTPException(status_code=500, detail="Failed to open downloads folder")
|
146
|
-
return {"message": "Downloads folder opened successfully"}
|
162
|
+
return {"message": "Downloads folder opened successfully"}
|
163
|
+
|
164
|
+
def main():
|
165
|
+
"""Entry point for the application."""
|
166
|
+
import uvicorn
|
167
|
+
uvicorn.run(app, host="127.0.0.1", port=8000)
|
168
|
+
|
169
|
+
if __name__ == "__main__":
|
170
|
+
main()
|
{torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/RECORD
RENAMED
@@ -1,11 +1,11 @@
|
|
1
1
|
torrent_downloader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
torrent_downloader/server.py,sha256=
|
2
|
+
torrent_downloader/server.py,sha256=2pCQASAPSZQPWVKh5ZoIf9iM8YloHHpJVPNV-C4EGY4,5255
|
3
3
|
torrent_downloader/static/index.html,sha256=zzC3ohQn0Mw48CgKPhvFnrYJfFz00-c3vC-GS-eCjv8,464
|
4
4
|
torrent_downloader/static/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
|
5
5
|
torrent_downloader/static/assets/index-BWN4x5dM.js,sha256=FWGVaR7i3650zle1WwZ7OHFd0er5X6UNKpyCz1Fpo48,188702
|
6
6
|
torrent_downloader/static/assets/index-DVy8AvwL.css,sha256=5bEvGbnqbN9-WNs8tlnCu9rLWY5ubfi33-xuAF4Hkz4,3517
|
7
|
-
torrent_downloader_react-1.0.
|
8
|
-
torrent_downloader_react-1.0.
|
9
|
-
torrent_downloader_react-1.0.
|
10
|
-
torrent_downloader_react-1.0.
|
11
|
-
torrent_downloader_react-1.0.
|
7
|
+
torrent_downloader_react-1.0.12.dist-info/METADATA,sha256=iOBOZ0dWs8kvw6t5iGKGvwjRL-ARGxClZNXpYrJaJRw,4441
|
8
|
+
torrent_downloader_react-1.0.12.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
9
|
+
torrent_downloader_react-1.0.12.dist-info/entry_points.txt,sha256=zkljgTNEM0p9I4xw4FN0N5PVrNmB6KVLUWjBO32n0do,76
|
10
|
+
torrent_downloader_react-1.0.12.dist-info/top_level.txt,sha256=THWnh7qxxVmoQ89QVJ8v6mmSzEQdFdXnryplXTQXuCA,19
|
11
|
+
torrent_downloader_react-1.0.12.dist-info/RECORD,,
|
{torrent_downloader_react-1.0.10.dist-info → torrent_downloader_react-1.0.12.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|