import subprocess def run_gallery_dl(command): try: subprocess.run(command, check=True) except subprocess.CalledProcessError as e: print(f"An error occurred: {e}") def main(): input_file = "List.txt" try: with open(input_file, "r", encoding="utf-8") as file: user_ids = [line.strip() for line in file if line.strip().isdigit()] except FileNotFoundError: print(f"File '{input_file}' not found.") return for user_id in user_ids: url = f"https://www.pixiv.net/en/users/{user_id}" print(f"Processing: {url}") command = [ "gallery-dl.exe", "-d", ".", "--cookies", "cookies.txt", "--download-archive", "PixivArchive.sqlite3", url ] run_gallery_dl(command) if __name__ == "__main__": main()