mmarcincin / HB-DRM-free-bulk-downloader

powershell script for downloading humble bundle DRM-Free files
96 stars 13 forks source link

Key already claimed #6

Closed GiuseppeChillemi closed 3 years ago

GiuseppeChillemi commented 4 years ago

I have just received message running the script after the previous one hanged. Then I have closed and restarted everyting and the error wasn't there anymore.

GiuseppeChillemi commented 4 years ago

It happened again after the script had previously started giving error aftter the first downloaded bundle (written about this in another issue). I have closed the previous powershell, restarted the script and here is the log file whowing "Key already claimed"

HB DRM-Free bulk downloader 0.3.3 by https://github.com/mmarcincin

Download directory: \?\E:\HB-DRM-free-bulk-downloader-master\downloads

link: https://www.humblebundle.com/downloads?key=vK7**** preferred labels: none strict mode: disabled OS: default

1 / 14 - Humble Bundle - Key already claimed https://www.humblebundle.com/downloads?key=vK7****

============================================================== link: https://www.humblebundle.com/downloads?key=eMPd***** preferred labels: none strict mode: disabled OS: default Eccezione da HRESULT: 0x800A01B6 In E:\HB-DRM-free-bulk-downloader-master\HB-DRM-Free_download.ps1:99 car:10

Eccezione da HRESULT: 0x800A01B6 In E:\HB-DRM-free-bulk-downloader-master\HB-DRM-Free_download.ps1:109 car:3

============================================================== 2 / 14 - Humble Bundle - Key already claimed https://www.humblebundle.com/downloads?key=eMPd***

Eccezione da HRESULT: 0x800A01B6 In E:\HB-DRM-free-bulk-downloader-master\HB-DRM-Free_download.ps1:146 car:3

============================================================== link: https://www.humblebundle.com/downloads?key=V2vFq***** preferred labels: none strict mode: disabled OS: default Eccezione da HRESULT: 0x800A01B6 In E:\HB-DRM-free-bulk-downloader-master\HB-DRM-Free_download.ps1:99 car:10

Eccezione da HRESULT: 0x800A01B6 In E:\HB-DRM-free-bulk-downloader-master\HB-DRM-Free_download.ps1:109 car:3

mmarcincin commented 4 years ago

Key already claimed means you're not logged to Humble Bundle account (which has the bundle) in the Internet Explorer. From the version 0.3.4 README.md:

Possible Errors

If your bundle haven't started downloading at all for 1+ min, open Internet Explorer and go to https://www.humblebundle.com/ Try to click on the dropdown menu button in top right corner, it doesn't respond most likely. You also can't see any bundles on the front page.

To make it work, follow these steps:

  1. Open Internet Explorer, press alt (the toolbar will show up), go to Tools > Internet Options > Security Tab(at the top) > Trusted sites
    • move the vertical bar to the bottom (Low option)
    • click on Sites button and add 'https://www.humblebundle.com/' into the list (otherwise the site would load only partially)
  2. Enable Protected Mode for Trusted sites (ReadyState was blank when this was disabled so script was stuck).
  3. It's possible you'll get logged out of Humble Bundle after changing to Protected Mode so just login there again.

My script loads IE instance only for links and once the download starts, the IE instance should be already closed. Killing Internet Explorer instances might help if you encountered problems before it started working.

The fastest way to do it is to run this 'stop process' command in PowerShell: get-process iexplore.exe | stop-process

You can check afterwards with 'get-process iexplore.exe', if you've got an error it means the IE doesn't have any windows opened. If you still have the iexplore.exe there it means you have to launch Powershell as administrator (option in File menu in your File Explorer) and run the same 'stop process' command again.

You could also try launching RUN.bat as administrator.

onshisan commented 4 years ago

I am getting the "key already claimed" error, but I am logged into my account in IE. Are there any other known causes of this error?

mmarcincin commented 4 years ago

I am getting the "key already claimed" error, but I am logged into my account in IE. Are there any other known causes of this error?

Maybe you are logged into wrong humble bundle account ? You can download only the DRM-Free content tied to your humble bundle account. You could also try this: Log into humble bundle through IE and close the window, then launch the script. It will work reliable only if you do not log out when you close the IE window. Anything which clears cookies in IE will work against it.

onshisan commented 4 years ago

I'm certain that I only have one account. I did try closing the window and then launching the script, too. I will try again and see if I can resolve this through repetition.

mmarcincin commented 4 years ago

I'm certain that I only have one account. I did try closing the window and then launching the script, too. I will try again and see if I can resolve this through repetition.

When you close your IE window and start IE again, are you still logged into your humble bundle account ?

onshisan commented 4 years ago

When you close your IE window and start IE again, are you still logged into your humble bundle account ?

Yes.

Does the script have any particular version dependencies with IE?

mmarcincin commented 4 years ago

