Updates en varios scripts

This commit is contained in:
2024-02-12 12:51:38 +01:00
parent 8d19fe49b6
commit 5be581b48f
3 changed files with 30 additions and 11 deletions
+1
View File
@@ -39,6 +39,7 @@ for i in /etc/cron.*; do
rsync -avh --delete "$i" "${TARGET_SYSTEM_FILES}"/ | tee -a "${LOG}"
done
rsync -avh --delete /etc/fstab "${TARGET_SYSTEM_FILES}"/ | tee -a "${LOG}"
rsync -avh --delete /etc/crontab "${TARGET_SYSTEM_FILES}"/ | tee -a "${LOG}"
## Backup de ficheros
FILES=".gitconfig .git-credentials"
+11 -7
View File
@@ -82,10 +82,14 @@ def read_msg(offset):
os.remove(input_audio)
size = round(os.path.getsize(output_media) / 1024 / 1024, 2)
if size > 50:
#if size > 50:
# send_message(i["message"]["from"]["id"], 'Done! ' + str(size) + 'MB')
#else:
# send_video(i["message"]["from"]["id"], output_media)
send_message(i["message"]["from"]["id"], 'Done! ' + str(size) + 'MB')
else:
send_video(i["message"]["from"]["id"], output_media)
#send_video(i["message"]["from"]["id"], output_media)
except:
pass
@@ -121,23 +125,23 @@ def send_message(user, message):
def send_audio(user, audio):
base_url_audio = base_url + '/sendAudio'
audio = open(audio, 'rb')
audio2 = open(audio, 'rb')
data = {
"chat_id": user
}
files = {
"audio": audio
"audio": audio2
}
resp = requests.get(base_url_audio, data=data, files=files)
def send_video(user, video):
base_url_video = base_url + '/sendVideo'
video = open(video, 'rb')
video2 = open(video, 'rb')
data = {
"chat_id": user
}
files = {
"video": video
"video": video2
}
resp = requests.get(base_url_video, data=data, files=files)
+17 -3
View File
@@ -22,6 +22,7 @@ def normalize_path(path):
# Inicialización de las opciones
ignore_list = ["DECO Cassette", "Bootleg", "prototype", "Quiz", "Mahjong", "Demo"]
ignore_system = ["neogeo"]
# Obtiene los argumentos
parser = argparse.ArgumentParser(
@@ -99,11 +100,12 @@ if args.list and args.manufacturer != None:
manufacturer = game.getElementsByTagName("manufacturer")[0]
description = game.getElementsByTagName("description")[0]
if (
manufacturer.firstChild.data == args.manufacturer
(manufacturer.firstChild.data == args.manufacturer
or args.manufacturer == 'all')
and not cloneof
and not isbios
):
print(description.firstChild.data)
print(description.firstChild.data, '==>', game.getAttribute("name") + ".zip from", manufacturer.firstChild.data)
# Copia los juegos del desarrollador seleccionado
if (
@@ -127,6 +129,7 @@ if (
name = game.getAttribute("name") + ".zip"
cloneof = game.getAttribute("cloneof")
isbios = game.getAttribute("isbios")
romof = game.getAttribute("romof")
manufacturer = game.getElementsByTagName("manufacturer")[0]
description = game.getElementsByTagName("description")[0]
driver = game.getElementsByTagName("driver")
@@ -146,6 +149,11 @@ if (
ignored_games.append(description.firstChild.data)
isignored = True
for ignore_element in ignore_system:
if ignore_element.casefold() in romof.casefold():
ignored_games.append(description.firstChild.data)
isignored = True
if not isignored:
src = os.path.join(args.input, name)
if args.sort:
@@ -163,7 +171,7 @@ if (
if os.path.isfile(src):
shutil.copyfile(src, dst)
copied_games.append(description.firstChild.data)
print(description.firstChild.data)
print(description.firstChild.data, '==>', game.getAttribute("name") + ".zip")
else:
notfound.append(description.firstChild.data)
@@ -196,6 +204,7 @@ if (
name = game.getAttribute("name") + ".zip"
cloneof = game.getAttribute("cloneof")
isbios = game.getAttribute("isbios")
romof = game.getAttribute("romof")
manufacturer = game.getElementsByTagName("manufacturer")[0]
description = game.getElementsByTagName("description")[0]
driver = game.getElementsByTagName("driver")
@@ -211,6 +220,11 @@ if (
ignored_games.append(description.firstChild.data)
isignored = True
for ignore_element in ignore_system:
if ignore_element.casefold() in romof.casefold():
ignored_games.append(description.firstChild.data)
isignored = True
if not isignored:
src = os.path.join(args.input, name)
if args.sort: