Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added post method, as get was failing on me. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lewis-morris
Copy link

@lewis-morris lewis-morris commented Jun 29, 2023

Changes

  • Added random header, so it appears different, not just user agent.
  • Added a POST version, that came from a JS free browser.
  • Added a multiple search version that takes multiple search terms and returns a dictionary of urls for each.
  • Added option for a random search in-between your terms as I was bulk searching similar terms and facing too many requests issues ( this solved that issue).
  • Added docstrings in all functions
  • Updated requirements and readme

Extra

I think these changes add an extra option for people who just want to grab urls - it appears to be faster with the post method also and I use regex to extract the url only (currently) - working on getting the advanced descriptions etc.

@lewis-morris lewis-morris changed the title added post method, as get was failing. Also did away with yeild, and … added post method, as get was failing on me. Jun 30, 2023
charsets = response.headers.get('content-type', '').lower()

# Apply decoding for multiple content codings
for coding in reversed(encoding.split(',')):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does requests not already do this?

@lewis-morris
Copy link
Author

lewis-morris commented Jul 17, 2023 via email

@thai-nm
Copy link

thai-nm commented Sep 21, 2023

I'm getting 429 errors - Too many requests as well. I think I can add more user agents to resolve the issue, and this PR is exactly (and above) what I need. If this is not merged, I'll raise a PR to add more user agents only.

@lewis-morris
Copy link
Author

lewis-morris commented Sep 22, 2023 via email

@lewis-morris
Copy link
Author

lewis-morris commented Sep 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants