-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
feat: support post requests #1205
Conversation
d98344e
to
24df5e8
Compare
24df5e8
to
cbe026b
Compare
If possible, it'd be wonderful if this could be reviewed/merged soon. Then I'd be happy to look into bringing back some of the removes sites. (Already have Coil on standby, assuming this were to be merged as is.) |
I tried your code with Fiverr's data but it seems like Sherlock says the username
I made this data by referring to the Anilist data but I have a feeling I might have done something wrong 🤔 |
cbe026b
to
36938b0
Compare
I think it's inverted.
I think it should be If the response contains "Fiverr": {
"errorType": "message",
"errorMsg": "\"status\":\"success\"",
"regexCheck": "^[A-Za-z][A-Za-z\\d_]{5,14}$",
"url": "https://www.fiverr.com/{}",
"urlMain": "https://www.fiverr.com/",
"urlProbe": "https://www.fiverr.com/validate_username",
"request_method": "POST",
"request_payload": {
"username": "{}"
},
"username_claimed": "blueman",
"username_unclaimed": "noonewouldeveru"
}, This should work, but we'll need to add a regex for invalid usernames. (This has false positives for invalid usernames otherwise.)
Note: The check in my comment has false positives for deleted profiles. That's because this endpoint is actually checking if the username is available or not. Profiles that have been deleted still do not have their username available for others to use. With that in mind using
It looks like Fiverr was removed because of the tests, but actually both tests for Fiverr are invalid anyway based on the username regex. ^-^' |
36938b0
to
737ce51
Compare
Ah yes! Sorry my bad, I for some reason pasted the message for the wrong request. I really appreciate the detailed response :) |
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.
Thank you for putting a lot of time and effort into this PR, its greatly appreciated! 😊
Adds support for Anilist by allowing POST requests. Note, I don't do Python much, so just let me know if the code is crap. ^-^'
This is just a first iteration, it should already work without breaking any existing functionality. You're welcome to give feedback though if you feel I'd done something wrong.
Main Changes
data.json
. (For testing the implementation of this PR.)interpolate_string
function, because I thought it would be nicer if we could define therequest_payload
as JSON rather than as a string literal. Opinion welcome!data.json
to specify the request method, defaulting toHEAD
/GET
based on theerrorType
if not specified."request_head_only": false
with"request_method": "GET"
Queries
This replaces the use of
.format
with.replace
which might be unfavorable, but I wasn't sure of what the best way to go about this was..format
throws an exception if there is no{}
in the string. This can be annoying since we may want to insert the username into theurl
,probeUrl
, orrequest_payload
. But different websites do things differently, some will want the username in theurl
, others might want it in therequest_payload
, so one of them will throw an exception. This is avoided with.replace
.request_payload
was an object rather than a string, so theinterpolate_string
function would want to use.replace
in this case anyway since many of the keys may not require templating.Related