mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-07 10:04:49 -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."""
|
"""streamrip: the all in one music downloader."""
|
||||||
|
|
||||||
__version__ = "1.0"
|
__version__ = "1.9"
|
||||||
|
|
||||||
from . import clients, constants, converter, downloadtools, media
|
from . import clients, constants, converter, downloadtools, media
|
||||||
|
|
|
@ -2302,12 +2302,17 @@ def _choose_and_download_cover(
|
||||||
) -> str:
|
) -> str:
|
||||||
# choose optimal cover size and download it
|
# choose optimal cover size and download it
|
||||||
|
|
||||||
def sorted_list(x: Iterable) -> list:
|
hashcode: str = hashlib.md5(
|
||||||
xlist = list(x)
|
"".join(
|
||||||
xlist.sort()
|
sorted(
|
||||||
return xlist
|
map(
|
||||||
|
str,
|
||||||
hashcode: str = hashlib.md5(str(sorted_list(cover_urls.values())).encode('utf-8', errors='replace')).hexdigest()
|
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")
|
temp_cover_path = os.path.join(gettempdir(), f"cover_{hashcode}.jpg")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue