Commit Graph

3707 Commits

Author SHA1 Message Date
evazion
ec0f226f46 Make the artist finder work with new Pixiv URLs. 2014-10-04 12:45:37 -05:00
evazion
58f0ec3dec Use the normalized source in the upload form.
This makes it so you can use the bookmarklet to upload from any of these Pixiv pages:

* http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=big&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=manga&illust_id=45792845
* http://www.pixiv.net/member_illust.php?mode=manga_big&illust_id=45792845&page=0

and the source field in the upload form will be filled in with the
actual image URL (e.g. http://i2.pixiv.net/img18/img/ringo78/45792845_big_p0.jpg),
and it will also be used for the "This post was already uploaded" check.
2014-10-04 12:45:37 -05:00
evazion
964b5efcd3 Rewrite Pixiv small/medium images to full size images.
There are two kinds of thumbnails that need to be rewritten. First case:
new /img-master/ URLs need to be rewritten to /img-original/ URLs like this:

    http://i2.pixiv.net/c/600x600/img-master/img/2014/10/04/03/59/52/46337015_p0_master1200.jpg
    => http://i2.pixiv.net/img-original/img/2014/10/04/03/59/52/46337015_p0.png

This is what `rewrite_new_medium_images` does. In order to do this, it
has to use the Pixiv API to get the correct file extension.

Second case: Old small/medium size URLs need to be rewritten to full
size URLs like this:

    http://i2.pixiv.net/img18/img/evazion/14901720_m.png
    => http://i2.pixiv.net/img18/img/evazion/14901720.png

But when the medium size URL is actually for a manga image, it needs to be
rewritten to the big manga URL instead:

    http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_m.jpg
    => http://i2.pixiv.net/img04/img/syounen_no_uta/46170939_big_p0.jpg

But we can't tell whether it's a manga image from the URL, so we have to
use the manga page count from either the HTML page or the API to
determine whether it's part of a manga gallery.

So in order to make this work, `rewrite_old_small_and_medium_images`
takes an `is_manga` flag. `Sources::Strategies::Pixiv#get` gets the
page count from the HTML and passes the `is_manga` flag on down through
the call chain until `rewrite_old_small_and_medium_images` gets it.

When `rewrite_old_small_and_medium_images` is called from
`Downloads::Strategies::Pixiv#rewrite_thumbnails`, the `is_manga` flag
isn't passed in because we didn't scrape the HTML. This causes
`rewrite_old_small_and_medium_images` to look it up in the API instead.
2014-10-04 12:45:37 -05:00
evazion
daf196bd0e Rewrite old Pixiv small manga images correctly.
This prevents incorrectly rewriting these new Pixiv URLs:

* http://i1.pixiv.net/c/600x600/img-master/img/2014/09/24/23/25/08/46168376_p0_master1200.jpg
* http://i1.pixiv.net/img-original/img/2014/09/25/23/09/29/46183440_p0.jpg
2014-10-04 12:45:37 -05:00
evazion
36a78361d7 Normalize URLs to the mode=medium page correctly.
This handles a few new cases that weren't handled correctly previously.

* http://i1.pixiv.net/img-zip-ugoira/img/2014/10/03/17/29/16/46323924_ugoira1920x1080.zip
* http://i1.pixiv.net/c/600x600/img-master/img/2014/10/02/13/51/23/46304396_p0_master1200.jpg
* http://www.pixiv.net/member_illust.php?mode=manga&illust_id=18557054
* http://www.pixiv.net/member_illust.php?mode=manga_big&illust_id=18557054&page=1
* http://www.pixiv.net/i/18557054
2014-10-04 12:45:36 -05:00
evazion
f889dbf10f Add get_metadata_from_spapi! 2014-10-04 12:45:36 -05:00
evazion
7f98b370ec Fix scraping the Pixiv artist username.
The artist's username is no longer contained in the image thumbnail URL on the
HTML page. Get it from the Feed link instead.
2014-10-04 12:45:36 -05:00
evazion
74c116ffb7 Fix for scraping the manga page count.
The string for the page count has changed. It now looks like "複数枚投稿 3P"
on all Pixiv posts I've checked.
2014-10-04 12:45:36 -05:00
Toks
4b9605075b Rewrite tumblr cdn urls 2014-10-03 14:36:37 -04:00
Toks
685d65ffdb Merge branch 'master' of https://github.com/r888888888/danbooru 2014-10-03 14:35:53 -04:00
Toks
d499bb4d04 Remove tumblr 1280w -> 500h source rewriting
It was thought that 500h was always the biggest size when it exists, but
it seems it can actually be either bigger or smaller than 1280w.
2014-10-03 14:21:53 -04:00
Albert Yi
2aa8a1cd4b Merge pull request #2259 from evazion/bump-rmagick
Bump rmagick to 2.13.3.
2014-10-01 16:49:38 -07:00
r888888888
53476eaabf new version 2014-09-30 17:25:22 -07:00
r888888888
74e1355728 fix tests 2014-09-30 17:24:54 -07:00
Toks
6dce66f33d Cache pixiv session 2014-09-29 01:38:53 -04:00
Toks
6e80d77a89 #2261 source redirection and pixiv_id for thumbnails 2014-09-24 23:09:54 -04:00
Toks
fd290076fe fixes #2241 2014-09-24 13:28:56 -04:00
Toks
6b9e0fca12 #2245 add search form 2014-09-24 13:14:03 -04:00
Toks
4db0c3c0e5 fixes #2249 2014-09-24 13:11:54 -04:00
Toks
ae49c7c016 #2261: fix source redirection, fix pixiv_id parsing 2014-09-24 12:25:14 -04:00
Toks
4b4e3dc87b #2245 Display more of title
originally from commit 719343cea5
2014-09-20 15:28:03 -04:00
Toks
6d523153fa Change automatic tags to be added before aliases/implications
This allows aliases and implications to work on tags added automatically
2014-09-20 15:10:49 -04:00
Toks
fac385ffcb fix #2237 for webm and flash 2014-09-20 14:52:49 -04:00
Toks
87d3cc31b3 fixes #2257 2014-09-20 14:50:52 -04:00
Toks
cbdc78d606 #2245 make gallery obey user's per page setting 2014-09-07 00:03:23 -04:00
Toks
4f0a83f996 #2245 allow anonymous to view gallery 2014-09-06 23:58:00 -04:00
r888888888
5c22d8753f Revert "make pool gallery the default view"
This reverts commit 719343cea5.
2014-09-05 22:26:47 -07:00
r888888888
dec92a67c4 fix favoriting 2014-09-05 16:50:34 -07:00
r888888888
8ebbda255a new version 2014-09-05 16:46:45 -07:00
r888888888
0e203c5cda add favorite/unfavorite links to mobile page 2014-09-05 16:46:22 -07:00
r888888888
719343cea5 make pool gallery the default view 2014-09-05 16:27:19 -07:00
evazion
3e7344a804 Bump rmagick to 2.13.3.
rmagick-2.13.2 is incompatible with versions of ImageMagick built with
--enable-hdri. This includes the version of ImageMagick supplied
with Arch Linux. This prevents rmagick, and consequently Danbooru,
from being installed on Arch Linux.

rmagick-2.13.3 fixed this issue. See https://github.com/rmagick/rmagick/issues/18.
2014-08-26 01:04:16 -05:00
r888888888
267df896c6 fixes #2245 2014-08-25 16:41:27 -07:00
r888888888
3c4119663e remove unused css 2014-08-25 15:56:54 -07:00
Toks
13101e7c88 #2250 fix validations not allowing empty topic id 2014-08-23 20:01:56 -04:00
Toks
c5cabe4e58 fix for #2250 2014-08-23 19:41:44 -04:00
Toks
0682a0db63 fixes #2247 2014-08-22 16:06:09 -04:00
r888888888
432ffc8597 disable mobile js for now 2014-08-20 16:52:35 -07:00
r888888888
81c5c15758 revert hammer js changes 2014-08-20 16:50:53 -07:00
r888888888
f0ab7ae937 new version 2014-08-18 13:34:09 -07:00
r888888888
461f3b4a4d fixes #2243 2014-08-18 13:13:49 -07:00
r888888888
1f4811dcf7 update rails version 2014-08-18 11:20:11 -07:00
r888888888
efa6e12953 new verison 2014-08-18 10:20:46 -07:00
Toks
2300e9bd1e fixes #2244 2014-08-17 12:07:53 -04:00
Toks
2e8e4e7831 fix basic members not being able to make api keys 2014-08-15 18:13:39 -04:00
r888888888
914ee9f6a3 fix mobile js 2014-08-15 13:54:36 -07:00
r888888888
75da8dc340 remove jquery.hammer.min.js dependency 2014-08-15 13:22:44 -07:00
r888888888
ac57534f97 new version 2014-08-15 12:56:53 -07:00
r888888888
3fb0072dea update hammer js 2014-08-14 15:05:11 -07:00
r888888888
8c52d2f376 increase saved search limit, retry timedout uploads 2014-08-14 12:54:31 -07:00