Commit Graph

249 Commits

Author SHA1 Message Date
evazion
4074cc99f9 uploads: fix incorrect remote sizes on pixiv uploads.
Bug: the uploads page showed a remote size of 146 bytes for Pixiv uploads.

Cause: we didn't spoof the Referer header when making the HEAD request
for the image, causing Pixiv to return a 403 error.

Also fix the case where the Content-Length header is absent.
2020-06-24 03:02:45 -05:00
evazion
8eac82a971 pixiv: fix regression with new user profile urls.
* Update tests to use new Pixiv profile urls.
* Fix issue with artist finder not working when given direct image or
  html page urls.
2020-06-24 02:41:11 -05:00
evazion
85f58bf2f6 newgrounds: fix style nitpicks. 2020-06-24 00:25:45 -05:00
evazion
42c06b0f1e Merge pull request #4516 from nonamethanks/add_newgrounds_support
Add NewGrounds support
2020-06-24 00:20:16 -05:00
evazion
185693b99b Merge branch 'master' into fix-pixiv-profile-url 2020-06-24 00:06:55 -05:00
evazion
83a8468ee9 tests: remove unnecessary rescueing of Net::OpenTimeout errors.
These exceptions are no longer thrown now that we've switched from
HTTParty to http.rb. Swallowing unexpected exceptions during testing was
a bad practice anyway.
2020-06-23 03:12:44 -05:00
evazion
8a21c9a8db Merge pull request #4523 from nonamethanks/revert_pixiv_tools
Revert "Pixiv: don't blacklist digital tools"
2020-06-23 02:39:18 -05:00
evazion
73506bac33 twitter: add tests for uploading profile banners (#4520). 2020-06-23 02:37:21 -05:00
evazion
7e471fe223 sources: replace HTTParty with Danbooru::Http in http_exists?. 2020-06-21 15:11:56 -05:00
evazion
5604ab0079 pixiv: remove fanbox support.
This is broken and it needs to be rewritten as a separate source
strategy anyway.
2020-06-21 11:59:51 -05:00
evazion
6e6ce6e62f nijie: replace Mechanize with Danbooru::Http.
The Nijie login process works like this:

* First we submit our `email` and `password` to `https://nijie.info/login_int.php`.
* Then we save the NIJIEIEID session cookie from the response.
* We optionally retry if login failed. Nijie returns 429 errors with a
  `Retry-After: 5` header if we send too many login requests. This can
  happen during parallel testing.
* We cache the login cookies for only 1 hour so we don't have to worry
  about them becoming invalid if we cache them too long.

Cookies and retrying errors on failure are handled transparently by Danbooru::Http.
2020-06-21 05:22:57 -05:00
evazion
67a52dbc2d tumblr: support new va.media.tumblr.com urls. 2020-06-19 13:53:35 -05:00
nonamethanks
0a396c8b95 Revert "Pixiv: don't blacklist digital tools"
This reverts commit e83d07ea7b.

It was worth a try, but unfortunately it seems that once
someone sets tools in a Pixiv upload, they become defaults and
are applied to all of their subsequent uploads, so we get some
posts with two or three different digital tags.
2020-06-19 08:08:46 +02:00
nonamethanks
7a41ee9c34 Add NewGrounds support 2020-06-18 03:22:30 +02:00
BrokenEagle
158a4aa916 Fix Pixiv user profile URL to use the latest format
This will only affect new artist and commentary records going forward.
2020-06-17 07:07:33 +00:00
BrokenEagle
05f9b78ee3 Distinctly separate and label explicit/guro content in Pixiv test
This helps discern why these tests might be failing and serve as a
reminder to set the permissions for the Pixiv account correctly.
2020-06-17 07:07:33 +00:00
evazion
b583b3c810 tests: fix nicoseiga download tests. 2020-06-16 00:10:35 -05:00
evazion
962e60f4f1 Merge pull request #4496 from nonamethanks/refactor_nicoseiga
Refactor nicoseiga
2020-06-15 21:05:10 -05:00
evazion
19727ab5c4 Merge pull request #4505 from nonamethanks/pixiv_digital_tags
Pixiv: don't blacklist digital tools anymore
2020-06-15 20:56:56 -05:00
nonamethanks
9f0e85e1b5 Refactor nicoseiga strategy
* Get rid of mechanize, fully switch to Danbooru::Http
* Switch to mobile api, improving speed
* Merge main and manga clients
* Add full support for manga pages
* Add support for anonymous and r-15 images
* Don't fail when attempting to upload oekaki direct links
* Various misc fixes
2020-06-15 03:37:51 +02:00
nonamethanks
e83d07ea7b Pixiv: don't blacklist digital tools anymore 2020-06-12 04:15:20 +02:00
evazion
2d05004bef tests: don't cache pixiv sessions. 2020-06-11 00:47:12 -05:00
evazion
2ede41c4dc tests: fix twitter test broken by deleted tweet. 2020-06-10 20:22:16 -05:00
evazion
d6b266514b tests: disable known broken pixiv fanbox tests. 2020-06-10 18:21:44 -05:00
evazion
d002701bc1 Merge pull request #4494 from nonamethanks/fix_deviantart_api_downloads
Deviantart: fix api downloads
2020-06-09 01:37:03 -05:00
nonamethanks
25b801619f Deviantart: fix api downloads 2020-05-31 07:01:43 +02:00
evazion
855e31ac90 nijie: fetch commentary as html instead of plaintext.
Fix regression in #4475. Fetch the commentary as html instead of
plaintext so that we don't lose links or other formatting.

Also fix it so that /jump.php redirect links are replaced with the
actual url.
2020-05-29 15:36:21 -05:00
evazion
9ca848d732 tests: fix more ruby 2.7 deprecation warnings. 2020-05-29 15:36:21 -05:00
nonamethanks
d339947647 Weibo: add source normalization 2020-05-28 01:05:11 +02:00
evazion
feeea6602c Merge pull request #4488 from nonamethanks/add_weibo_support
Add Weibo support
2020-05-27 16:53:14 -05:00
evazion
2c60a51f64 Merge pull request #4475 from nonamethanks/refactor_source_normalizing
Refactor source normalization
2020-05-27 16:52:17 -05:00
evazion
71f4e5b82a artstation: add tests for #4480. 2020-05-27 15:49:04 -05:00
nonamethanks
5c7307a1c9 Add Weibo support 2020-05-27 11:30:05 +02:00
nonamethanks
116f3a67ef Nijie: fetch full commentary rather than truncated preview 2020-05-22 02:47:19 +02:00
nonamethanks
307df3b3e4 Refactor source normalization
* Move the source normalization logic out of the post model
  and into individual sources' strategies.
* Rewrite normalization tests to be handled into each source's test,
  and expand them significantly. Previously we were only testing
  a very small subset of domains and variants.
* Fix up normalization for several sites.
* Normalize fav.me urls into normal deviantart urls.
2020-05-21 22:46:51 +02:00
evazion
deeb465b72 Merge pull request #4457 from lllusion3469/fix_da
Fix Deviantart
2020-05-11 16:22:48 -05:00
lllusion3469
45ae8bfb6f deviantart: support non-downloadable videos 2020-05-11 19:51:04 +02:00
lllusion3469
9dccee1d5e stash: fix tests
checking image_urls isn't necessary as it's [image_url] per definition
2020-05-11 19:51:04 +02:00
lllusion3469
0d5e31868f deviantart: fix non-downloadable flash files 2020-05-11 19:51:04 +02:00
lllusion3469
769bf87a4a deviantart: don't apply /intermediary/ hack for gifs
gifs are always stored as original anyways so the /intermediary/ url
doesn't actually exist for gifs

example:
https://www.deviantart.com/heartgear/art/Silent-Night-579982816
2020-05-11 16:10:33 +02:00
lllusion3469
9205c32424 deviantart: revert to 7f482dc35b
that's the latest commit made to deviantart files before switching from
the developer API to the Javascript backend from the new "Eclipse"
frontend.
This is necessary because it's basically impossible to download posts
now with the JS backend without being logged in, i.e. having the cookies
from a logged in user, which can't be used for very long even if
exporting them from a browser. You would have to save the cookies
deviantart sends you back via the "Set-Cookie" header in a database
somewhere in addition to the other added complexity.

also
* (temporarily) replace HttpartyCache with HTTParty as it's long been
  removed
* fix one case of "last argument as keyword parameter"
* change repository url (5d1a1cc87e)
* remove self-explanatory comment
2020-05-11 16:09:00 +02:00
nonamethanks
9724b206b0 Add hentai-foundry support 2020-05-05 21:54:34 +02:00
evazion
c6d096a15f art station: add tests for #4416. 2020-04-21 00:32:52 -05:00
BrokenEagle
a45ae09d72 Account for additional Twitter video image links 2020-03-29 19:27:05 +00:00
evazion
31424ce545 twitter: add test for video thumbnails (#4262). 2020-03-20 16:19:07 -05:00
evazion
49a3538933 pixiv: add support for techorus urls. 2020-03-04 00:00:39 -06:00
evazion
09046783ac pixiv: fix tests. 2020-03-03 23:54:03 -06:00
evazion
266e4054b0 Fix #4293: ArtStation: use 4k images.
Also fixes #4290 (Image replacements: undefined method hostname for nil:NilClass)
2020-03-03 23:01:29 -06:00
evazion
1244e02fe2 pixiv: handle new https://i-f.pximg.net urls. 2020-02-18 19:22:57 -06:00
evazion
60bf21ff80 twitter: fix preview_urls when source url is a direct image.
Fix preview_urls returning an empty array when the source url is a
direct image from Twitter.

Also return preview_urls in /source.json.
2020-01-21 16:34:03 -06:00