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.
This commit is contained in:
@@ -70,7 +70,7 @@ module Sources
|
||||
end
|
||||
|
||||
def referer_url(template)
|
||||
template.params[:ref] || template.params[:url]
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def image_urls
|
||||
|
||||
@@ -6,7 +6,7 @@ module Sources
|
||||
end
|
||||
|
||||
def referer_url(template)
|
||||
if template.params[:ref] =~ /deviantart\.com\/art\//
|
||||
if template.params[:ref] =~ /deviantart\.com\/art\// && template.params[:url] =~ /https?:\/\/(?:fc|th|pre|orig|img)\d{2}\.deviantart\.net\//
|
||||
template.params[:ref]
|
||||
else
|
||||
template.params[:url]
|
||||
|
||||
@@ -6,7 +6,7 @@ module Sources
|
||||
end
|
||||
|
||||
def referer_url(template)
|
||||
if template.params[:ref] =~ /seiga\.nicovideo\.jp\/seiga\/im\d+/
|
||||
if template.params[:ref] =~ /seiga\.nicovideo\.jp\/seiga\/im\d+/ && template.params[:url] =~ /http:\/\/lohas\.nicoseiga\.jp\/priv\//
|
||||
template.params[:ref]
|
||||
else
|
||||
template.params[:url]
|
||||
|
||||
@@ -6,7 +6,7 @@ module Sources
|
||||
end
|
||||
|
||||
def referer_url(template)
|
||||
if template.params[:ref] =~ /nijie\.info\/view\.php/ && template.params[:ref] =~ /id=\d+/
|
||||
if template.params[:ref] =~ /nijie\.info\/view\.php.+id=\d+/ && template.params[:url] =~ /pic\d+\.nijie.info\/nijie_picture\//
|
||||
template.params[:ref]
|
||||
else
|
||||
template.params[:url]
|
||||
|
||||
@@ -20,7 +20,7 @@ module Sources
|
||||
end
|
||||
|
||||
def referer_url(template)
|
||||
if template.params[:ref] =~ /pixiv\.net\/member_illust/ && template.params[:ref] =~ /mode=medium/
|
||||
if template.params[:ref] =~ /pixiv\.net\/member_illust.+mode=medium/ && template.params[:url] =~ /#{IMG}|#{I12}/
|
||||
template.params[:ref]
|
||||
else
|
||||
template.params[:url]
|
||||
|
||||
Reference in New Issue
Block a user