Fix #2460: Uploading pixiv user's background image throws error.
Fix exception when uploading these types of URLs: * http://img12.pixiv.net/profile/rapattu/119950.jpg * http://i2.pixiv.net/img130/profile/minono_aki/8733472.jpg * http://i2.pixiv.net/img20/img/a-park/novel/3607898.jpg * http://i1.pixiv.net/novel-cover-original/img/2016/11/03/20/10/58/7436075_f75af69f3eacd1656d3733c72aa959cf.jpg * http://i1.pixiv.net/background/img/2016/05/17/12/05/48/2074388_d4ac52034f7ca0af3e083d59fde7e97f.jpg Skip rewriting sources that don't have illust IDs to avoid this exception. Also fix `tags` so that it doesn't blow up when fetching source data for these types of sources.
This commit is contained in:
@@ -8,9 +8,12 @@ module Downloads
|
||||
end
|
||||
|
||||
def rewrite(url, headers, data = {})
|
||||
if url =~ /https?:\/\/(?:\w+\.)?pixiv\.net/
|
||||
if url =~ /\Ahttps?:\/\/(?:\w+\.)?pixiv\.net/
|
||||
url, headers = rewrite_headers(url, headers)
|
||||
url, headers = rewrite_cdn(url, headers)
|
||||
end
|
||||
|
||||
if url =~ /\Ahttps?:\/\/(?:\w+\.)?pixiv\.net/ && source.illust_id_from_url
|
||||
url, headers = rewrite_html_pages(url, headers)
|
||||
url, headers = rewrite_thumbnails(url, headers)
|
||||
url, headers = rewrite_old_small_manga_pages(url, headers)
|
||||
|
||||
Reference in New Issue
Block a user