forked from iMeiDo/asm_reborn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.py
37 lines (29 loc) · 791 Bytes
/
check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
# @Time : 2021/3/15
# @Author : lxdebug,hyzaw
# @Email : [email protected]
import requests
import platform
import json
import subprocess
def getnetinfo():
try:
netinfo = requests.get('http://ip-api.com/json/').text
ip = json.loads(netinfo).get('query')
country = json.loads(netinfo).get('country')
return ip,country
except:
return "0.0.0.0","unknown"
def system():
if(platform.system()=='Windows'):
return 'Windows'
elif(platform.system()=='Linux'):
return 'Linux'
elif (platform.system() == 'Darwin'):
return 'Darwin'
else:
return 'Other'
def cpu():
return platform.machine()
def virtual():
return subprocess.getoutput('systemd-detect-virt')