packt-cli / Packt-Publishing-Free-Learning

Scripts that automatically claim and download free daily eBooks from https://www.packtpub.com/packt/offers/free-learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ERROR] - Exception occurred u'href'

ankur-p opened this issue · comments

This error started happening today when trying to grab the current ebook. Checked the site, and it seems they've implemented captcha. Not sure how long they've had this, but I think it's the first time I've seen it. Guessing the captcha is what's causing the error. Downloading existing books on my account still seems to work fine.

yeah, so now it seems like we have to crack the google recaptcha which they used :D

haha yeah, I wasn't exactly expecting a "fix" for this one. just thought I'd let you know about it. ;)

Eh. Does it means, that all packtpub scripts can now be trashed? :(

Seems like google has patched his captcha methods recently. We could've cracked it a few months ago. For the ones who are curious how it worked: https://east-ee.com/2017/02/28/rebreakcaptcha-breaking-googles-recaptcha-v2-using-google/

EDIT: just found another blog post about breaking the captcha with machine learning https://franciskim.co/cracking-googles-recaptcha-machine-learning/, so there might be a way... anyone having experience with image recognition? :-P

It is possible to use antigate.com or similar. For $ 1 there are 1.5 k images, which is enough for years.

'-dc' is only parameter that provides some sort of automation now (together with manually clicked captcha) ?
No mater what comes next, thank you Łukasz for a great tool! I enjoyed the couple months of using it 👍

I wonder if they got enough complaints about it PacktPub would remove it?

-da -f was a life-saver for me (big thanks to the devs, btw!), and those flags still seem to work fine. So far I'm only seeing an issue with -g and its derivatives, but grabbing the file manually then downloading via script works. It's a shame they've blocked the script access to grab. Here's to hoping they don't follow-up by blocking all script downloads, too.

EDIT: Just saw the edit regarding the machine learning crack. good luck with that! I would love to help, but unfortunately I have no experience with image recognition.

EDIT: Just saw the edit regarding the machine learning crack. good luck with that! I would love to help, but unfortunately I have no experience with image recognition.

It's simple: is hot dog or is not hot dog.

Personally I do not see any value on having a captcha there, besides their will to stop script accesses. At least, we could still use a script to notify people by e-mail about book of the day, since to scrap the title of the page does not need a login.

+1 for this, only noticed today that they implemented a CAPTCHA and thus broke the -g of the script days ago unfortunately, so I missed some of the current promo since I often forget checking it myself daily.

I got bitten by this too, missed some books, and now have to manually go to their site every morning. Greatly reduced value for me, and reduced eyeball time on their site, too. I used to check out my book collection periodically and head to their site to look for complimentary titles. Now I forget to grab today's book in time, and get discouraged, don't bother doing anything with their site. Big lose.

Maybe try this? https://2captcha.com/recaptchav2_eng_instruction - if anybody solves it please let us know, we have a packt ebook code challenge this week: https://pybit.es/codechallenge22.html

I don't think the captcha is stopping this. It looks like there is no href to grab anymore. I just get the claim url from the form action and it seems to work. I'll put a pull request up with my change.

@ChuckWoodraska I tried your code but it gives me:
[ERROR] - Exception occurred eBook: Unity_Shaders_and_Effects_Cookbook has not been grabbed!, does this promo exist yet? visit the page and check!

(I logged in successfully)

@jolny ya it looks like I spoke too soon. Thought it was working but after testing some more it seems like it isn't.

Solved by adding reCaptcha solver from https://anti-captcha.com at #56

@igbt6 thanks for this! works as good as before the captcha integration :)