Initial commit of files
Dieser Commit ist enthalten in:
Ursprung
15db3efa1d
Commit
6703296f38
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python3
|
||||
from bottle import route, run, template
|
||||
from subprocess import call
|
||||
|
||||
@route("/")
|
||||
@route("/<link:path>")
|
||||
def index(link=""):
|
||||
if(link == ""):
|
||||
return "Please add a youtube-dl compatible link"
|
||||
else:
|
||||
return download(link)
|
||||
|
||||
def download(link):
|
||||
try:
|
||||
call(["youtube-dl", """--no-playlist --output "%(playlist_title)s%(ext)s" --write-thumbnail --extract-audio --audio-quality 9 --embed-thumbnail """])
|
||||
except OSError:
|
||||
return "youtube-dl is not installed on the host"
|
||||
except:
|
||||
return "some strange error happened"
|
||||
|
||||
run(host="0.0.0.0", port=1995, reloader=True)
|
Laden…
In neuem Issue referenzieren