From d35f94f05e91f276d6d4ed0705e4da199303cbcf Mon Sep 17 00:00:00 2001 From: Sergio Date: Wed, 6 Sep 2023 09:56:16 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20get=5Fscr.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_scr.sh | 16 ++++++++++++++++ zxdb.py | 22 ++++++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100755 get_scr.sh diff --git a/get_scr.sh b/get_scr.sh new file mode 100755 index 0000000..26cad8b --- /dev/null +++ b/get_scr.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Script para pasar todos los ficheros scr de una ubicación +# a otra y convertirlos a gif y cambiarles el tamaño + +SRC=/home/sergio/zx/zxdb/games +DST=/home/sergio/zx/scr_packs/zosya + +if [ ! -d ${DST} ]; then + mkdir -p ${DST} +fi +rm ${DST}/* +find ${SRC} -type f -iname "*.scr" -exec cp -v {} ${DST} \; +scr2gif -f ${DST}/*.scr +rm ${DST}/*.scr +mogrify -verbose -scale 768x576 ${DST}/*.gif \ No newline at end of file diff --git a/zxdb.py b/zxdb.py index d40d72e..240af62 100644 --- a/zxdb.py +++ b/zxdb.py @@ -20,8 +20,8 @@ url_prefix = { destination_path = r"/home/sergio/zx/zxdb/games/" cache_path = r"/home/sergio/zx/zxdb/cache/games/" temp_file = r"/tmp/zxdb.download.tmp" -wait = False # Establece una pausa aleatoria entre descargas -min_wait = 1 # Segundos mínimos a esperar entre descargas +wait = True # Establece una pausa aleatoria entre descargas +min_wait = 2 # Segundos mínimos a esperar entre descargas max_wait = min_wait + 1 # Segundos máximos a esperar entre descargas elements = [] filetypes_on_root = [ @@ -69,12 +69,17 @@ def select3(cursor): p.release_seq = r.release_seq) WHERE (e.availabletype_id = 'A' OR e.availabletype_id = 'D') AND - f.text <> 'Remote link' AND + (f.text <> 'Remote link' AND f.text <> '?') AND r.release_seq = 0 AND + l.name like 'ZOSYA%' AND (g.text like '%Game:%' AND g.text not like 'Casual%') ORDER BY e.title;""" + #(r.release_year >= '1986' AND r.release_year <= '1991') AND + #l.name in ('Dinamic Software', 'Aventuras AD S.A.', 'Arcadia Soft', 'Creepsoft', 'Dro Soft', 'Erbe Software S.A.', 'Iber Software', 'MCM Software S.A.', 'Made in Spain', 'New Frontier', 'Opera Soft S.A.', 'System 4', 'Topo Soft', 'Zigurat Software') AND #(l.country_id = 'ES' AND l.labeltype_id = 'Z') AND + #l.name in ('Ocean Software Ltd', 'Imagine Software Ltd', 'Palace Software', 'Gremlin Graphics Software Ltd', 'Elite Systems Ltd', 'Melbourne House', 'Ultimate Play The Game', 'Durell Software Ltd', 'Codemasters Ltd') AND + #e.title = 'Arkanoid - Revenge of Doh' AND cursor.execute(query) for row in cursor: element = dict( @@ -127,6 +132,7 @@ def process_elements(): + elements[i]["developer"] + ")" ) + elements[i]["root_folder"] = normalize_path(elements[i]["root_folder"]) # Obtiene el nombre del fichero a partir de la url de descarga elements[i]["file_name"] = url_filename(elements[i]["url"]) @@ -223,6 +229,13 @@ def get_files(): if game_folder != last_game_folder: print("\n{}".format(game_folder)) last_game_folder = game_folder + + #print( + # "(WORKING : {} ({})".format( + # element["file_name"], + # element["filetype"] + # ) + #) # Comprueba si ya existe el fichero a descargar if not os.path.isfile(destination_file) and ( @@ -314,7 +327,8 @@ def main(): connect() process_elements() - # for element in elements: + #for element in elements: + # print('') # for key, value in element.items(): # print(key, ':', value)