Can you browse your humble bundle correctly in Internet Explorer ? There is/was problem with humble bundle not working properly in Internet Explorer without adding the humblebundle.com into trusted sites and enabling protected mode for trusted sites. Whole setup is in readme file under 'Possible Errors - download stuck at the beginning'. Let me know if it helps with your issue. I just tested the IE and it should work even without it now (my default setting for IE is still protected mode).

onshisan commented 4 years ago

The HB site works fine for me in IE (well, almost fine - the reason I'm interested in the script is because the built-in bulk downloading feature seems to skip a few files of each file type for some reason). But the site itself loads without issue.

I did review the readme before posting here. I don't see any other errors or log information to suggest what the problem could be given that I am logged into the site in IE.

mmarcincin commented 4 years ago

The HB site works fine for me in IE (well, almost fine - the reason I'm interested in the script is because the built-in bulk downloading feature seems to skip a few files of each file type for some reason). But the site itself loads without issue.

I did review the readme before posting here. I don't see any other errors or log information to suggest what the problem could be given that I am logged into the site in IE.

If you uncomment line #$ie.visible = $true and comment the $ie.silent = $true so that it looks like this:

$ie.visible = $true
#$ie.silent = $true

The IE window will be visible. I'd also remove comment from pause right above ie.quit() line. That way you'll see exactly what page the info is scrapped from right before it would be closed. Let me know if you find something.

BloodShed-Oni commented 3 years ago

Done some testing and it seems it opens Internet Explorer in a way that it doesn't use the cookies you have from logging in (If you open Internet Explorer you would be logged in, but from the script you'd be logged out).

What I did to fix it.

On line 136 and 137 swap hashtag comment so it looks like this

$ie.visible = $true
#$ie.silent = $true

And on line 265 uncomment the pause before $ie.quit()

pause
$ie.quit()

Now when you run the script the Internet Explorer window will remain open for you to login. After that you can terminate the script and undo the changes and it should work now.

mmarcincin commented 3 years ago

Interesting, are you using option to run script as administrator ? When I had to use the trusted sites option in ie (for some reason IE wouldn't load humblebundle properly), the default for that is not protected mode. so when I added humble bundle to the list it logged me out. Basically switching between protected and normal mode deleted login cookies.

Running as adminstrator might be using different settings as well. Try logging in when the script opens IE window and afterwards press any key so that script closes the IE window. This time it won't download the files cause were not logged in and you'll most likely get couple of error messages, afterwards just start the script again and check if you are logged in now.

BloodShed-Oni commented 3 years ago

Interesting, are you using option to run script as administrator ? When I had to use the trusted sites option in ie (for some reason IE wouldn't load humblebundle properly), the default for that is not protected mode. so when I added humble bundle to the list it logged me out. Basically switching between protected and normal mode deleted login cookies.

Running as adminstrator might be using different settings as well. Try logging in when the script opens IE window and afterwards press any key so that script closes the IE window. This time it won't download the files cause were not logged in and you'll most likely get couple of error messages, afterwards just start the script again and check if you are logged in now.

I run the script as normal (not elevated).

mmarcincin commented 3 years ago

Do you have to login again into humble bundle when you close your Internet Explorer ? Try the above even if you do not run in elevated mode. Can you get into your humble bundle purchases while browsing normally ? (Internet Explorer not Microsoft Edge)

Go to internet explorer menu bar (you can press alt for it to show up or right click title for menu bar) > tools > internet options > security What do you have set for the internet ? enable protected mode ?

BloodShed-Oni commented 3 years ago

Do you have to login again into humble bundle when you close your Internet Explorer ? Try the above even if you do not run in elevated mode. Can you get into your humble bundle purchases while browsing normally ? (Internet Explorer not Microsoft Edge)

Go to internet explorer menu bar (you can press alt for it to show up or right click title for menu bar) > tools > internet options > security What do you have set for the internet ? enable protected mode ?

1) No it remains logged in when opening it again.

2) Yes I can get into my account from Internet Explorer

3) I started with the settings you mentioned in this thread, but I've since reset them default (the script still works after my fix).

I think you should have a script that opens Internet Explorer so people can log in to humble bundle from that "version".

EDIT: Or give an option to the user to open Internet Explorer to log into Humble Bundle, when the "Key already claimed" error pops up.

mmarcincin commented 3 years ago

I think you should have a script that opens Internet Explorer so people can log in to humble bundle from that "version". EDIT: Or give an option to the user to open Internet Explorer to log into Humble Bundle, when the "Key already claimed" error pops up.

I'll make it that if links.txt is empty/doesn't exist or by using a specific switch you get into 'login mode' (a visible page of humble bundle to login).

For the 'Key already claimed' situation I'll probably go with 2 options:

  1. nobody is logged in
  2. when already logged in but key already claimed appears (when it's part of the different account library)

Option 1 would launch the 'login mode'. For option 2 I might at least add message that it's not in x account (which is logged in).

mmarcincin commented 3 years ago

added option for script to open Internet Explorer window to let you to log-in to your Humble Bundle account in version 0.3.7