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