From 9718a3892c1d3ecbcab1409965ac55ed8ab1b388 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 24 Apr 2019 15:54:01 +0800 Subject: Don't hardcode. Also update (the currently invisible) audio gears. --- libs/music/player.d/cgi-bin/m3u8.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/music/player.d/cgi-bin/m3u8.cgi') 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') -- cgit v1.2.3