Merge branch 'master' of https://gitfub.space/Jmaa/memebot
This commit is contained in:
commit
ca62b059e6
|
@ -287,6 +287,7 @@ function internet.download_headers (url)
|
|||
url = url,
|
||||
method = 'HEAD'
|
||||
}
|
||||
print(_, code, headers, status)
|
||||
--
|
||||
return headers
|
||||
end
|
||||
|
|
|
@ -544,6 +544,10 @@ local curb = require 'curb_your_enthusiasm'
|
|||
|
||||
local function is_image_link (str)
|
||||
print(str)
|
||||
if str:match '%.png$' or str:match '%.gif$' or str:match '%.jpg$' then
|
||||
return true
|
||||
end
|
||||
--
|
||||
if type(str) ~= 'string' then return false end
|
||||
if not str:match '^%a+://.+$' then return false end
|
||||
local headers = internet.download_headers(str)
|
||||
|
|
Loading…
Reference in New Issue
Block a user