xtream1101 / humblebundle-downloader

Download you Humble Bundle Library
MIT License
541 stars 63 forks source link

Exception: Unable to download user-data, cookies missing? #50

Open jmporcelg opened 2 years ago

jmporcelg commented 2 years ago

Using Python 3.10 (virtualenv), installed hbd through pip.

Got error: Exception: Unable to download user-data, cookies missing?

Am I doing something wrong or this is just not working currently?

Please note I did a quick search (while logged into my Humble Bundle account, into Library) and I could not find the tag hbd is trying to find in the code.

   logger.debug("Library request: " + str(library_r))
        library_page = parsel.Selector(text=library_r.text)
        user_data = library_page.css('#user-home-json-data').xpath('string()').extract_first()  #i noqa: E501
        if user_data is None:
            raise Exception("Unable to download user-data, cookies missing?")
Romanmir commented 2 years ago

I exported the cookies from FF, converted them using curl (as in the docs), and I get the same message.

amoskvin commented 2 years ago

I ran into this also. The quotes in the cookie value are part of the value, so wrap it single quotes

hbd -s '"askdjasldj...asdljk"' -l library --progress
jmporcelg commented 2 years ago

I ran into this also. The quotes in the cookie value are part of the value, so wrap it single quotes

hbd -s '"askdjasldj...asdljk"' -l library --progress

I can confirm that works, thank you. This should be addressed in the code and/or documentation fixed.

XanderXAJ commented 2 years ago

I met the same Unable to download user-data, cookies missing? error and had the same thought to escape the quotes as above. Unfortunately, escaping didn't work for me using Python 3.10 on Windows via Powershell -- I still got the same error:

hbd -s '"coo...kie"' -l .\HumbleLibrary\ --progress
hbd -s "`"coo...kie"`" -l .\HumbleLibrary\ --progress

In the end I worked around it using an Ubuntu WSL installation that I had handy.

I'm not sure if someone more experienced with Powershell and Python on Windows would know why it didn't work for me?

dylanmtaylor commented 2 years ago

Wrapping the quote in single quotes worked for me

Toylerrr commented 2 years ago

"""KEY""" worked for me by the way

wildcardjoker commented 2 years ago

I had a similar issue, and it appears that the cookie value was old, and would no longer work.

In my case, I copied the data from another browser on a different computer, which had two _simpleauth_sess cookie values: image

I chose the most recent value, pasted it into the command on another machine, and everything started magically working.

Aviv-Galmidi commented 2 years ago

@Toylerrr Suggested double escaping and it worked for me. I'm on windows with Python 3.10.2

hbd -s """cookie_value""" -l ...

@XanderXAJ Might want to try it as well

XanderXAJ commented 2 years ago

@Aviv-Galmidi Sadly, that doesn't work for me in Powershell 5.1 and 7.2.1. But...

However, it does work in Command Prompt! That an easier and more accessible workaround than using WSL like I did before. 😄

jdougan commented 2 years ago

I tried all of the above on a Cygwin installation and it didn't work until I cleared ALL the humble bundle cookies and got a new session key from a fresh login. (I used the single quotes around the key)

GaetanLhoest commented 1 year ago

I encountered this issue as the cookie value I passed was false: the copy of the value of the cookie in my browser only took a part of the value.