From 2d35001793e2bfe6b466a6b521c5b0f226bb1cd9 Mon Sep 17 00:00:00 2001 From: nathom Date: Tue, 20 Apr 2021 09:48:39 -0700 Subject: [PATCH] Fix #58 and #59 --- README.md | 8 ++++++-- streamrip/clients.py | 1 + streamrip/config.py | 2 -- streamrip/metadata.py | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ffdd40..747ffeb 100644 --- a/README.md +++ b/README.md @@ -128,12 +128,15 @@ the descriptions of the fields. They can also be found inside the file, which can be accessed with `rip config --open`. ```yaml -qobuz: + qobuz: quality: '1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96' + download_booklets: 'This will download booklet pdfs that are included with some albums' + password: 'This is an md5 hash of the plaintext password' app_id: 'Do not change' secrets: 'Do not change' tidal: - quality: '0, 1, 2, or 3' + quality: '0: 256kbps AAC, 1: 320kbps AAC, 2: 16/44.1 "HiFi" FLAC, 3: 24/44.1 "MQA" FLAC' + download_videos: 'This will download videos included in Video Albums.' user_id: 'Do not change any of the fields below' token_expiry: 'Tokens last 1 week after refresh. This is the Unix timestamp of the expiration time.' deezer: "Deezer doesn't require login" @@ -163,6 +166,7 @@ qobuz: lastfm: 'Last.fm playlists are downloaded by searching for the titles of the tracks' source: 'The source on which to search for the tracks.' concurrent_downloads: 'Download (and convert) tracks all at once, instead of sequentially. If you are converting the tracks, and/or have fast internet, this will substantially improve processing speed.' + ``` diff --git a/streamrip/clients.py b/streamrip/clients.py index 7c275c9..cda836d 100644 --- a/streamrip/clients.py +++ b/streamrip/clients.py @@ -13,6 +13,7 @@ from .constants import ( AGENT, AVAILABLE_QUALITY_IDS, DEEZER_BASE, + DEEZER_DL, DEEZER_MAX_Q, QOBUZ_BASE, QOBUZ_FEATURED_KEYS, diff --git a/streamrip/config.py b/streamrip/config.py index 094db84..cf6e066 100644 --- a/streamrip/config.py +++ b/streamrip/config.py @@ -3,7 +3,6 @@ import copy import logging import os import re -from functools import cache from pprint import pformat from ruamel.yaml import YAML @@ -310,7 +309,6 @@ class ConfigDocumentation: # key, doc pairs are unique self.docs.remove(to_remove) - @cache def _get_key_regex(self, spaces, key): regex = rf"{spaces}{key}:(?:$|\s+?(.+))" return re.compile(regex) diff --git a/streamrip/metadata.py b/streamrip/metadata.py index be0f5ef..2a47048 100644 --- a/streamrip/metadata.py +++ b/streamrip/metadata.py @@ -333,6 +333,8 @@ class TrackMetadata: if self.__source == "qobuz": genres = re.findall(r"([^\u2192\/]+)", "/".join(self._genres)) genres = set(genres) + elif self.__source == 'deezer': + genres = ', '.join(g['name'] for g in self._genres) return ", ".join(genres)