enable cross tandoor importing

This commit is contained in:
vabene1111
2023-02-16 17:32:43 +01:00
parent 50429207c5
commit 5dad6b8b17
3 changed files with 43 additions and 6 deletions

View File

@@ -424,3 +424,18 @@ def get_images_from_soup(soup, url):
if 'http' in u:
images.append(u)
return images
def clean_dict(input_dict, key):
if type(input_dict) == dict:
for x in list(input_dict):
if x == key:
del input_dict[x]
elif type(input_dict[x]) == dict:
input_dict[x] = clean_dict(input_dict[x], key)
elif type(input_dict[x]) == list:
temp_list = []
for e in input_dict[x]:
temp_list.append(clean_dict(e, key))
return input_dict