Fixed issue with source details when first video is a premier
This commit is contained in:
parent
3c897e96e6
commit
5bc3a0e09d
2 changed files with 5 additions and 2 deletions
|
|
@ -54,7 +54,10 @@ defmodule Pinchflat.YtDlp.MediaCollection do
|
||||||
Returns {:ok, map()} | {:error, any, ...}.
|
Returns {:ok, map()} | {:error, any, ...}.
|
||||||
"""
|
"""
|
||||||
def get_source_details(source_url) do
|
def get_source_details(source_url) do
|
||||||
opts = [:simulate, :skip_download, playlist_end: 1]
|
# `ignore_no_formats_error` is necessary because yt-dlp will error out if
|
||||||
|
# the first video has not released yet (ie: is a premier). We don't care about
|
||||||
|
# available formats since we're just getting the source details
|
||||||
|
opts = [:simulate, :skip_download, :ignore_no_formats_error, playlist_end: 1]
|
||||||
output_template = "%(.{channel,channel_id,playlist_id,playlist_title})j"
|
output_template = "%(.{channel,channel_id,playlist_id,playlist_title})j"
|
||||||
|
|
||||||
with {:ok, output} <- backend_runner().run(source_url, opts, output_template),
|
with {:ok, output} <- backend_runner().run(source_url, opts, output_template),
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
|
||||||
|
|
||||||
test "it passes the expected args to the backend runner" do
|
test "it passes the expected args to the backend runner" do
|
||||||
expect(YtDlpRunnerMock, :run, fn @channel_url, opts, ot ->
|
expect(YtDlpRunnerMock, :run, fn @channel_url, opts, ot ->
|
||||||
assert opts == [:simulate, :skip_download, playlist_end: 1]
|
assert opts == [:simulate, :skip_download, :ignore_no_formats_error, playlist_end: 1]
|
||||||
assert ot == "%(.{channel,channel_id,playlist_id,playlist_title})j"
|
assert ot == "%(.{channel,channel_id,playlist_id,playlist_title})j"
|
||||||
|
|
||||||
{:ok, "{}"}
|
{:ok, "{}"}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue