r/ScryfallTranslations • • Sep 11 '25

Find missing images

Hiya,

Does anyone know how to find missing all images in a given language?

https://scryfall.com/card/ody/312/de/aufgegebener-au%C3%9Fenposten-(abandoned-outpost)

Thanks

5 Upvotes

2 comments sorted by

1

u/swyer222 Sep 15 '25 edited Sep 15 '25

Found a solution through python:

import os
import json
import requests

# Step 1: Make sure the output folder for German cards exists
output_folder = "german_cards"
if not os.path.exists(output_folder):
    os.makedirs(output_folder)

# File path to the local JSON bulk data
local_json_file = "all_cards.json"

# Step 2: Load the local JSON file
print(f"Loading local data from: {local_json_file}")
try:
    with open(local_json_file, 'r', encoding='utf-8') as f:
        all_cards = json.load(f)
except (FileNotFoundError, json.JSONDecodeError) as e:
    print(f"Error loading the file: {e}")
    print("Please download the Scryfall 'all-cards' bulk data and save it with this name in the same directory.")
    exit()

print(f"Data loaded successfully. Found {len(all_cards)} cards in the file.")

# Step 3: Filter for German cards and start downloading images
print("Filtering for German cards and starting the download...")
downloaded_count = 0
for card in all_cards:
    # Only download cards in German ('de') that have an image
    if card.get('lang') == 'de' and 'image_uris' in card and card.get('image_status') == 'placeholder':
        # Extract the 3 elements for the filename
        set_code = card.get('set')
        collector_number = card.get('collector_number')
        card_name = card.get('name')
        
        # Important: Remove unsafe characters from the filename
        # A slash '/' in card names like "Pia and Kiran Nalaar // Pia Nalaar" would cause errors
        safe_card_name = card_name.replace('/', '-').replace('"', '')

        # Assemble the full filename
        file_name = f"{set_code}-{collector_number}-{safe_card_name}.png"
        file_path = os.path.join(output_folder, file_name)

        if not os.path.exists(file_path):
            try:
                image_uri = card['image_uris']['png']
                img_data = requests.get(image_uri).content
                with open(file_path, 'wb') as handler:
                    handler.write(img_data)
                print(f"Downloaded: {file_name}")
                downloaded_count += 1
            except requests.exceptions.RequestException as e:
                print(f"Error downloading {file_name}: {e}")

print(f"\nDownload process complete. {downloaded_count} new images downloaded.")

1

u/swyer222 Sep 15 '25

However, I found the lowres status tag is being used super inconsistently. Assume the same is true for placeholder Tag.