mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
md5
This commit is contained in:
parent
88bb90aa92
commit
01f48c58a6
1 changed files with 17 additions and 13 deletions
|
|
@ -10,7 +10,6 @@ from __future__ import annotations
|
||||||
from urllib.request import Request, urlopen, urlretrieve
|
from urllib.request import Request, urlopen, urlretrieve
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from os import getcwd, remove
|
from os import getcwd, remove
|
||||||
from zipfile import ZipFile
|
|
||||||
from bauiv1lib.popup import PopupWindow
|
from bauiv1lib.popup import PopupWindow
|
||||||
from babase._mgen.enums import TimeType
|
from babase._mgen.enums import TimeType
|
||||||
|
|
||||||
|
|
@ -22,6 +21,7 @@ import json
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
import shutil
|
import shutil
|
||||||
|
import hashlib
|
||||||
import babase
|
import babase
|
||||||
import _babase
|
import _babase
|
||||||
import bascenev1 as bs
|
import bascenev1 as bs
|
||||||
|
|
@ -42,15 +42,17 @@ if ANDROID: # !can add ios in future
|
||||||
# Installing websocket
|
# Installing websocket
|
||||||
def get_module():
|
def get_module():
|
||||||
install_path = Path(f"{getcwd()}/ba_data/python") # For the guys like me on windows
|
install_path = Path(f"{getcwd()}/ba_data/python") # For the guys like me on windows
|
||||||
path = Path(f"{install_path}/websocket.zip")
|
path = Path(f"{install_path}/websocket.tar.gz")
|
||||||
file_path = Path(f"{install_path}/websocket")
|
file_path = Path(f"{install_path}/websocket")
|
||||||
source_dir = Path(f"{install_path}/websocket-client-1.6.1/websocket")
|
source_dir = Path(f"{install_path}/websocket-client-1.6.1/websocket")
|
||||||
if not file_path.exists():
|
if not file_path.exists():
|
||||||
url = "https://github.com/websocket-client/websocket-client/archive/refs/tags/v1.6.1.zip"
|
url = "https://files.pythonhosted.org/packages/b1/34/3a5cae1e07d9566ad073fa6d169bf22c03a3ba7b31b3c3422ec88d039108/websocket-client-1.6.1.tar.gz"
|
||||||
try:
|
try:
|
||||||
filename, headers = urlretrieve(url, filename=path)
|
filename, headers = urlretrieve(url, filename=path)
|
||||||
with ZipFile(filename) as f:
|
with open(filename, "rb") as f:
|
||||||
f.extractall(install_path)
|
content = f.read()
|
||||||
|
assert hashlib.md5(content).hexdigest() == "86bc69b61947943627afc1b351c0b5db"
|
||||||
|
shutil.unpack_archive( filename, install_path)
|
||||||
shutil.copytree(source_dir, file_path)
|
shutil.copytree(source_dir, file_path)
|
||||||
shutil.rmtree(Path(f"{install_path}/websocket-client-1.6.1"))
|
shutil.rmtree(Path(f"{install_path}/websocket-client-1.6.1"))
|
||||||
remove(path)
|
remove(path)
|
||||||
|
|
@ -223,15 +225,17 @@ if not ANDROID:
|
||||||
# installing pypresence
|
# installing pypresence
|
||||||
def get_module():
|
def get_module():
|
||||||
install_path = Path(f"{getcwd()}/ba_data/python")
|
install_path = Path(f"{getcwd()}/ba_data/python")
|
||||||
path = Path(f"{install_path}/pypresence.zip")
|
path = Path(f"{install_path}/pypresence.tar.gz")
|
||||||
file_path = Path(f"{install_path}/pypresence")
|
file_path = Path(f"{install_path}/pypresence")
|
||||||
source_dir = Path(f"{install_path}/pypresence-4.3.0/pypresence")
|
source_dir = Path(f"{install_path}/pypresence-4.3.0/pypresence")
|
||||||
if not file_path.exists():
|
if not file_path.exists():
|
||||||
url = "https://github.com/qwertyquerty/pypresence/archive/refs/tags/v4.3.0.zip"
|
url = "https://files.pythonhosted.org/packages/f4/2e/d110f862720b5e3ba1b0b719657385fc4151929befa2c6981f48360aa480/pypresence-4.3.0.tar.gz"
|
||||||
try:
|
try:
|
||||||
filename, headers = urlretrieve(url, filename=path)
|
filename, headers = urlretrieve(url, filename=path)
|
||||||
with ZipFile(filename) as f:
|
with open(filename, "rb") as f:
|
||||||
f.extractall(install_path)
|
content = f.read()
|
||||||
|
assert hashlib.md5(content).hexdigest() == "f7c163cdd001af2456c09e241b90bad7"
|
||||||
|
shutil.unpack_archive( filename, install_path)
|
||||||
shutil.copytree(source_dir, file_path)
|
shutil.copytree(source_dir, file_path)
|
||||||
shutil.rmtree(Path(f"{install_path}/pypresence-4.3.0"))
|
shutil.rmtree(Path(f"{install_path}/pypresence-4.3.0"))
|
||||||
remove(path)
|
remove(path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue