from eyed3.utils import guessMimetype from eyed3.plugins import LoaderPlugin from eyed3.core import VARIOUS_ARTISTS from eyed3.id3.frames import ImageFrame from eyed3.utils import makeUniqueFileName from eyed3.utils.console import printMsg, printWarning, cformat, Fore DESCR_FNAME_PREFIX = "filename: " md5_file_cache = {} _have_PIL = False try: import PIL # noqa _have_PIL = True except ImportError: log.info("Install `pillow` and get images details.") _have_lastfm = False try: from eyed3.plugins.lastfm import getAlbumArt import requests _have_lastfm = True except ImportError: log.info("Install `pylast` and activate the --download option") class ArtFile(object): def __init__(self, file_path): self.art_type = art.matchArtFile(file_path) self.file_path = file_path self.id3_art_type = (art.TO_ID3_ART_TYPES[self.art_type][0]
import eyed3.plugins from eyed3 import log from eyed3.plugins.jsontag import audioFileToJson _have_yaml = False try: import ruamel.yaml as yaml _have_yaml = True except ImportError: try: import yaml _have_yaml = True except ImportError: log.info( "yaml plugin: Install `ruamel.yaml` or `pyyaml` for YAML support.") if _have_yaml: class YamlTagPlugin(eyed3.plugins.LoaderPlugin): NAMES = ["yaml"] SUMMARY = "Outputs all tags as YAML." def __init__(self, arg_parser): super().__init__(arg_parser, cache_files=True, track_images=False) def handleFile(self, f, *args, **kwargs): super().handleFile(f) if self.audio_file and self.audio_file.info and self.audio_file.tag: print( yaml.safe_dump(audioFileToJson(self.audio_file), indent=2,