-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16_refresh_ml_token.py
More file actions
39 lines (31 loc) · 1.49 KB
/
Copy path16_refresh_ml_token.py
File metadata and controls
39 lines (31 loc) · 1.49 KB
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
38
39
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
python3 16_refresh_ml_token.py
═══════════════════════════════════════════════════════════════════════════════
REFRESH ML TOKEN: Actualiza el token de MercadoLibre manualmente
═══════════════════════════════════════════════════════════════════════════════
¿Qué hace?
Renueva el token de MercadoLibre cuando expira
USO:
python3 16_refresh_ml_token.py
Refresca el access token de MercadoLibre y lo guarda en el .env
═══════════════════════════════════════════════════════════════════════════════
"""
import sys
sys.path.insert(0, 'src/integrations')
def main():
from mainglobal import refresh_ml_token
print("🔄 Refrescando token de MercadoLibre...")
print()
if refresh_ml_token(force=True):
print()
print("✅ Token actualizado exitosamente")
print(" El nuevo token se guardó en .env")
return 0
else:
print()
print("❌ Error al actualizar token")
return 1
if __name__ == "__main__":
sys.exit(main())