Загрузка...

Search by mac address

Thread in Python created by alterego_inactive3375189 Jun 30, 2020. 101 view

  1. alterego_inactive3375189
    alterego_inactive3375189 Topic starter Jun 30, 2020 Banned 0 Jun 30, 2020
    Подъехал ни кому не нужный говнокод
    Code
    import requests

    def one():
    try:
    mac = input('Введите MAC адрес ')
    r = requests.get(f'https://api.mylnikov.org/geolocation/wifi?bssid={mac}')
    rg = r.json()
    lat = rg['data']['lat']
    lon = rg['data']['lon']
    print(lat, lon)
    except Exception:
    print('Error')

    def more():
    try:
    wr = open('****.txt', 'a')
    for mac in open('mac.txt'):
    mac = mac.replace('\n', '')
    r = requests.get(f'https://api.mylnikov.org/geolocation/wifi?bssid={mac}')
    rg = r.json()
    lat = rg['data']['lat']
    lon = rg['data']['lon']
    wr.write(f'{lat} {lon}\n')
    wr.close()
    except Exception:
    print('Error')

    if __name__ == '__main__':
    print('Выберете:\n1 Вычислить 1 MAC адрес\n2 Загрузить файл с Mac адресами')
    a = input('Введите цифру действия:')
    if a == '1':
    one()
    elif a == '2':
    more()
    else:
    print('Вы ввели неверное значенние')
     
Top
Loading...