* Bumped up the line length because I fear no man * Refactored indexing Previously, indexing worked by collecting the video IDs of only videos that matched indexing criteria. This new model instead stores ALL videos for a given source, but will only _download_ videos that meet that criteria. This lets us backfill without indexing, makes it easier to add in other backends, lets us download one-off videos for a source that don't quite meet criteria, you name it. * Updated media finders to respect format filters; Added credo file
51 lines
1 KiB
Elixir
51 lines
1 KiB
Elixir
alias Pinchflat.Repo
|
|
|
|
alias Pinchflat.Tasks.Task
|
|
alias Pinchflat.Media.MediaItem
|
|
alias Pinchflat.Tasks.SourceTasks
|
|
alias Pinchflat.Media.MediaMetadata
|
|
alias Pinchflat.MediaSource.Source
|
|
alias Pinchflat.Profiles.MediaProfile
|
|
|
|
alias Pinchflat.Tasks
|
|
alias Pinchflat.Media
|
|
alias Pinchflat.Profiles
|
|
alias Pinchflat.MediaSource
|
|
|
|
alias Pinchflat.MediaClient.{SourceDetails, VideoDownloader}
|
|
|
|
defmodule IexHelpers do
|
|
def playlist_url do
|
|
"https://www.youtube.com/playlist?list=PLmqC3wPkeL8kSlTCcSMDD63gmSi7evcXS"
|
|
end
|
|
|
|
def channel_url do
|
|
"https://www.youtube.com/c/TheUselessTrials"
|
|
end
|
|
|
|
def video_url do
|
|
"https://www.youtube.com/watch?v=bR52O78ZIUw"
|
|
end
|
|
|
|
def details(type) do
|
|
source =
|
|
case type do
|
|
:playlist -> playlist_url()
|
|
:channel -> channel_url()
|
|
end
|
|
|
|
SourceDetails.get_source_details(source)
|
|
end
|
|
|
|
def ids(type) do
|
|
source =
|
|
case type do
|
|
:playlist -> playlist_url()
|
|
:channel -> channel_url()
|
|
end
|
|
|
|
SourceDetails.get_media_attributes(source)
|
|
end
|
|
end
|
|
|
|
import IexHelpers
|