Compare commits
No commits in common. "81aa7e4470e306ee3f5e06a2688625419274f52d" and "f7239a90f17cbc74bc593fb78f9bd27c798ea490" have entirely different histories.
81aa7e4470
...
f7239a90f1
@ -1,3 +1 @@
|
|||||||
__pycache__
|
app/__pycache__
|
||||||
.DS_Store
|
|
||||||
data/*
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
.DS_Store
|
|
||||||
data/*
|
|
||||||
# macOS
|
|
||||||
.DS_Store
|
|
||||||
21
.vscode/launch.json
vendored
21
.vscode/launch.json
vendored
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"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.
@ -128,6 +128,10 @@ class youtube():
|
|||||||
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best',
|
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best',
|
||||||
}
|
}
|
||||||
|
|
||||||
with yt_dlp.YoutubeDL(dl_ops) as ydl:
|
try:
|
||||||
ydl.download([url])
|
with yt_dlp.YoutubeDL(dl_ops) as ydl:
|
||||||
# grab.thumbnail(ydl,url,location)
|
ydl.download([url])
|
||||||
|
# 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")
|
@app.get("/dropoutSeries", response_class=JSONResponse)
|
||||||
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,14 +40,10 @@ 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):
|
||||||
try:
|
download.youtube.ydl(url,location)
|
||||||
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("/", include_in_schema=False, response_class=HTMLResponse)
|
@app.get("/", response_class=HTMLResponse)
|
||||||
async def index(request: Request):
|
async def index(request: Request):
|
||||||
apps = [
|
apps = [
|
||||||
{"name": "Notes", "url": "/notes"},
|
{"name": "Notes", "url": "/notes"},
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
# 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