Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import json
|
|
6 |
def dl(inp):
|
7 |
out = None
|
8 |
out_file=[]
|
9 |
-
|
10 |
try:
|
11 |
inp_out=inp.replace("https://","")
|
12 |
inp_out=inp_out.replace("/","_").replace(".","_")
|
@@ -21,16 +21,17 @@ def dl(inp):
|
|
21 |
out_json=f'{inp_out}.info.json'
|
22 |
try:
|
23 |
with open(f"{inp_out}.info.json", "r") as f:
|
24 |
-
json_object = json.loads(f)
|
25 |
|
26 |
-
out_json = json.dumps(json_object, indent=4)
|
27 |
-
print (out_json)
|
28 |
f_out = f.readlines()
|
29 |
for line in f_out:
|
30 |
print (line)
|
|
|
31 |
#dec_line = line.decode('utf-8', 'backslashreplace')
|
32 |
#out_line = binascii.hexlify(eval(dec_line))
|
33 |
#print (out_line)
|
|
|
|
|
|
|
34 |
except Exception as e:
|
35 |
print (e)
|
36 |
except Exception as e:
|
|
|
6 |
def dl(inp):
|
7 |
out = None
|
8 |
out_file=[]
|
9 |
+
json_line=[]
|
10 |
try:
|
11 |
inp_out=inp.replace("https://","")
|
12 |
inp_out=inp_out.replace("/","_").replace(".","_")
|
|
|
21 |
out_json=f'{inp_out}.info.json'
|
22 |
try:
|
23 |
with open(f"{inp_out}.info.json", "r") as f:
|
|
|
24 |
|
|
|
|
|
25 |
f_out = f.readlines()
|
26 |
for line in f_out:
|
27 |
print (line)
|
28 |
+
json_line.append(line)
|
29 |
#dec_line = line.decode('utf-8', 'backslashreplace')
|
30 |
#out_line = binascii.hexlify(eval(dec_line))
|
31 |
#print (out_line)
|
32 |
+
json_object = json.loads(json_line)
|
33 |
+
out_json = json.dumps(json_object, indent=4)
|
34 |
+
print (out_json)
|
35 |
except Exception as e:
|
36 |
print (e)
|
37 |
except Exception as e:
|