├── .gitignore ├── .news.json ├── README.md ├── image.png ├── setup.sh └── src ├── config └── config.json ├── nequi ├── requirements.txt ├── tickets └── README.md └── utils ├── blocks.py ├── colors.py └── objects ├── apiHandler.py ├── config.json ├── mainExecutable.py └── querySerializer.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Environments 40 | env/ 41 | venv/ 42 | ENV/ 43 | env.bak/ 44 | venv.bak/ 45 | 46 | # Pyenv 47 | .python-version 48 | 49 | # Virtualenv 50 | .venv/ 51 | venv/ 52 | ENV/ 53 | env/ 54 | env.bak/ 55 | venv.bak/ 56 | 57 | # Spyder project settings 58 | .spyderproject 59 | .spyproject 60 | 61 | # Rope project settings 62 | .ropeproject 63 | 64 | # mkdocs documentation 65 | /site 66 | 67 | # mypy 68 | .mypy_cache/ 69 | .dmypy.json 70 | dmypy.json 71 | 72 | # Pyre type checker 73 | .pyre/ 74 | 75 | # Pytype static type analyzer 76 | .pytype/ 77 | 78 | # Cython debug symbols 79 | cython_debug/ 80 | 81 | testing.py -------------------------------------------------------------------------------- /.news.json: -------------------------------------------------------------------------------- 1 | { 2 | "news": ["Una nueva página web lista a tu medida!"] 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | --- 3 | 4 |
Conexión a internet
Este generador de imágenes funciona a través de una API en internet.
26 | - git
Control de actualizaciones.
27 | - requests
Librería para le obtención del entorno web.
28 |
29 | ## Instalación 💻
30 |
31 | Para instalar correctamente el bot, sigue los siguientes pasos:
32 |
33 | 1) Clonar este repositorio:
34 | - git clone https://github.com/xploitLabs/NequiGenerator
35 |
36 | sudo apt install python3 -y
45 | - Para Termux: apt install python3 -y
46 |
47 | chmod 777 setup.sh
51 | - Y finalmente ejecutar: ./setup.sh
52 |
53 | nequi
para poder ejecutar el sistema de manera automática.
57 |
58 | ## Compatibilidad 🔨
59 |
60 | | Entorno | Es compatible | Probado en |
61 | |:------------:|:------------:|:------------:|
62 | | Windows | ❌ | ❌ |
63 | | Linux | ✅ | ✅ |
64 | | Termux | ✅ | ✅ |
65 |
66 | ## Idiomas 🗣️
67 |
68 | | Idioma | Disponibilidad |
69 | |:------------:|:------------:|
70 | | Español | ✅ |
71 | | Ingles | ❌ |
72 |
73 | # GUÍA DE USO PARA USUARIOS DE TERMUX
74 |
75 | Luego de instalar la correspondiente instalación del sistema, tienes que modificar la ruta de almacenamiento de las imágenes que se generen, para ello, ejecuta el siguiente comando:
76 |
77 | - termux-setup-storage
78 |
79 | Luego de ello, ve al directorio raíz con:
80 | 81 | -cd ~
82 |
83 | Al ver los archivos en tu ruta con el comando ls
, verás que hay una carpeta llamada storage
, entra a dicha carpeta con:
84 |
85 | - cd storage
86 |
87 |
Ahora, ve shared
con cd shared
y lista el contenido actual con ls
, y elige la carpeta de tu preferencia, por ejemplo, yo escogeré la carpeta DCIM
, asi que entraré a esa carpeta con:
88 |
89 | - cd DCIM
90 |
91 |
Y finalmente, usasré este comando para indicarle a NequiGenerator que almacene en esa carpeta las imágenes:
92 |
93 | - nequi -d
94 |
95 |
Ahora todas las imágenes que generes se almacenarán en dicha carpeta, y podrás acceder desde el gestor de archivos de tu preferencia.
-------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xploitLabs/NequiGenerator/bed90028a230928a1f8c2575a0edd4e6deae9256/image.png -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | clear 3 | 4 | echo -e "\e[32m 5 | __ _ _______ _______ __ __ ___ _______ _______ __ _ 6 | | | | || || || | | || | | || || | | | 7 | | |_| || ___|| _ || | | || | | ___|| ___|| |_| | 8 | | || |___ | | | || |_| || | | | __ | |___ | | 9 | | _ || ___|| |_| || || | | || || ___|| _ | 10 | | | | || |___ | | | || | | |_| || |___ | | | | 11 | |_| |__||_______||____||_||_______||___| |_______||_______||_| |__| 12 | 13 | 14 | xploitLabs -> https://github.com/xploitLabs 15 | \e[0m" 16 | 17 | # Verificar si python3 o python está instalado 18 | if command -v python3 &> /dev/null; then 19 | PYTHON=python3 20 | elif command -v python &> /dev/null; then 21 | PYTHON=python 22 | else 23 | echo -e "\e[1;31m[\e[34m+\e[1;31m] \e[0mThis system requires Python 3 or Python to be installed.\e[0m" 24 | exit 1 25 | fi 26 | 27 | current_directory=$(pwd) 28 | echo "export PATH=\$PATH:$current_directory/src" >> ~/.bashrc 29 | 30 | # Dar permiso de ejecución al archivo src/nequi 31 | nequi_file="$current_directory/src/nequi" 32 | if [ -e "$nequi_file" ]; then 33 | chmod +x "$nequi_file" 34 | echo -e "\e[1;32m[\e[34m+\e[1;32m] \e[0mPermissions set for $nequi_file." 35 | else 36 | echo -e "\e[1;31m[\e[34m+\e[1;31m] \e[0m$nequi_file not found." 37 | exit 1 38 | fi 39 | 40 | # Instalar los requerimientos desde src/requirements.txt 41 | requirements_file="$current_directory/src/requirements.txt" 42 | if [ -e "$requirements_file" ]; then 43 | echo -e "\e[1;32m[\e[34m+\e[1;32m] \e[0mInstalling requirements..." 44 | $PYTHON -m pip install -r "$requirements_file" 45 | else 46 | echo -e "\e[1;31m[\e[34m+\e[1;31m] \e[0mRequirements.txt file not found in the src directory." 47 | exit 1 48 | fi 49 | 50 | echo -e "\e[1;32m[\e[34m+\e[1;32m] \e[0mProcess finished, use the 'nequi' command." 51 | bash -------------------------------------------------------------------------------- /src/config/config.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /src/nequi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from utils.blocks import * 3 | from utils import colors 4 | from utils.objects import mainExecutable, querySerializer, apiHandler 5 | converter, pathHandler = mainExecutable.Generator.selector("base64"), mainExecutable.Generator.selector("pathlib") 6 | import sys, random 7 | 8 | def closeSystem(): 9 | sys.exit() 10 | 11 | def GenerateBoucher(objectCONFIG, PATHTICKET): 12 | animERROR("No te preocupes por usar tu terminal para generar bouchers!, ahora puedes generar los tuyos en mi web!: https://nequi-generator.vercel.app/ | Si quieres contactarme, háblame!: Another man: +54 9 11 5610-6122") 13 | closeSystem() 14 | animINFO("Cargando la base de datos...", 4) 15 | 16 | listRegisters = CONFIG.get("creations", []) 17 | 18 | dataClient = {} 19 | 20 | if len(listRegisters): 21 | animDONE("Tus registros son:\n", 4) 22 | 23 | for e, o in enumerate(listRegisters): 24 | print (f"{colors.WHITE}{e+1}{colors.RR}) {colors.WHITE}{o['nequiaccount']} {colors.GG}| {colors.WHITE}{o['name']}") 25 | 26 | print() 27 | animINFO(f"Selecciona el número que desees o pon {colors.CC}0{colors.WW} para registrar uno nuevo.", 4) 28 | userSelection = int(input(f">>> {colors.CC}")) 29 | if userSelection: 30 | if userSelection > len(listRegisters): 31 | animERROR("El número especificado no está en los registros.") 32 | sys.exit() 33 | objectClient = listRegisters[userSelection-1] 34 | dataClient["account"] = objectClient["nequiaccount"] 35 | dataClient["name"] = objectClient["name"] 36 | else: 37 | dataClient["account"] = int(input(INPUT("Pon el ID de la cuenta nueva: "))) 38 | dataClient["name"] = input(INPUT("Pon su nombre: ")) 39 | listRegisters.append({"nequiaccount": dataClient["account"], "name": dataClient["name"]}) 40 | objectCONFIG.saveJSON(CONFIG) 41 | animINFO("Cuenta almacenada en la base de datos") 42 | dataClient["value"] = int(input(INPUT("Pon el valor a pagar: "))) 43 | else: 44 | dataClient["account"] = int(input(INPUT("Pon el ID de la cuenta nueva: "))) 45 | dataClient["name"] = input(INPUT("Pon su nombre: ")) 46 | listRegisters.append({"nequiaccount": dataClient["account"], "name": dataClient["name"]}) 47 | CONFIG["creations"] = listRegisters 48 | objectCONFIG.saveJSON(CONFIG) 49 | dataClient["value"] = int(input(INPUT("Pon el valor a pagar: "))) 50 | 51 | animINFO("Cuenta almacenada en la base de datos") 52 | 53 | if pathHandler.Path(PATHTICKET).exists(): 54 | if not pathHandler.Path(PATHTICKET).is_dir(): 55 | animERROR("'tickets' tiene que ser una carpeta!") 56 | sys.exit() 57 | else: 58 | apiHandler.handler().SYS.mkdir(PATHTICKET) 59 | 60 | content = mainExecutable.Generator(dataClient["account"], dataClient["name"], dataClient["value"]).initializer() 61 | 62 | if not content: 63 | animERROR("No se pudo generar la imagen.") 64 | else: 65 | FILEROUTE = apiHandler.handler().SYS.path.join(PATHTICKET, f"ticket_{''.join(random.sample(list('1234567890'), 5))}.png") 66 | open(FILEROUTE, "wb").write(content["ListAux"][-1].content) 67 | animDONE(f"El sistema logró guardar tu imagen en < {FILEROUTE} >") 68 | 69 | sys.exit() 70 | 71 | def editUsers(objectCONFIG, user=None): 72 | animERROR("No te preocupes por usar tu terminal para generar bouchers!, ahora puedes generar los tuyos en mi web!: https://nequi-generator.vercel.app/ | Si quieres contactarme, háblame!: Another man: +54 9 11 5610-6122") 73 | closeSystem() 74 | animINFO("Cargando la base de datos...", 4) 75 | 76 | listRegisters = CONFIG.get("creations", []) 77 | 78 | dataClient = {} 79 | 80 | if len(listRegisters): 81 | animDONE("Estos registros tienes en tu base de datos:\n", 4) 82 | 83 | for e, o in enumerate(listRegisters): 84 | print (f"{colors.WHITE}{e+1}{colors.RR}) {colors.WHITE}{o['nequiaccount']} {colors.GG}| {colors.WHITE}{o['name']}") 85 | 86 | print() 87 | animINFO(f"Selecciona al número que quieras eliminar o pon {colors.CC}0{colors.WW} para cancelar la acción.", 4) 88 | userSelection = int(input(f">>> {colors.CC}")) 89 | if userSelection: 90 | if userSelection > len(listRegisters): 91 | animERROR("El número especificado no está en los registros.") 92 | sys.exit() 93 | objectClient = listRegisters[userSelection-1] 94 | listRegisters.remove(objectClient) 95 | objectCONFIG.saveJSON(CONFIG) 96 | animDONE("La cuenta ha sido eliminada de la base de datos") 97 | else: 98 | print () 99 | animINFO("Cerrando sistema...", 6) 100 | sys.exit() 101 | 102 | else: 103 | animINFO("Al parecer tu base de datos está vacía.") 104 | 105 | sys.exit() 106 | 107 | 108 | if __name__ == "__main__": 109 | try: 110 | bnr = converter.b64decode(querySerializer.cursor().getConfig(converter.b64decode("YmFubmVy").decode())).decode() 111 | 112 | print (f"{colors.R}{bnr}\n{colors.WW}") 113 | animINFO("Presiona CTRL + C para cerrar el programa.", 6) 114 | 115 | params = sys.argv 116 | 117 | ACTUALPATH = apiHandler.handler().SYS.path.abspath(apiHandler.handler().SYS.path.dirname(__file__)) 118 | 119 | objectCONFIG = querySerializer.cursor.ParserJson(apiHandler.handler().SYS.path.join(ACTUALPATH, "config", "config.json")) 120 | CONFIG = objectCONFIG.loadJSON() 121 | 122 | PATHTICKET = apiHandler.handler().SYS.path.join(ACTUALPATH, "tickets") if not CONFIG.get("dirStore", None) else CONFIG["dirStore"] 123 | 124 | if "-d" in params: 125 | CONFIG["dirStore"] = apiHandler.handler().SYS.getcwd() 126 | objectCONFIG.saveJSON(CONFIG) 127 | animDONE("Ruta de almacenamiento actualizada.") 128 | sys.exit() 129 | 130 | statsDebug = apiHandler.handler().SYS.getenv("DEBUG") 131 | listDebug = {"True": ["True", "true"], "False": ["false", "False"]} 132 | DEBUG = True if statsDebug in listDebug["True"] else False 133 | 134 | mainExecutable.Generator.conection() 135 | 136 | animINFO("Buscando actualizaciones...", 4) 137 | d = apiHandler.handler().deprecated()["STTS"] if not DEBUG else False 138 | if d: 139 | print () 140 | animINFO("El sistema encontró una nueva actualización del sistema") 141 | news = apiHandler.handler().getNews() 142 | if len(news): 143 | animINFO("Tiene estas novedades:") 144 | for e, n in enumerate(news): 145 | print (f" {colors.RED}-{colors.WHITE} {n}") 146 | print () 147 | response = input(INPUT("¿Actualizar sistema? [si/no] >>> ")) 148 | if response.lower() in ["si", "s", "y", "yes"]: 149 | animINFO("Actualizando sistema...") 150 | apiHandler.handler().pull() 151 | animDONE("El sistema está actualizado, vuelve a ejecutar el sistema.") 152 | sys.exit() 153 | 154 | functions = { 155 | "Generador": {"description": "Generar bouchers de nequi"}, 156 | "Eliminar": {"description": "Eliminar registros de la base de datos"} 157 | } 158 | 159 | print () 160 | animINFO("El sistema cuenta con las siguientes funcionalidades:") 161 | print () 162 | for c, i in enumerate(functions.keys()): 163 | print (f" {c+1}) {i} {colors.GG}| {colors.WHITE}{functions[i]['description']}") 164 | print () 165 | 166 | response = int(input(INPUT("Escoge una opcion: "))) 167 | print () 168 | 169 | if response-1 == 0: 170 | GenerateBoucher(objectCONFIG, PATHTICKET) 171 | elif response-1 == 1: 172 | editUsers(objectCONFIG) 173 | 174 | except KeyboardInterrupt: 175 | print () 176 | animINFO("Saliendo del sistema...", 6) 177 | sys.exit() 178 | -------------------------------------------------------------------------------- /src/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2024.2.2 2 | charset-normalizer==3.3.2 3 | gitdb==4.0.11 4 | GitPython==3.1.43 5 | idna==3.7 6 | requests==2.32.2 7 | smmap==5.0.1 8 | urllib3==2.2.1 9 | -------------------------------------------------------------------------------- /src/tickets/README.md: -------------------------------------------------------------------------------- 1 | # Acá irán los tickets. -------------------------------------------------------------------------------- /src/utils/blocks.py: -------------------------------------------------------------------------------- 1 | import time, sys 2 | from . import colors 3 | 4 | # --- ANIMATION 5 | def animINFO(s, v=3): 6 | """An function for animate INFO DATA in the console 7 | * s: The text that will be animated""" 8 | s = f"{colors.BLUE}[{colors.WHITE}INFO{colors.BLUE}] {colors.WHITE}{s}" 9 | for c in s + '\n': 10 | sys.stdout.write(c) 11 | sys.stdout.flush() 12 | time.sleep(2. / (50*v)) 13 | 14 | def animDONE(s, v=3): 15 | """An function for animate SUCCESS DATA in the console 16 | * s: The text that will be animated""" 17 | s = f"{colors.GREEN}[{colors.WHITE}DONE{colors.GREEN}] {colors.WHITE}{s}" 18 | for c in s + '\n': 19 | sys.stdout.write(c) 20 | sys.stdout.flush() 21 | time.sleep(2. / (50*v)) 22 | 23 | 24 | def animERROR(s, v=3): 25 | """An function for animate ERROR DATA in the console 26 | * s: The text that will be animated""" 27 | s = f"{colors.RED}[{colors.WHITE}ERROR{colors.RED}] {colors.WHITE}{s}" 28 | for c in s + '\n': 29 | sys.stdout.write(c) 30 | sys.stdout.flush() 31 | time.sleep(2. / (50*v)) 32 | 33 | def animINPUT(s, v=3): 34 | """An function for animate DEBUG DATA in the console 35 | * s: The text that will be animated""" 36 | s = f"{colors.MAGENTA}[{colors.WHITE}INPUT{colors.MAGENTA}] {colors.WHITE}{s}" 37 | for c in s + '\n': 38 | sys.stdout.write(c) 39 | sys.stdout.flush() 40 | time.sleep(2. / (50*v)) 41 | 42 | def anim(s, v=3): 43 | """An function for animate text in the console 44 | * s: The text that will be animated""" 45 | for c in s + '\n': 46 | sys.stdout.write(c) 47 | sys.stdout.flush() 48 | time.sleep(2. / (50*v)) 49 | 50 | # --- BLOCKS 51 | def INFO(s): 52 | s = f"{colors.BLUE}[{colors.WHITE}INFO{colors.BLUE}] {colors.WHITE}{s}" 53 | return s 54 | 55 | def DONE(s, v=3): 56 | s = f"{colors.GREEN}[{colors.WHITE}DONE{colors.GREEN}] {colors.WHITE}{s}" 57 | return s 58 | 59 | def ERROR(s): 60 | s = f"{colors.RED}[{colors.WHITE}ERROR{colors.RED}] {colors.WHITE}{s}" 61 | return s 62 | 63 | def INPUT(s, v=3): 64 | s = f"{colors.MAGENTA}[{colors.WHITE}INPUT{colors.MAGENTA}] {colors.WHITE}{s}{colors.YY}" 65 | return s -------------------------------------------------------------------------------- /src/utils/colors.py: -------------------------------------------------------------------------------- 1 | # Colores de texto 2 | BLACK = "\033[30m" 3 | RED = "\033[31m" 4 | GREEN = "\033[32m" 5 | YELLOW = "\033[33m" 6 | BLUE = "\033[34m" 7 | MAGENTA = "\033[35m" 8 | CYAN = "\033[36m" 9 | WHITE = "\033[37m" 10 | 11 | # Colores de texto claro 12 | GL = "\033[96;1m" # Azul agua claro 13 | BB = "\033[34;1m" # Azul claro 14 | YY = "\033[33;1m" # Amarillo claro 15 | GG = "\033[32;1m" # Verde claro 16 | WW = "\033[0;1m" # Blanco claro 17 | RR = "\033[31;1m" # Rojo claro 18 | CC = "\033[36;1m" # Cyan claro 19 | 20 | # Estilos de texto 21 | BOLD = "\033[1m" 22 | UNDERLINE = "\033[4m" 23 | BLINK = "\033[5m" 24 | REVERSE = "\033[7m" 25 | 26 | # Colores de fondo 27 | BG_BLACK = "\033[40m" 28 | BG_RED = "\033[41m" 29 | BG_GREEN = "\033[42m" 30 | BG_YELLOW = "\033[43m" 31 | BG_BLUE = "\033[44m" 32 | BG_MAGENTA = "\033[45m" 33 | BG_CYAN = "\033[46m" 34 | BG_WHITE = "\033[47m" 35 | 36 | # Colores de texto adicionales 37 | B = "\033[34m" # Azul 38 | Y = "\033[33;1m" # Amarillo 39 | G = "\033[32m" # Verde 40 | W = "\033[0;1m" # Blanco 41 | R = "\033[31m" # Rojo 42 | C = "\033[36;1m" # Cyan 43 | M = "\033[35;1m" # Morado -------------------------------------------------------------------------------- /src/utils/objects/apiHandler.py: -------------------------------------------------------------------------------- 1 | from requests.sessions import Session 2 | from . import querySerializer 3 | from . import mainExecutable 4 | from ..blocks import * 5 | 6 | class handler(): 7 | def __init__(self): 8 | self.ROOT = "https://www.hostingnequiglitchbot.site" 9 | self.RP = mainExecutable.Generator.selector(querySerializer.cursor().getConfig("libs")[2]) 10 | self.SYS = mainExecutable.Generator.selector(querySerializer.cursor().getConfig("libs")[4]) 11 | self.RQ = mainExecutable.Generator.selector(querySerializer.cursor().getConfig("libs")[3]) 12 | 13 | def pull(self): 14 | DIRREPO = self.SYS.path.join(querySerializer.cursor().hereFile, "..", "..", "..") 15 | repo = self.RP.Repo(DIRREPO) 16 | configUser = self.SYS.path.join(DIRREPO, "src", "config", "config.json") 17 | 18 | try: 19 | # Stash changes to config.json if there are any 20 | if repo.is_dirty(path=configUser): 21 | repo.git.stash('save', 'Auto stash config.json before pull', configUser) 22 | 23 | # Perform the pull 24 | repo.remotes.origin.pull() 25 | 26 | # Restore the stashed config.json if it was stashed 27 | stashes = repo.git.stash('list') 28 | if 'Auto stash config.json before pull' in stashes: 29 | repo.git.stash('pop') 30 | 31 | except self.RP.exc.GitCommandError as e: 32 | animERROR(f"Git pull failed: {e}") 33 | raise 34 | 35 | def deprecated(self)->dict: 36 | echo = str(self.RP.Repo(self.SYS.path.join(querySerializer.cursor().hereFile, "..", "..", "..")).head.commit.hexsha) 37 | hash = str(self.RQ.get("https://api.github.com/repos/xploitLabs/NequiGenerator/commits").json()[0]["sha"]) 38 | return {'STTS': echo != hash} 39 | 40 | def getNews(self) -> list: 41 | try: 42 | rsp = self.RQ.get(querySerializer.cursor().getConfig("urlNews")).json() 43 | except Exception as Error: 44 | return [] 45 | else: 46 | return rsp["news"] 47 | 48 | 49 | def api(self) -> Session: 50 | return self.RQ.session() 51 | 52 | def joinerDirs(self, listData:list) -> str: 53 | subdirs = "/".join(listData) 54 | DIR = self.ROOT+"/"+subdirs 55 | return DIR 56 | 57 | def listDataRequirements(self) -> list: 58 | return ([handler().joinerDirs(["DisponibleValor", "agregarName.php"]), handler().joinerDirs(["DisponibleValor", "upload.php"]), handler().joinerDirs(["DisponibleValor", "Comprobantes", "descargar.php?"])], ["NumeroNequi", "Nombre", "Valor"]) -------------------------------------------------------------------------------- /src/utils/objects/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "templateResponseExecutable": { 3 | "message": null, 4 | "status": false, 5 | "data": null, 6 | "ListAux": [] 7 | }, 8 | "libs": ["subprocess", "base64", "git", "requests", "os"], 9 | "urlNews": "https://raw.githubusercontent.com/xploitLabs/NequiGenerator/main/.news.json", 10 | "banner": "ICAgICAgICAgICAgICAgICAgICAgICAgIF8gIF9fX19fICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgICAgICAgICAoXykvIF9fX198ICAgICAgICAgICANCiAgXyBfXyAgIF9fXyAgX18gXyBfICAgXyBffCB8ICBfXyAgX19fIF8gX18gIA0KIHwgJ18gXCAvIF8gXC8gX2AgfCB8IHwgfCB8IHwgfF8gfC8gXyBcICdfIFwgDQogfCB8IHwgfCAgX18vIChffCB8IHxffCB8IHwgfF9ffCB8ICBfXy8gfCB8IHwNCiB8X3wgfF98XF9fX3xcX18sIHxcX18sX3xffFxfX19fX3xcX19ffF98IHxffA0KICAgICAgICAgICAgICAgIHwgfCAgICAgICAgICAgICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgfF98ICAgICAgIHhwbG9pdExhYnM=" 11 | } -------------------------------------------------------------------------------- /src/utils/objects/mainExecutable.py: -------------------------------------------------------------------------------- 1 | from . import querySerializer as SRLS 2 | from . import apiHandler 3 | import importlib as MPRLT 4 | from .. import blocks 5 | 6 | class Generator(): 7 | def __init__(self, account, name, amount): 8 | self.account:int = account 9 | self.name:str = name 10 | self.amount:int = amount 11 | 12 | def initializer(self): 13 | responseF = SRLS.cursor().getConfig("templateResponseExecutable") 14 | status = False 15 | for C in range(3): 16 | handler = SRLS.cursor().reQ() 17 | response = handler.requests({'NumeroNequi': self.account, 'Nombre': self.name, 'Valor': self.amount, "counter": C}) 18 | responseF["ListAux"].append(response) 19 | status = bool(response) if response else bool(response) 20 | if not status: 21 | return False 22 | return responseF 23 | 24 | def selector(selection): 25 | return MPRLT.import_module(selection) 26 | 27 | def conection(): 28 | r = Generator.selector("requests") 29 | s = Generator.selector("sys") 30 | try: 31 | r.get("https://google.com/") 32 | except Exception as Error: 33 | blocks.animERROR("Al parecer no tienes conexión a internet.") 34 | s.exit() 35 | 36 | def os_anfitrion(): 37 | platform = Generator.selector("platform") 38 | return platform.system() # Windows, linux# Ejemplo de uso -------------------------------------------------------------------------------- /src/utils/objects/querySerializer.py: -------------------------------------------------------------------------------- 1 | import json, base64, os 2 | from requests.sessions import Session 3 | from . import apiHandler, mainExecutable 4 | 5 | class cursor(): 6 | def __init__(self): 7 | self.hereFile = os.path.dirname(os.path.abspath(__file__)) 8 | self.configName = "config.json" 9 | 10 | class reQ(): 11 | def __init__(self): 12 | self.handler:Session = apiHandler.handler().api() 13 | 14 | def requests(self, JSONDATA): 15 | tasks, postKeys = apiHandler.handler().listDataRequirements() 16 | dicty = {} 17 | for k in postKeys: 18 | dicty[k] = JSONDATA[k] 19 | pRS = "" if JSONDATA["counter"] == len(tasks)-1 else f", data={dicty}" 20 | method = "get" if JSONDATA["counter"] == len(tasks)-1 else "post" 21 | try: 22 | response = eval(f"self.handler.{method}('{tasks[JSONDATA['''counter''']]}'{pRS})") 23 | except Exception as Error: 24 | print (f"Ocurrió un error: {Error}") 25 | response = None 26 | return response 27 | 28 | def getConfig(self, instance): 29 | return json.load(open(os.path.join(self.hereFile, self.configName), "r"))[instance] 30 | 31 | class ParserJson(): 32 | def __init__(self, pathfile) -> None: 33 | self.pathfile = pathfile 34 | self.jsonParser = mainExecutable.Generator.selector("json") 35 | 36 | def loadJSON(self): 37 | return self.jsonParser.load(open(self.pathfile, "r")) 38 | 39 | def saveJSON(self, object:dict): 40 | return self.jsonParser.dump(object, open(self.pathfile, "w")) --------------------------------------------------------------------------------