🚸 Select download path
This commit is contained in:
parent
afc9c112cb
commit
3b5a998aaa
7 changed files with 303 additions and 18 deletions
|
@ -1,12 +1,23 @@
|
|||
from bottle import request, response, Bottle, HTTPResponse
|
||||
from bottle import request, response, Bottle, static_file
|
||||
from manager import Manager
|
||||
from json import dumps
|
||||
from pathlib import Path
|
||||
from tkinter import filedialog as fd
|
||||
|
||||
manager = Manager()
|
||||
app = Bottle()
|
||||
|
||||
|
||||
@app.get("/")
|
||||
def frontend():
|
||||
return static_file("index.html", root="frontend/dist")
|
||||
|
||||
|
||||
@app.get("/<filepath:path>")
|
||||
def frontend(filepath):
|
||||
return static_file(filepath, root="frontend/dist")
|
||||
|
||||
|
||||
@app.post("/video")
|
||||
def add_videos():
|
||||
nvlist = request.json["nvlist"].split()
|
||||
|
@ -20,8 +31,14 @@ def get_progress():
|
|||
return dumps(manager.get_progress())
|
||||
|
||||
|
||||
@app.post("/download")
|
||||
@app.get("/download")
|
||||
def download():
|
||||
parent_dir = Path(request.json["parent_dir"])
|
||||
manager.download(parent_dir)
|
||||
manager.download()
|
||||
return "OK"
|
||||
|
||||
|
||||
@app.get("/path")
|
||||
def get_path():
|
||||
path = fd.askdirectory()
|
||||
manager.path = path
|
||||
return path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue