mirror of
https://github.com/nathom/streamrip.git
synced 2024-09-19 11:18:45 -04:00
Fix sort issue with new hash function #270
This commit is contained in:
parent
ad70d6bc56
commit
eba4d451a9
2 changed files with 12 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
"""streamrip: the all in one music downloader."""
|
||||
|
||||
__version__ = "1.0"
|
||||
__version__ = "1.9"
|
||||
|
||||
from . import clients, constants, converter, downloadtools, media
|
||||
|
|
|
@ -2302,12 +2302,17 @@ def _choose_and_download_cover(
|
|||
) -> str:
|
||||
# choose optimal cover size and download it
|
||||
|
||||
def sorted_list(x: Iterable) -> list:
|
||||
xlist = list(x)
|
||||
xlist.sort()
|
||||
return xlist
|
||||
|
||||
hashcode: str = hashlib.md5(str(sorted_list(cover_urls.values())).encode('utf-8', errors='replace')).hexdigest()
|
||||
hashcode: str = hashlib.md5(
|
||||
"".join(
|
||||
sorted(
|
||||
map(
|
||||
str,
|
||||
cover_urls.values(),
|
||||
)
|
||||
)
|
||||
).encode("utf-8", errors="ignore")
|
||||
).hexdigest()
|
||||
# hashcode: str = hashlib.md5(str(sorted_list(cover_urls.values())).encode('utf-8', errors='replace')).hexdigest()
|
||||
|
||||
temp_cover_path = os.path.join(gettempdir(), f"cover_{hashcode}.jpg")
|
||||
|
||||
|
|
Loading…
Reference in a new issue