Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import os
|
2 |
import time
|
3 |
import uuid
|
@@ -12,10 +13,15 @@ from fastapi.templating import Jinja2Templates
|
|
12 |
from bs4 import BeautifulSoup
|
13 |
import requests
|
14 |
|
|
|
|
|
|
|
15 |
# Add to top of app.py
|
16 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
17 |
templates = Jinja2Templates(directory=".")
|
18 |
|
|
|
|
|
19 |
# Add search endpoint
|
20 |
@app.get("/search")
|
21 |
async def search_torrents(q: str):
|
@@ -61,8 +67,8 @@ async def get_mime_type(torrent_id: str):
|
|
61 |
|
62 |
|
63 |
|
64 |
-
|
65 |
-
|
66 |
|
67 |
def get_largest_file(torrent_info):
|
68 |
files = torrent_info.files()
|
|
|
1 |
+
|
2 |
import os
|
3 |
import time
|
4 |
import uuid
|
|
|
13 |
from bs4 import BeautifulSoup
|
14 |
import requests
|
15 |
|
16 |
+
|
17 |
+
app = FastAPI()
|
18 |
+
|
19 |
# Add to top of app.py
|
20 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
21 |
templates = Jinja2Templates(directory=".")
|
22 |
|
23 |
+
active_sessions = {}
|
24 |
+
|
25 |
# Add search endpoint
|
26 |
@app.get("/search")
|
27 |
async def search_torrents(q: str):
|
|
|
67 |
|
68 |
|
69 |
|
70 |
+
|
71 |
+
|
72 |
|
73 |
def get_largest_file(torrent_info):
|
74 |
files = torrent_info.files()
|