Commit Graph

56 Commits

Author SHA1 Message Date
r888888888
fd74f860ee potential fix for #2404 2015-06-10 17:28:51 -07:00
Toks
854d587373 Fix upload source fetcher fetching from wrong work page for all sites
e.g. If you were on an html work page on pixiv, clicked a link to a
different html work page on pixiv, and then clicked the bookmarklet,
then it used to fetch the source from the FIRST work you were on instead
of the second.
2015-06-03 20:59:24 -04:00
r888888888
2ddc93723c fixes #2327 2015-06-02 19:20:09 -07:00
Toks
0ac21b1623 Fix pixiv batch not working on old pixiv works 2015-05-23 12:00:35 -04:00
r888888888
9bdc0116bf fix pixiv tests 2015-05-14 16:50:24 -07:00
r888888888
ac6d1fa498 bug fix with pixiv api 2015-05-11 15:53:45 -07:00
r888888888
17cc8735ad first cut implementation at using public pixiv api 2015-05-11 15:19:05 -07:00
r888888888
721df95832 remove references to spapi 2015-05-11 10:57:41 -07:00
r888888888
5457d9ed4e temporarily disable pixiv sapi calls 2015-05-11 10:28:52 -07:00
Toks
6faa6305dd Autodelete phpsessid
fixes #2382
2015-05-08 13:30:26 -04:00
r888888888
2d266fc0b6 uploads/batch now supports pixiv 2015-03-15 13:56:16 -07:00
r888888888
c92c32ecda fix tests 2015-02-15 12:23:53 -08:00
r888888888
7175df2099 fix for Pixiv#get_image_url_from_page 2014-12-12 12:33:52 -08:00
Toks
6d565d9f87 Fix regression with pixiv manga uploads 2014-12-11 13:21:43 -05:00
r888888888
029202068d fix Pixiv#get_image_url_from_page 2014-12-11 10:05:59 -08:00
r888888888
e8a8999a73 fix class error 2014-12-04 17:32:19 -08:00
r888888888
d7f044e18b loosen constraints on pixiv img server regexp 2014-12-03 13:39:47 -08:00
evazion
57bb51621e Add debugger gem.
Fix random VCR failures in Pixiv tests.

Sometimes tests randomly fail because the PHPSESSID they use in their
HTTP requests to Pixiv is different than the one that was originally
recorded by VCR. This causes VCR to complain that the requests don't
match.

This is caused by the PHPSESSID being globally cached in Memcache.
Depending on the order the tests run in (which is random), one set of
tests can use a PHPSESSID that was recorded for a /different/ set of
tests.

Improve Pixiv URL matching.

* Allow URLs that are missing the http:// part. These are sometimes seen
  in artist entries.
* Ignore URLs from random Pixiv domains such as dic.pixiv.net,
  blog.pixiv.net, etc. These are also sometimes in artist entries.

Improve normalize_for_artist_finder! URL matching.

* Normalize www.pixiv.net/stacc/username URLs.
* Correctly normalize URLs that are missing the illust ID part on the end
  (i.e. http://i2.pixiv.net/img04/img/syounen_no_uta/). These are common
  in artist entries.

Match URLs strictly when normalizing for artist entries.

Only normalize Pixiv URLs that strictly match a known format. Pass any
unrecognized URLs through without attempting to normalize them, just to
be safe.

Normalize URLs when saving artist entries.
2014-12-03 13:16:05 -08:00
Toks
fc0328b9df fixes #2317 2014-12-02 16:02:21 -05:00
r888888888
16f9a61d63 fixes #2299 2014-10-29 15:14:17 -07:00
r888888888
8d4c9d7955 fix pixiv tests 2014-10-22 17:22:36 -07:00
Toks
5f9ce7ee47 Fix get_image_url_from_page call 2014-10-19 02:30:02 -07:00
r888888888
4c73fb9f79 add ugoira support in view 2014-10-19 02:30:02 -07:00
r888888888
3bb06c2be4 integrate ugoiras into zip+webm+preview 2014-10-19 02:30:02 -07:00
r888888888
fb2219d4ac integrate ugoira converted into upload flow 2014-10-19 02:30:01 -07:00
evazion
c75d2d208e normalize_for_artist_finder!: Don't crash on bad URLs
If we can't normalize the URL (because of bad IDs, it's malformed, or
the HTML page changed), just return the unnormalized URL.
2014-10-05 14:11:32 -05:00
evazion
7f3b98969f Refactor normalize_for_artist_finder!
Refactors things such that Sources::Site has a normalize_for_artist_finder!
method that delegates to the strategy for the appropriate site. This way
any site that needs to normalize URLs for the artist finder can do so.
2014-10-05 14:11:31 -05:00
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