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

Tumblr: support highest res for new image urls #4585

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

nonamethanks
Copy link
Member

Fixes #4502

@evazion evazion merged commit d9f0a1c into danbooru:master Aug 17, 2020
@nonamethanks nonamethanks deleted the fix_tumblr branch August 17, 2020 19:14

candidates.find do |candidate|
http_exists?(candidate)
resp = Danbooru::Http.cache(1.minute).get(url, headers: NEW_HEADERS).parse
Copy link
Member

Choose a reason for hiding this comment

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

The base strategy defines a http object that should be used by source strategies instead of instantiating a new Danbooru::Http client themselves. This is so that default http settings are shared by all source strategies.

Also the user agent is already set inside Danbooru::Http#initialize.

candidates.find do |candidate|
http_exists?(candidate)
end
elsif url =~ %r{/s\d+x\d+/(\w+\.\w+)$}i
Copy link
Member

Choose a reason for hiding this comment

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

Regexes should use \z instead of $. See https://stackoverflow.com/a/5979643.

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.

Sample when uploading certain tumblr pics
2 participants