Rockk08 commited on
Commit
955e5f9
·
1 Parent(s): 5c63934

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -42,8 +42,14 @@ def verify_image(url1):
42
  end_index = file.name.rfind('$')
43
  if start_index != -1 and end_index != -1:
44
  name = file.name[start_index + 1:end_index]
45
- return {"username": name}
46
- break
 
 
 
 
 
 
47
 
48
  if flag == False:
49
  print("Not Verified")
 
42
  end_index = file.name.rfind('$')
43
  if start_index != -1 and end_index != -1:
44
  name = file.name[start_index + 1:end_index]
45
+ path = f"{name}/"
46
+ files_username = storage.bucket.list_blobs(prefix=path)
47
+ for file_username in files_username:
48
+ if (file_username.name.endswith(".json")):
49
+ url_username = storage.child(f"{file_username.name}").get_url(None)
50
+ with requests.get(url_username) as response_username:
51
+ metadata = response_username.json()
52
+ return {"username": name,"metadata": metadata}
53
 
54
  if flag == False:
55
  print("Not Verified")