summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhref <href@random.sh>2022-12-03 01:59:42 +0000
committerJordan Bracco <href@random.sh>2022-12-11 02:03:36 +0000
commitf7784b44f9b28930fbccde272ad031e106c2694c (patch)
tree097a20b129e1a4a61ac2d1a0de27b4f832651392
parentreorg (diff)
link_plugin: fixes
-rw-r--r--lib/lsg_irc/link_plugin/imgur.ex6
-rw-r--r--lib/lsg_irc/link_plugin/youtube.ex3
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/lsg_irc/link_plugin/imgur.ex b/lib/lsg_irc/link_plugin/imgur.ex
index 41b7e08..443afdb 100644
--- a/lib/lsg_irc/link_plugin/imgur.ex
+++ b/lib/lsg_irc/link_plugin/imgur.ex
@@ -16,6 +16,12 @@ defmodule LSG.IRC.LinkPlugin.Imgur do
"""
@impl true
+ def match(uri = %URI{host: "imgur.io"}, arg) do
+ match(%URI{uri | host: "imgur.com"}, arg)
+ end
+ def match(uri = %URI{host: "i.imgur.io"}, arg) do
+ match(%URI{uri | host: "i.imgur.com"}, arg)
+ end
def match(uri = %URI{host: "imgur.com", path: "/a/"<>album_id}, _) do
{true, %{album_id: album_id}}
end
diff --git a/lib/lsg_irc/link_plugin/youtube.ex b/lib/lsg_irc/link_plugin/youtube.ex
index 536cab6..6a16332 100644
--- a/lib/lsg_irc/link_plugin/youtube.ex
+++ b/lib/lsg_irc/link_plugin/youtube.ex
@@ -60,8 +60,7 @@ defmodule LSG.IRC.LinkPlugin.YouTube do
[]
end
{:ok, line ++ ["#{snippet["title"]}", "— #{duration} — uploaded by #{snippet["channelTitle"]} — #{date}"
- <> " — #{item["statistics"]["viewCount"]} views, #{item["statistics"]["likeCount"]} likes,"
- <> " #{item["statistics"]["dislikeCount"]} dislikes"]}
+ <> " — #{item["statistics"]["viewCount"]} views, #{item["statistics"]["likeCount"]} likes"]}
else
:error
end