From 6703296f38d78e5fe468e9b1374858f4bf2c4829 Mon Sep 17 00:00:00 2001 From: Gogs Date: Wed, 22 Apr 2015 17:38:32 +0200 Subject: [PATCH] Initial commit of files --- fastcloudtube.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fastcloudtube.py diff --git a/fastcloudtube.py b/fastcloudtube.py new file mode 100644 index 0000000..518e641 --- /dev/null +++ b/fastcloudtube.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +from bottle import route, run, template +from subprocess import call + +@route("/") +@route("/") +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)