Commit Graph

29 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
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
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
6dce66f33d Cache pixiv session 2014-09-29 01:38:53 -04:00
Toks
5aca6aa7c9 Fix pixiv gallery page counts 2014-07-16 11:58:43 -04:00
Toks
224da8a7da Prevent pixiv downloader from returning wrong image 2014-06-25 11:14:08 -04:00
Toks
3230ab8781 Add warning when Pixiv post is a gallery of multiple images 2014-06-13 16:33:38 -04:00
Toks
d092ea0094 fixes #1207 2014-05-29 23:43:19 -04:00
Toks
4f8b455830 fixes #2168 2014-05-29 18:46:09 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
d8201b7c6d fixes #868 2013-03-14 17:36:30 -04:00
albert
43177cbad8 fixes #827 2013-03-10 16:56:04 -04:00
albert
0a0d25e0a9 fix for pixiv urls 2013-02-19 12:07:40 -05:00
albert
eb1ba8f708 fix tests 2013-02-17 21:32:07 -05:00
albert
7e0e961656 pixiv source fix 2013-02-16 23:26:28 -05:00
albert
f5f760117e pixiv source fix 2013-02-16 23:25:33 -05:00
albert
b6e9e5b41f fix pixiv source 2013-01-06 15:59:31 -05:00
albert
f44ba8fe9f fix pixiv source 2012-12-26 15:11:21 -05:00
albert
c14f020ce2 * Fix for Pixiv changes
* Fix for artist/wiki pages for -names
2012-02-08 12:44:17 -05:00
albert
2287bc8d61 fixed pixiv sources 2011-09-30 13:27:22 -04:00
albert
19add9aa4e refactored sources 2011-09-29 12:55:15 -04:00
albert
8eb9bc612b implemented pixa source 2011-09-29 11:34:31 -04:00
albert
218096a5c4 moved source passwords into config 2011-09-26 17:32:52 -04:00
albert
dc31e74809 added tinami support 2011-09-26 17:30:35 -04:00
albert
284141aace refactored source code, work on pixiv integration 2011-09-26 16:47:22 -04:00
albert
a1657366c1 renamed artsiteproxy to sources 2011-09-26 12:54:42 -04:00