summaryrefslogtreecommitdiff
path: root/libs/music/player.d/cgi-bin
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-04-24 15:54:01 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-04-24 15:54:01 +0800
commit9718a3892c1d3ecbcab1409965ac55ed8ab1b388 (patch)
tree2e04ae1a72bb51f00e3ba2f625bbf990978cc697 /libs/music/player.d/cgi-bin
parentc3102656799ab38243eafa4cc6c691a4aaccb751 (diff)
downloadweb-9718a3892c1d3ecbcab1409965ac55ed8ab1b388.tar.xz
Don't hardcode.
Also update (the currently invisible) audio gears.
Diffstat (limited to 'libs/music/player.d/cgi-bin')
-rwxr-xr-xlibs/music/player.d/cgi-bin/m3u8.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/music/player.d/cgi-bin/m3u8.cgi b/libs/music/player.d/cgi-bin/m3u8.cgi
index c90871c..7e14493 100755
--- a/libs/music/player.d/cgi-bin/m3u8.cgi
+++ b/libs/music/player.d/cgi-bin/m3u8.cgi
@@ -1,10 +1,11 @@
#!/usr/bin/python3
import cgi
+import os
import urllib.parse
d=cgi.parse()
try:
plist=d['plist'][0]
- f=open(f'/var/www/html/libs/music/player.d/playlists/{plist}.playlist','r',encoding='UTF-8')
+ f=open(f'{os.environ["DOCUMENT_ROOT"]}/libs/music/player.d/playlists/{plist}.playlist','r',encoding='UTF-8')
except (OSError,KeyError) as e:
print('Status: 400 Bad Request',end='\r\n')
print('Content-type: text/plain',end='\r\n')