refactor source pixiv test

refactor pixiv download tests
refactor upload test
refactor nico seiga test
refactor twitter tests
This commit is contained in:
r888888888
2016-09-27 16:22:54 -07:00
parent 4fa2741ed2
commit fc7afd44ea
134 changed files with 66158 additions and 70930 deletions

View File

@@ -11,13 +11,12 @@ module Sources
TIMESTAMP = '(?:[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9]{2}/[0-9]{2}/[0-9]{2})'
EXT = "(?:jpg|jpeg|png|gif)"
WHITECUBE = /^https?:\/\/wwww\.pixiv\.net\/whitecube/i
WEB = "^(?:https?://)?www\\.pixiv\\.net"
I12 = "^(?:https?://)?i[0-9]+\\.pixiv\\.net"
IMG = "^(?:https?://)?img[0-9]*\\.pixiv\\.net"
def self.url_match?(url)
url !~ WHITECUBE && url =~ /#{WEB}|#{IMG}|#{I12}/i
url =~ /#{WEB}|#{IMG}|#{I12}/i
end
def referer_url