From 5fa251ae3a4a27b83647ae9685e688b4d3a78caa Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 19 Sep 2020 11:06:35 +0200 Subject: [PATCH] Added option for saving cover description as UTF8 --- deemix/__init__.py | 2 +- deemix/app/settings.py | 3 ++- deemix/utils/taggers.py | 6 +++--- setup.py | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/deemix/__init__.py b/deemix/__init__.py index b2b83cd..16de60a 100644 --- a/deemix/__init__.py +++ b/deemix/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 -__version__ = "1.3.12" +__version__ = "1.3.13" diff --git a/deemix/app/settings.py b/deemix/app/settings.py index 37b7cb2..a3b3882 100644 --- a/deemix/app/settings.py +++ b/deemix/app/settings.py @@ -92,7 +92,8 @@ class Settings: "useNullSeparator": False, "saveID3v1": True, "multiArtistSeparator": "default", - "singleAlbumArtist": False + "singleAlbumArtist": False, + "coverDescriptionUTF8": False } } diff --git a/deemix/utils/taggers.py b/deemix/utils/taggers.py index 959942e..1483bf2 100644 --- a/deemix/utils/taggers.py +++ b/deemix/utils/taggers.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from mutagen.flac import FLAC, Picture from mutagen.id3 import ID3, ID3NoHeaderError, TXXX, TIT2, TPE1, TALB, TPE2, TRCK, TPOS, TCON, TYER, TDAT, TLEN, TBPM, \ - TPUB, TSRC, USLT, SYLT, APIC, IPLS, TCOM, TCOP, TCMP + TPUB, TSRC, USLT, SYLT, APIC, IPLS, TCOM, TCOP, TCMP, Encoding # Adds tags to a MP3 file def tagID3(stream, track, save): @@ -63,7 +63,7 @@ def tagID3(stream, track, save): if track.lyrics['unsync'] and save['lyrics']: tag.add(USLT(text=track.lyrics['unsync'])) if track.lyrics['syncID3'] and save['syncedLyrics']: - tag.add(SYLT(3, format=2, type=1, text=track.lyrics['syncID3'])) + tag.add(SYLT(Encoding.UTF8, format=2, type=1, text=track.lyrics['syncID3'])) involved_people = [] for role in track.contributors: @@ -83,7 +83,7 @@ def tagID3(stream, track, save): if save['cover'] and track.album['picPath']: with open(track.album['picPath'], 'rb') as f: tag.add( - APIC(0, 'image/jpeg' if track.album['picPath'].endswith('jpg') else 'image/png', 3, desc='cover', data=f.read())) + APIC(Encoding.UTF8 if save['coverDescriptionUTF8'] else Encoding.LATIN1, 'image/jpeg' if track.album['picPath'].endswith('jpg') else 'image/png', 3, desc='cover', data=f.read())) tag.save(stream, v1=2 if save['saveID3v1'] else 0, v2_version=3, v23_sep=None if save['useNullSeparator'] else '/') diff --git a/setup.py b/setup.py index 5ba6bde..6065784 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text() setup( name="deemix", - version="1.3.12", + version="1.3.13", description="A barebone deezer downloader library", long_description=README, long_description_content_type="text/markdown",