Skip to content

Commit

Permalink
fix(Streaming Links): Add missing help and increase timeout value (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
papey authored Aug 24, 2024
1 parent 60d9a19 commit f1b3be4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ erl_crash.dump
o2m-*.tar

.elixir_ls

.idea
o2m.iml
1 change: 1 addition & 0 deletions lib/commands/commands.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Using prefix `#{O2M.Config.get(:prefix)}` :
- help : to get this help message
**Emojis**
- 🔗 : find links for all streaming plateforms from the resources linked in the message content
- 📌 : add this emoji as a reaction to pin a public message in order to get a private reminder about the pinned message
- 👀️️ : in your private channel with the bot add this emoji as a reaction to delete a bot message"
{:ok, reply}
Expand Down
4 changes: 3 additions & 1 deletion lib/utils/odesli.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ defmodule Odesli do

@platforms ["spotify", "deezer", "appleMusic", "youtube", "bandcamp", "tidal"]

@timeout :timer.minutes(0.5)

defmodule Response do
defstruct [:artist, :title, :urls]
end

def get(url) do
{:ok, resp} = HTTPoison.get("#{@links_url}?#{URI.encode_query(%{url: url})}")
{:ok, resp} = HTTPoison.get("#{@links_url}?#{URI.encode_query(%{url: url})}", [], timeout: @timeout, recv_timout: @timeout)

case resp do
%HTTPoison.Response{status_code: 200} ->
Expand Down

0 comments on commit f1b3be4

Please sign in to comment.