Remove artist commentary handling from download rewrite strategies.

This commit is contained in:
evazion
2017-05-01 21:20:49 -05:00
parent b49641f775
commit b2f62482a1
11 changed files with 7 additions and 50 deletions

View File

@@ -11,8 +11,6 @@ module Downloads
if url =~ %r{deviantart\.com/art/} || url =~ %r{deviantart\.net/.+/[a-z0-9_]+(_by_[a-z0-9_]+)?-d([a-z0-9]+)\.}i
url, headers = rewrite_html_pages(url, headers)
url, headers = rewrite_thumbnails(url, headers)
data[:artist_commentary_title] = source.artist_commentary_title
data[:artist_commentary_desc] = source.artist_commentary_desc
end
return [url, headers, data]

View File

@@ -18,8 +18,6 @@ module Downloads
url, headers = rewrite_thumbnails(url, headers)
url, headers = rewrite_old_small_manga_pages(url, headers)
url, headers = rewrite_to_thumbnails(url, headers) if data.delete(:get_thumbnail)
data[:artist_commentary_title] = source.artist_commentary_title
data[:artist_commentary_desc] = source.artist_commentary_desc
end
# http://i2.pixiv.net/img-zip-ugoira/img/2014/08/05/06/01/10/44524589_ugoira1920x1080.zip

View File

@@ -9,7 +9,7 @@ module Downloads
def rewrite(url, headers, data = {})
if url =~ %r!^https?://(?:mobile\.)?twitter\.com!
url, headers = rewrite_status_page(url, headers, data)
url = source.image_url
elsif url =~ %r{^https?://pbs\.twimg\.com}
url, headers = rewrite_thumbnails(url, headers, data)
end
@@ -18,12 +18,6 @@ module Downloads
end
protected
def rewrite_status_page(url, headers, data)
url = source.image_url
data[:artist_commentary_desc] = source.artist_commentary_desc
return [url, headers, data]
end
def rewrite_thumbnails(url, headers, data)
if url =~ %r{^(https?://pbs\.twimg\.com/media/[^:]+)}
url = $1 + ":orig"