r888888888/danbooru — pull request #2262 by evazion (2014-09-26 03:07:28+00:00)
Title: Fix issue #2261

Fix for issue #2261. The approach is as follows:

* Rewrite the Pixiv source data fetcher (`Sources::Strategies::Pixiv`) to use Pixiv's smartphone API instead of scraping the HTML.
* Have `Sources::Strategies::Pixiv` use the information it gathers to normalize URLs to old-style Pixiv URLs.
* Have the source URL rewriting that happens during upload (in `Downloads::Strategies::Pixiv`) use the normalized URL returned by `Sources::Strategies::Pixiv`.
* Populate the source field in the upload form with the normalized URL. This depends on prefilling the upload form (as in: `http://danbooru.donmai.us/uploads/new?url=http://i1.pixiv.net/img-original/img/2014/09/25/23/09/29/46183440_p0.jpg`) using the upload bookmarklet.

This approach works with all the URLs I've tested, but it could still use some more review before it's deployed.