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

Do not parse Packt website to obtain Google sitekey

mjenczmyk opened this issue · comments

I've found a faster way to provide a solution to Google ReCaptcha on Packt website, it's described here As Google's sitekey does not change we don't need to open Packt Free Learning website, parse it to obtain sitekey and then create Anti-Captcha task, instead we could have sitekey saved somewhere and create the task without parsing website, we could even parallelize script execution to independently fetch data about Free Learning offers from API and solve ReCaptcha at the same time and than join both results in book claiming request.

To do so we would have to store the sitekey somewhere:

  • we could hardcode it in the repository (assuming it doesn't change at all or at least very often),
  • we could require the user to provide it in the config file,
  • we could also hardcode it, but provide a fallback path in which the Packt Free Learning site is being parsed.

I would go for the first solution, so I would assume that sitekey does not change and hardcode it in the code - we can choose another solution if the assumption is not correct. What do you think about that?

There is a proposed pull request, see #127.

I've merged the pull request.