summaryrefslogtreecommitdiff
path: root/play_video_online.cgi
blob: ef3b0ad2c201c6872a87d24bf2b2f3053efa63b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python 
#
import cgi
from sys import path

path.append("protected/vendor/youtube-dl")
import youtube_dl

form = cgi.FieldStorage()
if "url" not in form:
    print( "ERROR: Url not sent");
    exit;
#print "URL:", form["url"].value

videoUrl = form["url"].value;

print "Content-Type: video/mp4"
print
youtube_dl.main(["-q", videoUrl])

def getFilenameFromUrl(url):
    pass