Spaces:
Sleeping
Sleeping
come
commited on
Commit
·
f7f3ea3
1
Parent(s):
7db66af
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,16 @@ def GetList(data):
|
|
32 |
data = data[0]
|
33 |
if type(data) == dict:
|
34 |
newItemjson = GetJson(data)
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
return newItemjson
|
|
|
37 |
|
38 |
|
39 |
def GetJson(data):
|
@@ -42,7 +50,7 @@ def GetJson(data):
|
|
42 |
newJson['required'] = []
|
43 |
propertiesJson = {}
|
44 |
for key, value in data.items():
|
45 |
-
|
46 |
if type(value) == str:
|
47 |
propertiesJson[key] = {'type': 'string'}
|
48 |
elif type(value) == int:
|
@@ -166,13 +174,15 @@ def main():
|
|
166 |
while True:
|
167 |
try:
|
168 |
Request = input('请输入从Charles中抓包的URLs:')
|
169 |
-
|
170 |
url = ReRequestUrl(Request)
|
|
|
171 |
html = getHtml(url)
|
172 |
jsonOuputPath = 'outputJson.json'
|
173 |
jsondata = excuJson(html, jsonOuputPath)
|
|
|
174 |
NewJsonStr = showJson(jsondata)
|
175 |
-
|
176 |
except Exception as e:
|
177 |
print(e)
|
178 |
|
@@ -186,5 +196,5 @@ def GradioMain():
|
|
186 |
|
187 |
|
188 |
if "__main__" == __name__:
|
189 |
-
|
190 |
-
GradioMain()
|
|
|
32 |
data = data[0]
|
33 |
if type(data) == dict:
|
34 |
newItemjson = GetJson(data)
|
35 |
+
elif type(data) == list:
|
36 |
+
newItemjson = GetList(data)
|
37 |
+
elif type(data) == str:
|
38 |
+
newItemjson = {}
|
39 |
+
newItemjson['type'] = 'string'
|
40 |
+
else:
|
41 |
+
newItemjson = {}
|
42 |
+
newItemjson['type'] = 'string'
|
43 |
return newItemjson
|
44 |
+
return ''
|
45 |
|
46 |
|
47 |
def GetJson(data):
|
|
|
50 |
newJson['required'] = []
|
51 |
propertiesJson = {}
|
52 |
for key, value in data.items():
|
53 |
+
print(key,value)
|
54 |
if type(value) == str:
|
55 |
propertiesJson[key] = {'type': 'string'}
|
56 |
elif type(value) == int:
|
|
|
174 |
while True:
|
175 |
try:
|
176 |
Request = input('请输入从Charles中抓包的URLs:')
|
177 |
+
# Request = 'curl -H "Host: pre-release.gravity.place" -H "User-Agent: okhttp/3.12.13" --compressed "http://pre-release.gravity.place/gravity/metaverse/starUserList?country=CN&product=gravity&star_id=23&sys_lang=ja&uwd=YRHBwL8DHv04H3JUkjFuiWFQgdmQxIy64bp7qHpU4JbPo1wW6IcEaMMp6LsT34op%0A&app_version=7.7.0&user_country=CN&sign=31caf01c033f194abc5287df89ff80bb&source=star_detail&pkg=anonymous.sns.community.gravity&token=1QZVaDtlJ21T9CYEPRAKqC1X14y6xD5%252Bfetlx%252FTJE%252Bnl2lganNSgB9BSTNgdUCCN&languageV2=ja&referrer=Organic&zone=8&system_version=10&sdk_version=29&model=V2023A&device=android&brand=vivo&ts=1686842126"'
|
178 |
url = ReRequestUrl(Request)
|
179 |
+
print(url)
|
180 |
html = getHtml(url)
|
181 |
jsonOuputPath = 'outputJson.json'
|
182 |
jsondata = excuJson(html, jsonOuputPath)
|
183 |
+
print(jsondata)
|
184 |
NewJsonStr = showJson(jsondata)
|
185 |
+
print(NewJsonStr)
|
186 |
except Exception as e:
|
187 |
print(e)
|
188 |
|
|
|
196 |
|
197 |
|
198 |
if "__main__" == __name__:
|
199 |
+
main()
|
200 |
+
#GradioMain()
|