Compare commits
No commits in common. "d3798a2c3aa96a8116afadc9f9d903125d76f985" and "f175863ae8804e5f6bef35f43b5f22a58b90793b" have entirely different histories.
d3798a2c3a
...
f175863ae8
1 changed files with 3 additions and 7 deletions
|
@ -23,15 +23,11 @@ defmodule HahaYes.Commands.Download do
|
|||
Bot: <video file>
|
||||
"""
|
||||
def execute(msg) do
|
||||
{:ok, loading} = Api.create_message(msg.channel_id, "Downloading...")
|
||||
|
||||
arg = String.replace(msg.content, "h3h3 download ", "")
|
||||
opt = ["-f", "bestvideo[height<=?480]+bestaudio/best", arg, "-o", "#{System.tmp_dir}/#{msg.id}.%(ext)si", "--force-overwrites", "--playlist-reverse", "--no-playlist", "--remux-video=mp4/webm/mov", "--no-warnings"];
|
||||
opt = ["-f", "bestvideo[height<=?480]+bestaudio/best", arg, "-o", "#{System.tmp_dir}/test.mp4", "--force-overwrites", "--playlist-reverse", "--no-playlist", "--remux-video=mp4/webm/mov", "--no-warnings"];
|
||||
|
||||
System.cmd("yt-dlp", opt)
|
||||
|
||||
Api.delete_message(loading.channel_id, loading.id)
|
||||
Api.delete_message(msg)
|
||||
Api.create_message(msg.channel_id, files: [Enum.at(Path.wildcard("#{System.tmp_dir}/#{msg.id}.*"), 0)])
|
||||
Api.delete_message(msg.channel_id, msg.id)
|
||||
Api.create_message(msg.channel_id, files: ["#{System.tmp_dir}/test.mp4"])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue