示例#1
0
def scan(video_file: str, locale: str = 'en-us') -> ScanResult:
    """Scans a video of scrolling through music list and returns all songs found."""
    song_covers = parse_video(video_file)
    song_names = match_songs(song_covers)
    results = translate_names(song_names, locale)

    return ScanResult(
        mode=ScanMode.MUSIC,
        items=results,
        locale=locale.replace('auto', 'en-us'),
    )
示例#2
0
def scan(video_file: str, locale: str = 'en-us') -> ScanResult:
    """Scans a video of scrolling through storage returns all items found."""
    item_images = parse_video(video_file)
    item_names = match_items(item_images)
    results = translate_names(item_names, locale)

    return ScanResult(
        mode=ScanMode.STORAGE,
        items=results,
        locale=locale.replace('auto', 'en-us'),
    )
示例#3
0
def scan(video_file: str, locale: str = 'en-us') -> ScanResult:
    """Scans a video of scrolling through Critterpedia and returns all critters found."""
    critter_icons = parse_video(video_file)
    critter_names = match_critters(critter_icons)
    results = translate_names(critter_names, locale)

    return ScanResult(
        mode=ScanMode.CRITTERS,
        items=results,
        locale=locale.replace('auto', 'en-us'),
    )
示例#4
0
def scan_recipes(video_file: str, locale: str = 'en-us') -> ScanResult:
    """Scans a video of scrolling through DIY list and returns all recipes found."""
    recipe_cards = parse_video(video_file)
    recipe_names = match_recipes(recipe_cards)
    results = translate_names(recipe_names, locale)

    return ScanResult(
        mode=ScanMode.RECIPES,
        items=results,
        locale=locale.replace('auto', 'en-us'),
    )
def scan(image_file: str, locale: str = 'en-us') -> ScanResult:
    """Scans an image of reactions list and returns all reactions found."""
    reaction_icons = parse_image(image_file)
    reaction_names = match_reactions(reaction_icons)
    results = translate_names(reaction_names, locale)

    return ScanResult(
        mode=ScanMode.REACTIONS,
        items=results,
        locale=locale.replace('auto', 'en-us'),
    )
示例#6
0
def scan(video_file: str, locale: str = 'en-us', for_sale: bool = False) -> ScanResult:
    """Scans a video of scrolling through a catalog and returns all items found."""
    item_rows = parse_video(video_file, for_sale)
    locale = _detect_locale(item_rows, locale)
    item_names = run_ocr(item_rows, lang=LOCALE_MAP[locale])
    results, unmatched = match_items(item_names, locale)

    return ScanResult(
        mode=ScanMode.CATALOG,
        items=results,
        locale=locale,
        unmatched=unmatched,
    )