-
-
Notifications
You must be signed in to change notification settings - Fork 483
[wallhaven.cc] add imageByFragment that picks up default saved filename #2538
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
base: master
Are you sure you want to change the base?
Conversation
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.
This might be the weirdest regex I've seen yet, did you mean to do a-z0-9? and also escape the . for extension?
Also some of their older posts follow a seperate format, before they migrated. A strict regex might be possible + better
|
Will also put in draft/ potentially close as they have IQDB search for actual ByFragment. Will close if/when IQDB search implemented |
The oldest thing they have still uses an ID in the scheme of I made it very restrictive explicitly to avoid false positives, it really should only match file names that have 6 characters / digits at the end, before the extension, with some kind of separator before.
Huh, I've never actually noticed that feature. I've looked into it a bit, and it's not mentioned in the API docs. Playing around with it a bit, it's just a POST to their search endpoint , maybe it just works for API search too. Otherwise this will be a whole new thing, I already see XSRF tokens and Cloudflare cookies, plus the login requirement for NSFW would probably need credentials or a session cookie in the scraper. I'll look into it more later, but this really might be a feature of it's own. |
|
would have to be in python but imo would be leagues above trying to match filename |
|
Just an update after looking into it a bit:
|
|
Current broken state sequestered into its own subbranch wallhaven-imageByFragtment-iqdb, can't get it to work right now. |
405 is method not allowed, maybe PUT instead of POST? but hm cdp is supported on python but it's a lot weirder |
cc05b01 to
ad9c669
Compare
Generated by an automatic template. Can be removed if not applicable.
Scraper type(s)
Examples to test
SFW because NSFW needs account and API token
https://wallhaven.cc/w/9dqojx
https://wallhaven.cc/w/yxd8jk
Short description
When right-click saving a wallpaper from wallhaven, the default filename has a predictable structure ("wallhaven-."). This change adds image fragment scraping to allow automatically picking up IDs that are a clear and separable postfix to the filename.