import os from configobj import ConfigObj from headphones import config_file config = ConfigObj(config_file) General = config['General'] http_host = General['http_host'] http_port = General['http_port'] http_username = General['http_username'] http_password = General['http_password'] try: http_root = General['http_root'] except KeyError: General['http_root'] = '' config.write() launch_browser = General['launch_browser'] usenet_retention = General['usenet_retention'] include_lossless = General['include_lossless'] flac_to_mp3 = General['flac_to_mp3'] move_to_itunes = General['move_to_itunes'] path_to_itunes = General['path_to_itunes'] rename_mp3s = General['rename_mp3s'] cleanup = General['cleanup'] add_album_art = General['add_album_art'] music_download_dir = General['music_download_dir'] NZBMatrix = config['NZBMatrix'] nzbmatrix = NZBMatrix['nzbmatrix'] nzbmatrix_username = NZBMatrix['nzbmatrix_username'] nzbmatrix_apikey = NZBMatrix['nzbmatrix_apikey'] Newznab = config['Newznab'] newznab = Newznab['newznab'] newznab_host = Newznab['newznab_host'] newznab_apikey = Newznab['newznab_apikey'] NZBsorg = config['NZBsorg'] nzbsorg = NZBsorg['nzbsorg'] nzbsorg_uid = NZBsorg['nzbsorg_uid'] nzbsorg_hash = NZBsorg['nzbsorg_hash'] SABnzbd = config['SABnzbd'] sab_username = SABnzbd['sab_username'] sab_password = SABnzbd['sab_password'] sab_apikey = SABnzbd['sab_apikey'] sab_category = SABnzbd['sab_category'] sab_host = SABnzbd['sab_host'] def var_to_chk(variable): if variable == '1': return 'Checked' else: return '' form = '''
Web Interface | Download Settings | Search Providers | Quality & Post Processing

Web Interface

HTTP Host:


i.e. localhost or 0.0.0.0

HTTP Username:

HTTP Port:

HTTP Password:

Launch Browser on Startup:

Download Settings

SABnzbd Host:


usually localhost:8080

SABnzbd Username:


SABnzbd API:


SABnzbd Password:


SABnzbd Category:


Music Download Directory:


Absolute or relative path to the dir where SAB downloads your music
i.e. Downloads/music or /Users/name/Downloads/music

Usenet Retention:

Search Providers

NZBMatrix:

NZBMatrix Username:

NZBMatrix API:


Newznab:


Newznab Host:

i.e. http://nzb.su


Newznab API:


NZBs.org:


NZBs.org UID:


NZBs.org Hash:

Quality & Post Processing

Album Quality:

Include lossless
Convert lossless to mp3

iTunes:

Move downloads to iTunes


Path to iTunes folder:

i.e. Music/iTunes or /Users/name/Music/iTunes

Renaming & Metadata:

Rename & add metadata
Delete leftover files


Album Art:

Add album art


(For now, all changes require a restart to take effect)

''' % (http_host, http_username, http_port, http_password, var_to_chk(launch_browser), sab_host, sab_username, sab_apikey, sab_password, sab_category, music_download_dir, usenet_retention, var_to_chk(nzbmatrix), nzbmatrix_username, nzbmatrix_apikey, var_to_chk(newznab), newznab_host, newznab_apikey, var_to_chk(nzbsorg), nzbsorg_uid, nzbsorg_hash, var_to_chk(include_lossless), var_to_chk(flac_to_mp3), var_to_chk(move_to_itunes), path_to_itunes, var_to_chk(rename_mp3s), var_to_chk(cleanup), var_to_chk(add_album_art))