Switched thumbnail downloading to use yt-dlp (#281)

This commit is contained in:
Kieran
2024-06-04 10:39:54 -07:00
committed by GitHub
parent 4994e70652
commit af86ca1e0e
8 changed files with 98 additions and 122 deletions
+14
View File
@@ -46,6 +46,20 @@ defmodule Pinchflat.YtDlp.Media do
end
end
@doc """
Downloads a thumbnail for a single piece of media. Usually used for
downloading thumbnails for internal use
Returns {:ok, ""} | {:error, any, ...}.
"""
def download_thumbnail(url, command_opts \\ []) do
opts = [:no_simulate, :skip_download, :write_thumbnail, convert_thumbnail: "jpg"] ++ command_opts
# NOTE: it doesn't seem like this command actually returns anything in `after_move` since
# we aren't downloading the main media file
backend_runner().run(url, opts, "after_move:%()j")
end
@doc """
Returns a map representing the media at the given URL.