Compare commits
2 Commits
f7239a90f1
...
81aa7e4470
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81aa7e4470 | ||
|
|
5f8581d422 |
@ -1 +1,3 @@
|
|||||||
app/__pycache__
|
__pycache__
|
||||||
|
.DS_Store
|
||||||
|
data/*
|
||||||
6
.gitignore
vendored
6
.gitignore
vendored
@ -1 +1,5 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
|
.DS_Store
|
||||||
|
data/*
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
21
.vscode/launch.json
vendored
Normal file
21
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "FastAPI: Uvicorn",
|
||||||
|
"type": "debugpy",
|
||||||
|
"request": "launch",
|
||||||
|
"module": "uvicorn",
|
||||||
|
"args": [
|
||||||
|
"app.main:app",
|
||||||
|
"--reload"
|
||||||
|
],
|
||||||
|
"jinja": true,
|
||||||
|
"justMyCode": true,
|
||||||
|
"env": {
|
||||||
|
"PYTHONPATH": "${workspaceFolder}/app"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
BIN
app/.DS_Store
vendored
BIN
app/.DS_Store
vendored
Binary file not shown.
0
app/__init__.py
Normal file
0
app/__init__.py
Normal file
@ -128,10 +128,6 @@ class youtube():
|
|||||||
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best',
|
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best',
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
with yt_dlp.YoutubeDL(dl_ops) as ydl:
|
||||||
with yt_dlp.YoutubeDL(dl_ops) as ydl:
|
ydl.download([url])
|
||||||
ydl.download([url])
|
# grab.thumbnail(ydl,url,location)
|
||||||
# grab.thumbnail(ydl,url,location)
|
|
||||||
return JSONResponse(status_code=200, content={"status": "success", "message": "Download completed."})
|
|
||||||
except Exception as e:
|
|
||||||
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
|
||||||
16
app/main.py
16
app/main.py
@ -1,8 +1,8 @@
|
|||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
from fastapi.responses import HTMLResponse, JSONResponse
|
from fastapi.responses import HTMLResponse, JSONResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from fastapi.staticfiles import StaticFiles
|
# from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi.concurrency import run_in_threadpool
|
# from fastapi.concurrency import run_in_threadpool
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import json, download
|
import json, download
|
||||||
|
|
||||||
@ -21,9 +21,9 @@ async def dropoutUpdate():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
||||||
|
|
||||||
@app.get("/dropoutSeries", response_class=JSONResponse)
|
@app.get("/dropoutSeries")
|
||||||
async def dropoutSeries():
|
async def dropoutSeries():
|
||||||
file_path = Path("data/dropout.json")
|
file_path = Path("/data/dropout.json")
|
||||||
if file_path.exists():
|
if file_path.exists():
|
||||||
with file_path.open("r", encoding="utf-8") as f:
|
with file_path.open("r", encoding="utf-8") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
@ -40,10 +40,14 @@ async def dropoutDownload(show: str, season: str, episode: str = None):
|
|||||||
|
|
||||||
@app.post("/ydl")
|
@app.post("/ydl")
|
||||||
async def ydl(url: str, location: str):
|
async def ydl(url: str, location: str):
|
||||||
download.youtube.ydl(url,location)
|
try:
|
||||||
|
download.youtube.ydl(url,location)
|
||||||
|
return JSONResponse(status_code=200, content={"status": "success", "message": "Download completed."})
|
||||||
|
except Exception as e:
|
||||||
|
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
||||||
|
|
||||||
# html
|
# html
|
||||||
@app.get("/", response_class=HTMLResponse)
|
@app.get("/", include_in_schema=False, response_class=HTMLResponse)
|
||||||
async def index(request: Request):
|
async def index(request: Request):
|
||||||
apps = [
|
apps = [
|
||||||
{"name": "Notes", "url": "/notes"},
|
{"name": "Notes", "url": "/notes"},
|
||||||
|
|||||||
6
dropout_cookies.txt
Normal file
6
dropout_cookies.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Netscape HTTP Cookie File
|
||||||
|
# This file is generated by yt-dlp. Do not edit.
|
||||||
|
|
||||||
|
www.dropout.tv FALSE / FALSE 2376616194 locale_det en
|
||||||
|
.dropout.tv TRUE / TRUE 1777000194 _session UElXTTdFemwzenp3RTZPQWx6clJwN3d4WlFkaEV0SXVrd2tnMUNUazJQVldOZEVlVTNOS0ZXS2twUmFHczBuMUlSZXVmTmZIeEFUeFZlajVLRVhrT0VVcm9XYU1jMUZQcTQwQUJNUUhtZ091NWZGS0kwYkMyNmZQelkxbll2QmxXYTFwZlJKNVlmdXFnZkcrVVdld3FCaFB4QnJGb2FLTWxyNlBnOFNCSkNLd1EvTS9OaE1nbTgrcjNmSmR6bE9YLS11M2pSa2VBLzZNZkozeXBXWGF4amhRPT0%3D--9ff14eeca357a6d7d1e8eb3496b039a01b2f92ab
|
||||||
|
.www.dropout.tv TRUE / TRUE 1745465994 __cf_bm d9dI.ZmTB7AOvOULLAi6gzGen4gtP_wncSkUXNYGV18-1745464194-1.0.1.1-XU86MNGfB8sthsX_dgFr7z0XBFSuYt7yiI60jsNbL2WbD.SbKI57sVTLGBl8xYhDiD.bBN7pJRYJjKXKsn80n8C8RujDnn_55c_6rxwvcoo_pbexZbMpHbzcjc_SHxKH
|
||||||
Loading…
x
Reference in New Issue
Block a user