Browse Source

Initial commit of files

master
Gogs 5 years ago
parent
commit
6703296f38
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      fastcloudtube.py

+ 21
- 0
fastcloudtube.py View 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…
Cancel
Save