Yetangitu / Spodcast

Spodcast is a caching Spotify podcast to RSS proxy. Using Spodcast you can follow Spotify-hosted netcasts/podcasts using any player which supports RSS, thus enabling the use of older hardware which is not compatible with the Spotify (web) app.
GNU General Public License v3.0
359 stars 14 forks source link

Openssl error when following examples #12

Closed ssstankly closed 2 years ago

ssstankly commented 2 years ago

Screenshot_20220616-025843_JuiceSSH How am I blowing this?

Yetangitu commented 2 years ago

Your Python version is 'too old', the 2-argument version of hashlib.md5 was introduced in 3.9:

(https://docs.python.org/3.9/library/hashlib.html):

Changed in version 3.9: All hashlib constructors take a keyword-only argument usedforsecurity with default value True. A false value allows the use of insecure and blocked hashing algorithms in restricted environments. False indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function.

Either update Python to something more current (3.10 is current, 3.9 would work as well) or remove the second parameter:

--- spodcast/spodcast/spodcast.py.org   2022-06-17 21:24:16.344970958 +0000
+++ spodcast/spodcast/spodcast.py   2022-06-17 21:24:34.076795874 +0000
@@ -58,7 +58,7 @@ class Spodcast:
         cred_directory = Config.get_config_dir()
         if os.path.isdir(cred_directory):
             (username,password) = line.split()
-            cred_filename = CREDENTIALS_PREFIX + "-" + hashlib.md5(username.encode('utf-8'),usedforsecurity=False).hexdigest() + ".json"
+            cred_filename = CREDENTIALS_PREFIX + "-" + hashlib.md5(username.encode('utf-8')).hexdigest() + ".json"
             cred_location = os.path.join(cred_directory, cred_filename)
             conf = Session.Configuration.Builder().set_stored_credential_file(cred_location).build()
             session = Session.Builder(conf).user_pass(username, password).create()