File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 1- import json
1+ import jstyleson
22import glob
33import os
44import sys
1212 if filename not in ignore :
1313 print (f"Opening: { filename } " )
1414 filecontent = open (filename , "r" ).read ()
15- modlist = json .loads (filecontent )
15+
16+ try :
17+ modlist = jstyleson .loads (filecontent )
18+ except Exception as err :
19+ error = True
20+ print (f"❌ Error reading JSON file { filename } : { err } " )
21+ continue
22+
1623 for mod , data in modlist .items ():
1724 url = data ["mod" ].replace (" " , "%20" )
1825 print (f"{ mod } : { url } " )
1926 try :
2027 response = urllib .request .urlopen (url )
2128 print (f"✅ Download successful" )
22- except :
29+ except Exception as err :
2330 error = True
24- print ("❌ Download failed" )
31+ print (f "❌ Download failed: { err } " )
2532 continue
33+
2634 filecontent = response .read ()
27-
35+
2836 try :
29- json .loads (filecontent )
37+ jstyleson .loads (filecontent )
3038 print (f"✅ JSON valid" )
3139 except Exception as err :
3240 error = True
You can’t perform that action at this time.
0 commit comments