Save config value to auto-download new episodes
This commit is contained in:
parent
044e5bb921
commit
1d80da48a8
|
@ -38,10 +38,15 @@ elif cmd == 'add':
|
||||||
podcast = {}
|
podcast = {}
|
||||||
print('Podcast name: ', end=None)
|
print('Podcast name: ', end=None)
|
||||||
podcast['name'] = sys.stdin.readline().strip()
|
podcast['name'] = sys.stdin.readline().strip()
|
||||||
print('Language: ', end=None)
|
print('Language: (ISO 639-1 two-letter code)')
|
||||||
podcast['lang'] = sys.stdin.readline().strip()
|
podcast['lang'] = sys.stdin.readline().strip()
|
||||||
print('RSS URL: ', end=None)
|
print('RSS URL:')
|
||||||
podcast['url'] = sys.stdin.readline().strip()
|
podcast['url'] = sys.stdin.readline().strip()
|
||||||
|
print('Auto-download episodes: (y/n)')
|
||||||
|
autoDownload = sys.stdin.readline().strip()
|
||||||
|
podcast['auto'] = True
|
||||||
|
if autoDownload in ['n', 'N', 'no', 'No']:
|
||||||
|
podcast['auto'] = False
|
||||||
config['podcasts'].append(podcast)
|
config['podcasts'].append(podcast)
|
||||||
configFile = open('config.json', 'w', encoding='utf-8')
|
configFile = open('config.json', 'w', encoding='utf-8')
|
||||||
json.dump(config, configFile, indent=4)
|
json.dump(config, configFile, indent=4)
|
||||||
|
|
Loading…
Reference in a new issue