Compare commits

...

3 Commits

2 changed files with 9 additions and 8 deletions

View File

@ -78,7 +78,7 @@ def fetch_instances_nodeinfo_and_avalaibility(instances):
headers={ headers={
'Accept-Encoding': 'gzip, brotli, deflate', 'Accept-Encoding': 'gzip, brotli, deflate',
'User-Agent': 'funkwhale-cli/latest-commit; +https://git.phreedom.club/localhost_frssoft/funkwhale-cli'}, 'User-Agent': 'funkwhale-cli/latest-commit; +https://git.phreedom.club/localhost_frssoft/funkwhale-cli'},
timeout=5).json() timeout=10).json()
with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads
res = [executor.submit(request_nodeinfo, instance) for instance in instances] res = [executor.submit(request_nodeinfo, instance) for instance in instances]
@ -115,7 +115,8 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
list_instances = fetch_instances_nodeinfo_and_avalaibility([instance.split('|')[0].strip() for instance in list_instances.keys()]) list_instances = fetch_instances_nodeinfo_and_avalaibility([instance.split('|')[0].strip() for instance in list_instances.keys()])
settings.set_config('public_list_instances_extended', list_instances) settings.set_config('public_list_instances_extended', list_instances)
map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks' map_in_extend_mode = '\nmap: instance | anonymousCanListen | tracks'
instance_menu_selector = ['Fetch new instances', instance_menu_selector = ['Add new instance',
'Fetch new instances',
'Fetch nodeinfo and avalaibility', 'Fetch nodeinfo and avalaibility',
'Remove unreachible instances', 'Remove unreachible instances',
'Shuffle'] 'Shuffle']
@ -128,6 +129,11 @@ def instances_menu(fetch_manually=False, fetch_node_info=False):
return return
else: else:
instance = instance[0].split('|')[0].strip() instance = instance[0].split('|')[0].strip()
if instance == 'Add new instance':
new = input('example.com\n').strip()
list_instances[new] = 'added by user'
settings.set_config('public_list_instances_extended', list_instances)
instance = new
if instance == 'Fetch new instances': if instance == 'Fetch new instances':
return instances_menu(fetch_manually=True) return instances_menu(fetch_manually=True)
if instance == 'Fetch nodeinfo and avalaibility': if instance == 'Fetch nodeinfo and avalaibility':

View File

@ -12,14 +12,11 @@ default_conf = {
'public_list_instances_extended': 'public_list_instances_extended':
{ {
"open.audio": None, "open.audio": None,
"funkwhale.co.uk": None,
"am.pirateradio.social": None,
"audio.liberta.vip": None, "audio.liberta.vip": None,
"audio.gafamfree.party": None, "dance.with.tewi.and.reisen": None,
"tanukitunes.com": None, "tanukitunes.com": None,
"funkwhale.juniorjpdj.pl": None, "funkwhale.juniorjpdj.pl": None,
"audio.securetown.in.ua": None, "audio.securetown.in.ua": None,
"tavia.mle.party": None,
"funkwhale.thurk.org": None, "funkwhale.thurk.org": None,
"buzzworkers.com": None, "buzzworkers.com": None,
"soundship.de": None, "soundship.de": None,
@ -31,13 +28,11 @@ default_conf = {
"mizik.o-k-i.net": None, "mizik.o-k-i.net": None,
"klh.radiolivre.org": None, "klh.radiolivre.org": None,
"hudba.feildel.fr": None, "hudba.feildel.fr": None,
"funkwhale.mita.me": None,
"funk.deko.cloud": None, "funk.deko.cloud": None,
"audio.graz.social": None, "audio.graz.social": None,
"funkwhale.desmu.fr": None, "funkwhale.desmu.fr": None,
"listen.knsm.cc": None, "listen.knsm.cc": None,
"funkwhale.gegeweb.eu": None, "funkwhale.gegeweb.eu": None,
"shitnoise.monster": None,
}, },
'automatic_fetch_new_instances': False, 'automatic_fetch_new_instances': False,
'enable_server_transcoding': False, 'enable_server_transcoding': False,