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/header.html | 114 ++++++++++++++++++----------------- libs/music/player.d/cgi-bin/m3u8.cgi | 3 +- 2 files changed, 61 insertions(+), 56 deletions(-) (limited to 'libs/music') diff --git a/libs/music/header.html b/libs/music/header.html index 8441fce..8498157 100755 --- a/libs/music/header.html +++ b/libs/music/header.html @@ -1,55 +1,59 @@ - - - -Litter Rubbish Garbage Trash - - - - -
Chrisoft::Music Library
-

Permissive licensed unless otherwise stated. Feel free to use.

-

Back to the player

-

-

-
-Music production gears used by me [show] -
- -
-

- + + + +Litter Rubbish Garbage Trash + + + + +
Chrisoft::Music Library
+

Permissive licensed unless otherwise stated. Feel free to use.

+

Back to the player

+

+

+
+Music production gears used by me [show] +
+ +
+

+ 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