fix: пропал декоратор @app.post(/api/add-torrent), follow_redirects в tmdb-proxy
- Возвращён @app.post('/api/add-torrent') — был съеден при вставке
proxy-torrent-download, из-за чего кнопка 'Добавить в клиент' всегда
возвращала 404
- tmdb-proxy /proxy-torrent: добавлен follow_redirects=True — rutracker
и kinozal отдают 302 перед .torrent файлом
This commit is contained in:
parent
a5497eef26
commit
127060d023
2 changed files with 4 additions and 2 deletions
|
|
@ -1185,7 +1185,7 @@ async def proxy_torrent_download(url: str = Query(...)):
|
|||
params={"url": url},
|
||||
timeout=30.0
|
||||
)
|
||||
if proxy_resp.status_code == 200:
|
||||
if proxy_resp.status_code == 200 or (proxy_resp.status_code < 400 and len(proxy_resp.content) > 100):
|
||||
content_type = proxy_resp.headers.get("content-type", "application/x-bittorrent")
|
||||
return Response(
|
||||
content=proxy_resp.content,
|
||||
|
|
@ -1225,6 +1225,8 @@ async def proxy_torrent_download(url: str = Query(...)):
|
|||
except Exception as e:
|
||||
print(f"Error in proxy-torrent-download: {e}")
|
||||
raise HTTPException(status_code=500, detail=f"Ошибка прокси: {str(e)}")
|
||||
|
||||
@app.post("/api/add-torrent")
|
||||
async def add_torrent_to_client(torrent_id: str = Form(...), magnet: str = Form(""), torrent_title: str = Form("")):
|
||||
"""Добавление торрента в qBittorrent через прямое API"""
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue