Initial commit of files
This commit is contained in:
parent
15db3efa1d
commit
6703296f38
21
fastcloudtube.py
Normal file
21
fastcloudtube.py
Normal file
|
@ -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)
|
Loading…
Reference in a new issue