python - Enable proxy support of pyLast -


i want enable proxy, found method named enable_proxy, when this:

network = pylast.lastfmnetwork(api_key = api_key, api_secret = api_secret, username = username, password_hash = password_hash)  network.enable_proxy("http//...", 8080) 

i network error: [errno 11004] getaddrinfo failed, because call of pylast.lastfmnetwork tries generate network session key. how can enable proxy support of pylast? don't find example.

if don't need scrobble, can create network object without session key omitting username/password hash, here:

like this:

network = pylast.lastfmnetwork(api_key, api_secret) if proxy_enabled:     network.enable_proxy(host = proxy_host, port = proxy_port) 

do need scrobble? if so, try after enabling proxy:

network.username = my_username network.password_hash = my_password_hash sk_gen = sessionkeygenerator(network) network.session_key = sk_gen.get_session_key(my_username, my_password_hash) 

note: httplib.httpconnection doesn't support authentication, if don't have authenticate yourself, second 1 should work (with latest github version of pylast; there's bug fix not yet released).

see also: https://github.com/pylast/pylast/issues/103


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -