forked from DevLARLEY/mpdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
32 lines (25 loc) · 1.2 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import configparser
import os.path
parser = configparser.ConfigParser()
def setupConfig():
if not os.path.isfile("config.ini"):
fp = open("config.ini", 'x')
fp.close()
parser.read("config.ini")
parser["MAIN"] = {"downloadpath": "", "downloadfrompath": "False", "ffmpegfrompath": "True", "ffmpegpath": "",
"mp4decryptfrompath": "True", "mp4decryptpath": "", "cdmselected": "False"}
parser["BROWSER"] = {"startpage": "https://duckduckgo.com/", "drmenabled": "True", "addons": ""}
writeConfig()
parser.read("config.ini")
def resetConfig():
if os.path.isfile("config.ini"):
fp = open("config.ini", 'x')
fp.close()
parser.read("config.ini")
parser["MAIN"] = {"downloadpath": "", "downloadfrompath": "False", "ffmpegfrompath": "True", "ffmpegpath": "",
"mp4decryptfrompath": "True", "mp4decryptpath": "", "cdmselected": "False"}
parser["BROWSER"] = {"startpage": "https://duckduckgo.com/", "drmenabled": "True", "addons": ""}
writeConfig()
def writeConfig():
with open('config.ini', 'w') as configfile:
parser.write(configfile)