-
Notifications
You must be signed in to change notification settings - Fork 122
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
lewis-morris
wants to merge
1
commit into
Nv7-GitHub:master
Choose a base branch
from
lewis-morris:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…added random header.
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
Nv7-GitHub
reviewed
Jul 12, 2023
charsets = response.headers.get('content-type', '').lower() | ||
|
||
# Apply decoding for multiple content codings | ||
for coding in reversed(encoding.split(',')): |
There was a problem hiding this comment.
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?
not for me, I'm getting a great response, merge or no merge, i'm happy :)
It's doing what I want.
…On Wed, Jul 12, 2023 at 9:24 PM Nv7 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In googlesearch/user_agents.py
<#57 (comment)>
:
>
-
-_useragent_list = [
+ """
+ return random.choice([
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0',
We only kept the common user agents since having a bunch was causing some
issues.
—
Reply to this email directly, view it on GitHub
<#57 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIVZ7JABWDSROFYY4AAJXFDXP4BX5ANCNFSM6AAAAAAZYLMLWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
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. |
Worked for me when I was getting the same issue.
…On Thu, Sep 21, 2023 at 7:22 PM Nguyen Minh Thai ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIVZ7JFQUL6SNA26GDFOENTX3SAU7ANCNFSM6AAAAAAZYLMLWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
You could have a `use_additional_agents` flag which might help.
…On Fri, Sep 22, 2023 at 4:40 PM Lewis Morris ***@***.***> wrote:
Worked for me when I was getting the same issue.
On Thu, Sep 21, 2023 at 7:22 PM Nguyen Minh Thai ***@***.***>
wrote:
> 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.
>
> —
> Reply to this email directly, view it on GitHub
> <#57 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIVZ7JFQUL6SNA26GDFOENTX3SAU7ANCNFSM6AAAAAAZYLMLWE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
--
[image: created with MySignature.io]
<https://mysignature.io/?utm_source=logo>
Lewis Morris
M: 07554202635
E: ***@***.***
[image: created with MySignature.io] <https://github.com/lewis-morris> [image:
created with MySignature.io]
<https://stackoverflow.com/users/3348264/lewis-morris>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
too many requests
issues ( this solved that issue).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.