|
@@ -50,6 +50,23 @@ class conf(object):
|
|
"maxresolution": "1080p",
|
|
"maxresolution": "1080p",
|
|
"maxfails": "50"
|
|
"maxfails": "50"
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ self.__explanations = {
|
|
|
|
+ "database": _("the name of your database file"),
|
|
|
|
+ "downloaddir": _("the directory where downloaded videos are saved"),
|
|
|
|
+ "maxvideos": _("the maximum number of videos to retrieve for each subscription"),
|
|
|
|
+ "mailhost": _("the host of your mail server"),
|
|
|
|
+ "mailto": _("the address used for notifications"),
|
|
|
|
+ "mailfrom": _("the sender address of notification e-mails"),
|
|
|
|
+ "smtpport": _("the port to use on your mail server"),
|
|
|
|
+ "auth_needed": _("if your mail server requires authentication"),
|
|
|
|
+ "user_name": _("the user name used to authenticate to your mail server"),
|
|
|
|
+ "password": _("the password used to authenticate to your mail server"),
|
|
|
|
+ "youtube-dl": _("the path to your youtube-dl installation"),
|
|
|
|
+ "notify": _("if you want to be notified via e-mail about new videos"),
|
|
|
|
+ "videocodec": _("which video codec you prefer (h264, webm or flv)"),
|
|
|
|
+ "maxresolution": _("which resolution you prefer (360p, 480p, 720p or 1080p)"),
|
|
|
|
+ }
|
|
self.dbpath = str(os.environ['HOME']) + "/.stov/" + self.values["database"]
|
|
self.dbpath = str(os.environ['HOME']) + "/.stov/" + self.values["database"]
|
|
self.outputlevel = "default"
|
|
self.outputlevel = "default"
|
|
|
|
|
|
@@ -261,3 +278,22 @@ class conf(object):
|
|
printf(_("Found value: %s" % itag_value),
|
|
printf(_("Found value: %s" % itag_value),
|
|
outputlevel="verbose", level=self.outputlevel, descriptor="stderr")
|
|
outputlevel="verbose", level=self.outputlevel, descriptor="stderr")
|
|
return itag_value
|
|
return itag_value
|
|
|
|
+
|
|
|
|
+ def assist(self):
|
|
|
|
+ """ Ask the user to set all required configuration parameters """
|
|
|
|
+
|
|
|
|
+ printf(_("This assistant will help you to perform the initial configuration"
|
|
|
|
+ " of stov. \nThe default value will be displayed in brackets.\n"
|
|
|
|
+ "Please specify now :\n"), outputlevel="default", level=self.outputlevel,
|
|
|
|
+ descriptor="stdout")
|
|
|
|
+ for value in self.__explanations:
|
|
|
|
+ printf(_(self.__explanations[value] + " [" + self.values[value] + "]: "),
|
|
|
|
+ outputlevel="default", level=self.outputlevel,
|
|
|
|
+ descriptor="stdout")
|
|
|
|
+ self.__user_input = raw_input()
|
|
|
|
+ if self.__user_input != "":
|
|
|
|
+ self.values[value] = self.__user_input
|
|
|
|
+ self.dbpath = str(os.environ['HOME']) + "/.stov/" + self.values["database"]
|
|
|
|
+ self.Initialize()
|
|
|
|
+ printf(_("Writing initial configuration according to your input, have fun!"),
|
|
|
|
+ outputlevel="default", level=self.outputlevel, descriptor="stdout")
|