mmarcincin/HB-DRM-free-bulk-downloader

Default browser is opened and script stuck after info

Closed this issue · 7 comments

Im "super not using" Internet Explorer as default browser :D to point everything is opened in my prefered browser. It took some setup - Windows was kinda stuborn about some apps so i had to be extra persuasive and my tinkering is probably reason your script does not work as intended (it opens my prefered browser and i suspect it has no idea how to communicate with it so it becames stuck after writing basic information) ... is there something easy i can do about it or im out of luck? :)

Did you get some error message ?
There's a section for possible errors at the end of the readme file.
Default browser setting should not matter. I use IE rarely now too.

No error message as far as i know.
Its not only default browser settings, i think i used long time ago some registry tweaks and so ... once in a while i get angry by MS forcing its will upon me :) and i do lot of setup changes in policies, registry and so to make Windows behave the way i want and one of those problems i had to solve was IE opening links even when it was not as default browser ... i had feeling something i did could interfere with your script but i took some time as im writing this to read how is this script working and if i see right you are calling COM object for IE which should be pretty foolproof ... now im kinda confused why it opens my default ... oh my fault - its not even my default browser but one of browsers i use a lot (Maxthon ... its maybe overly agressive but i doubt it interferes with COM objects it self) ... this is realy weird ... sorry for that mess of my thoughts :D.

Fact is i open your script, it opens different browser than IE, writes this into console and then stops:
link: redacted
preferred labels: epub
strict mode: disabled
OS: default
MD5 file check: enabled
MD5 stored file check: enabled

Its not that important to solve, i was writing more like if you have some idea what can cause this it would be nice and i wanted you to know something like this could happen but now when i had read what your script does internally its probably mystery for you too. If you dont know what could help never mind.
Either way thanks for response.

What happens when you close the Maxthon browser window ? Do you get some error message afterwards ?
Try to keep the powershell window running until it fails :).
You can also make the powershell window visible by changing comment for visibility of ie instance:
#$ie.visible = $true
$ie.silent = $true
to
$ie.visible = $true
#$ie.silent = $true

It's also nice to see someone using the option for different label :).

As far as i know nothing. Still no error message and im not sure if it will ever fail (i had tryed to let it open for some time at first try) - it just seems it stops doing anything after those MD5 information. My guess would be line 140 (while($ie.Busy -or $ie.ReadyState -ne "4") { Start-Sleep -Milliseconds 100 }) makes it loop infinitely and after test with one write-host before and one after which was not called it indeed seems so.
Those settings changes does not seems to have any visual effect.

Ha progress - Maxthon seems realy like agressive browser :D ... i was able to identify registry key responsible for opening Maxthon instead of IE by your script - HKEY_CURRENT_USER\Software\Classes\WOW6432Node\CLSID\{0002DF01-0000-0000-C000-000000000046}\LocalServer32 - only problem now is im not sure about its default value for IE or if i did not miss somethine else because now it opens IE but visible and there is "%1" -Embedding in search and big red error in shell with something about failing to load class model for COM - 80080005, HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)) and this:

+ CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand

I have my language mutation of that error so i tryed to aproximate english version and picked some important looking info from it :)
Sadly i dont have experience with shell scripts yet and with COM objects very lightly so i dont know if it helps somehow.

I didn't come up with a solution at the time but later I experienced one pc to not work with the script because IE was not installed at all so you might try this:

run (win+r)>control
Program and Features -> subsection - View Installed Updates -> left sidebar - Turn Windows features on or off

Afterwards find Internet Explorer and untick the checkbox (if it's installed) and confirm it. Restart suggested.
If it was not installed (unticked checkbox), choose that option so that it installs Internet Explorer for you. Restart might be needed for this as well. This might reset the IE for you.

Let me know if it helped :)

Added 'Possible Errors - missing Internet Explorer' into README (same info as above)
https://github.com/mmarcincin/HB-DRM-free-bulk-downloader#possible-errors---missing-internet-explorer