Compare commits
22 Commits
v0.1.0-alpha.6
...
v0.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| a9d5407071 | |||
| 37c1da8014 | |||
| 937a14985f | |||
| a6a20c111f | |||
| 2bb96edc00 | |||
| 87f07ff634 | |||
| dd60cb5419 | |||
| 610b00566b | |||
| aba15ed886 | |||
| 87da716fdf | |||
| 45f056c6e0 | |||
| 11d160008c | |||
| ba0a1ba100 | |||
| 8c51a286c9 | |||
| 46c27e4875 | |||
| b639918555 | |||
| 5596351f58 | |||
| ad150b6f16 | |||
| f6d8e15670 | |||
| 2906ff1b30 | |||
| 0582a7bfd5 | |||
| 3db2e8190f |
@@ -13,3 +13,5 @@ N/A
|
|||||||
## Any other comments?
|
## Any other comments?
|
||||||
|
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
|
- [ ] I am the original author of this code and I am giving it freely to the community and Pinchflat project maintainers
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ on:
|
|||||||
description: 'Docker Image Tag'
|
description: 'Docker Image Tag'
|
||||||
required: true
|
required: true
|
||||||
default: 'dev'
|
default: 'dev'
|
||||||
|
platforms:
|
||||||
|
description: 'Build Platforms'
|
||||||
|
required: true
|
||||||
|
default: 'linux/amd64,linux/arm64'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
@@ -24,9 +28,19 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
|
platforms: ${{ github.event.inputs.platforms }}
|
||||||
push: true
|
push: true
|
||||||
file: ./selfhosted.Dockerfile
|
file: ./selfhosted.Dockerfile
|
||||||
tags: 'keglin/pinchflat:${{ github.event.inputs.image_tag }}'
|
tags: |
|
||||||
|
keglin/pinchflat:${{ github.event.inputs.image_tag }}
|
||||||
|
ghcr.io/${{ github.repository_owner }}/pinchflat:${{ github.event.inputs.image_tag }}
|
||||||
|
|||||||
@@ -21,43 +21,3 @@ alias Pinchflat.FastIndexing.YoutubeRss
|
|||||||
alias Pinchflat.Metadata.MetadataFileHelpers
|
alias Pinchflat.Metadata.MetadataFileHelpers
|
||||||
|
|
||||||
alias Pinchflat.SlowIndexing.FileFollowerServer
|
alias Pinchflat.SlowIndexing.FileFollowerServer
|
||||||
|
|
||||||
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 last_media_item do
|
|
||||||
Repo.one(from m in MediaItem, limit: 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
def details(type) do
|
|
||||||
source =
|
|
||||||
case type do
|
|
||||||
:playlist -> playlist_url()
|
|
||||||
:channel -> channel_url()
|
|
||||||
end
|
|
||||||
|
|
||||||
YtDlpCollection.get_source_details(source)
|
|
||||||
end
|
|
||||||
|
|
||||||
def ids(type) do
|
|
||||||
source =
|
|
||||||
case type do
|
|
||||||
:playlist -> playlist_url()
|
|
||||||
:channel -> channel_url()
|
|
||||||
end
|
|
||||||
|
|
||||||
YtDlpCollection.get_media_attributes_for_collection(source)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
import IexHelpers
|
|
||||||
|
|||||||
@@ -1,43 +1,143 @@
|
|||||||
# Pinchflat (Alpha)
|
<p align="center">
|
||||||
|
<img
|
||||||
|
src="priv/static/images/originals/logo-white-wordmark-with-background.png"
|
||||||
|
alt="Pinchflat Logo by @hernandito"
|
||||||
|
width="700"
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
|
||||||
This is alpha software and anything can break at any time. I make not guarantees about the stability of this software, forward-compatibility of updates, or integrity (both related to and independent of Pinchflat). Essentially, use at your own risk and expect there will be rough edges.
|
<p align="center">
|
||||||
|
<sup>
|
||||||
|
<em>logo by <a href="https://github.com/hernandito" target="_blank">@hernandito</a></em>
|
||||||
|
</sup>
|
||||||
|
</p>
|
||||||
|
|
||||||
## EFF Donation Receipts
|
# Your next YouTube media manager
|
||||||
|
|
||||||
A portion of all donations to Pinchflat will be donated to the Electronic Frontier Foundation. [See here](https://github.com/kieraneglin/pinchflat/wiki/EFF-Donation-Receipts) for a list of donation receipts.
|
## Table of contents:
|
||||||
|
|
||||||
## What is Pinchflat?
|
- [What it does](#what-it-does)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Screenshots](#screenshots)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Unraid](#unraid)
|
||||||
|
- [Docker](#docker)
|
||||||
|
- [Authentication](#authentication)
|
||||||
|
- [Frequently asked questions](https://github.com/kieraneglin/pinchflat/wiki/Frequently-Asked-Questions)
|
||||||
|
- [Documentation](https://github.com/kieraneglin/pinchflat/wiki)
|
||||||
|
- [EFF donations](#eff-donations)
|
||||||
|
- [Pre-release disclaimer](#pre-release-disclaimer)
|
||||||
|
- [Development](#development)
|
||||||
|
|
||||||
TODO: expand on this.
|
## What it does
|
||||||
|
|
||||||
Pinchflat is a lightweight self-contained app for downloading YouTube content. For now, it is not intended as a way to consume content, but instead as a way to download content to disk using specified rules and schedules.
|
Pinchflat is a self-hosted app for downloading YouTube content built using [yt-dlp](https://github.com/yt-dlp/yt-dlp). It's designed to be lightweight, self-contained, and easy to use. You set up rules for how to download content from YouTube channels or playlists and it'll do the rest, checking periodically for new content. It's perfect for people who want to download content for use in with a media center app (Plex, Jellyfin, Kodi) or for those who want to archive media!
|
||||||
|
|
||||||
I have plans for more to come, but for now this is the focus. Think of Pinchflat as nothing more than an automated way to get content from YouTube to your disk.
|
It's _not_ great for downloading one-off videos - it's built to download large amounts of content and keep it up to date. It's also not meant for consuming content in-app - Pinchflat downloads content to disk where you can then watch it with a media center app or VLC.
|
||||||
|
|
||||||
|
If it doesn't work for your use case, please make a feature request! You can also check out these great alternatives: [Tube Archivist](https://github.com/tubearchivist/tubearchivist), [ytdl-sub](https://github.com/jmbannon/ytdl-sub), and [TubeSync](https://github.com/meeb/tubesync)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Self-contained - just one Docker container with no external dependencies
|
||||||
|
- Powerful naming system so content is stored where and how you want it
|
||||||
|
- Easy-to-use web interface with presets to get you started right away
|
||||||
|
- First-class support for media center apps like Plex, Jellyfin, and Kodi
|
||||||
|
- Automatically downloads new content from channels and playlists
|
||||||
|
- Uses a novel approach to download new content more quickly than other apps
|
||||||
|
- Supports downloading audio content
|
||||||
|
- Custom rules for handling YouTube Shorts and livestreams
|
||||||
|
- Advanced options like setting cutoff dates and filtering by title
|
||||||
|
- Reliable hands-off operation
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|
<img src="priv/static/images/app-form-screenshot.png" alt="Pinchflat screenshot" width="700" />
|
||||||
|
<img src="priv/static/images/app-screenshot.png" alt="Pinchflat screenshot" width="700" />
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Pinchflat is designed to be self-hosted. I'm building it for my own needs which means it's designed to work well with Unraid, but it should work on any computer/server that can run Docker images.
|
### Unraid
|
||||||
|
|
||||||
I'll update with Unraid instructions once I get something in the Community Apps store. Until then, here's how you build it with Docker:
|
Simply search for Pinchflat in the Community Apps store!
|
||||||
|
|
||||||
|
### Portainer
|
||||||
|
|
||||||
|
Docker Compose file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
pinchflat:
|
||||||
|
image: keglin/pinchflat:latest
|
||||||
|
ports:
|
||||||
|
- '8945:8945'
|
||||||
|
volumes:
|
||||||
|
- /host/path/to/config:/config
|
||||||
|
- /host/path/to/downloads:/downloads
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
1. Create two directories on your host machine: one for storing config and one for storing downloaded media. Make sure they're both writable by the user running the Docker container.
|
||||||
|
2. Prepare the docker image in one of the two ways below:
|
||||||
|
- **From GHCR:** `docker pull ghcr.io/kieraneglin/pinchflat:latest`
|
||||||
|
- NOTE: also available on Docker Hub at `keglin/pinchflat:latest`
|
||||||
|
- **Building locally:** `docker build . --file selfhosted.Dockerfile -t ghcr.io/kieraneglin/pinchflat:latest`
|
||||||
|
3. Run the container:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build . --file selfhosted.Dockerfile -t pinchflat:dev
|
# Be sure to replace /host/path/to/config and /host/path/to/downloads below with
|
||||||
|
# the paths to the directories you created in step 1
|
||||||
docker run \
|
docker run \
|
||||||
-p 8945:8945 \
|
-p 8945:8945 \
|
||||||
-v /Users/work/Desktop/test_volumes/config:/config \
|
-v /host/path/to/config:/config \
|
||||||
-v /Users/work/Desktop/test_volumes/downloads:/downloads \
|
-v /host/path/to/downloads:/downloads \
|
||||||
pinchflat:dev
|
ghcr.io/kieraneglin/pinchflat:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### IMPORTANT: File permissions
|
||||||
|
|
||||||
|
You _must_ ensure the host directories you've mounted are writable by the user running the Docker container. If you get a permission error follow the steps it suggests. See [#106](https://github.com/kieraneglin/pinchflat/issues/106) for more.
|
||||||
|
|
||||||
|
It's recommended to not run the container as root. Doing so can create permission issues if other apps need to work with the downloaded media. If you need to run any command as root, you can run `su` from the container's shell as there is no password set for the root user.
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
Currently HTTP basic auth is optionally supported. To use it, set the `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` environment variables when starting the container. If you don't set both of these, no authentication will be required.
|
HTTP basic authentication is optionally supported. To use it, set the `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` environment variables when starting the container. No authentication will be required unless you set _both_ of these.
|
||||||
|
|
||||||
|
## EFF donations
|
||||||
|
|
||||||
|
A portion of all donations to Pinchflat will be donated to the [Electronic Frontier Foundation](https://www.eff.org/). The EFF defends your online liberties and [backed](https://github.com/github/dmca/blob/9a85e0f021f7967af80e186b890776a50443f06c/2020/11/2020-11-16-RIAA-reversal-effletter.pdf) `youtube-dl` when Google took them down. [See here](https://github.com/kieraneglin/pinchflat/wiki/EFF-Donation-Receipts) for a list of donation receipts.
|
||||||
|
|
||||||
|
## Pre-release disclaimer
|
||||||
|
|
||||||
|
This is pre-release software and anything can break at any time. I make not guarantees about the stability of this software, forward-compatibility of updates, or integrity (both related to and independent of Pinchflat). Essentially, use at your own risk and expect there will be rough edges for now.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
Pinchflat is written in Elixir - a functional programming language that runs on the Erlang VM. It uses the Phoenix web framework and SQLite for the database. The frontend is mostly normal server-rendered HTML with a little Alpine.js as-needed.
|
||||||
|
|
||||||
|
Elixir is a personal favourite of mine and is ideal for building fault-tolerant systems. It's also a joy to work with and has a great community. If you're interested in contributing, I'd be happy to help you get started with Elixir - just open an issue with some questions and we can chat!
|
||||||
|
|
||||||
|
### Local setup
|
||||||
|
|
||||||
|
- `docker compose build --no-cache`
|
||||||
|
- `docker compose up -d && docker attach pinchflat-phx-1`
|
||||||
|
- After a few minutes the app should be accessible at `localhost:4008`
|
||||||
|
- Please let me know if you run into any hiccups here - I haven't had to bootstrap the app from scratch in a long time and I might have forgotten something
|
||||||
|
- Media downloads and config will be stored in the `tmp` directory. Not the OS's `/tmp` directory, but the one in the root of the project
|
||||||
|
|
||||||
|
### Running tests and linting
|
||||||
|
|
||||||
|
- Open a shell with `docker compose exec phx bash`
|
||||||
|
- Run `mix test` to run the tests
|
||||||
|
- Run `mix check` to do a full testing, linting, and static analysis pass
|
||||||
|
|
||||||
|
### Top tips
|
||||||
|
|
||||||
|
- Look for any module that ends in `*_worker.ex` - these are where the interesting stuff happens and you can trace back from there to see how the app works. `lib/pinchflat/slow_indexing/media_collection_indexing_worker.ex` is a good place to start
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
See `LICENSE` file
|
See `LICENSE` file
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -25,6 +25,21 @@ config :pinchflat,
|
|||||||
basic_auth_username: System.get_env("BASIC_AUTH_USERNAME"),
|
basic_auth_username: System.get_env("BASIC_AUTH_USERNAME"),
|
||||||
basic_auth_password: System.get_env("BASIC_AUTH_PASSWORD")
|
basic_auth_password: System.get_env("BASIC_AUTH_PASSWORD")
|
||||||
|
|
||||||
|
arch_string = to_string(:erlang.system_info(:system_architecture))
|
||||||
|
|
||||||
|
system_arch =
|
||||||
|
cond do
|
||||||
|
String.contains?(arch_string, "arm") -> "arm"
|
||||||
|
String.contains?(arch_string, "aarch") -> "arm"
|
||||||
|
String.contains?(arch_string, "x86") -> "x86"
|
||||||
|
true -> "unknown"
|
||||||
|
end
|
||||||
|
|
||||||
|
config :pinchflat, Pinchflat.Repo,
|
||||||
|
load_extensions: [
|
||||||
|
Path.join([:code.priv_dir(:pinchflat), "repo", "extensions", "sqlean-linux-#{system_arch}", "sqlean"])
|
||||||
|
]
|
||||||
|
|
||||||
if config_env() == :prod do
|
if config_env() == :prod do
|
||||||
config_path =
|
config_path =
|
||||||
System.get_env("CONFIG_PATH") ||
|
System.get_env("CONFIG_PATH") ||
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ defmodule Pinchflat.Boot.PreJobStartupTasks do
|
|||||||
|
|
||||||
alias Pinchflat.Repo
|
alias Pinchflat.Repo
|
||||||
alias Pinchflat.Settings
|
alias Pinchflat.Settings
|
||||||
alias Pinchflat.Filesystem.FilesystemHelpers
|
|
||||||
|
|
||||||
def start_link(opts \\ []) do
|
def start_link(opts \\ []) do
|
||||||
GenServer.start_link(__MODULE__, %{}, opts)
|
GenServer.start_link(__MODULE__, %{}, opts)
|
||||||
@@ -31,33 +30,30 @@ defmodule Pinchflat.Boot.PreJobStartupTasks do
|
|||||||
"""
|
"""
|
||||||
@impl true
|
@impl true
|
||||||
def init(state) do
|
def init(state) do
|
||||||
|
reset_executing_jobs()
|
||||||
apply_default_settings()
|
apply_default_settings()
|
||||||
ensure_directories_are_writeable()
|
|
||||||
rename_old_job_workers()
|
rename_old_job_workers()
|
||||||
|
|
||||||
{:ok, state}
|
{:ok, state}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# If a node cannot gracefully shut down, the currently executing jobs get stuck
|
||||||
|
# in the "executing" state. This is a problem because the job runner will not
|
||||||
|
# pick them up again
|
||||||
|
defp reset_executing_jobs do
|
||||||
|
{count, _} =
|
||||||
|
Oban.Job
|
||||||
|
|> where(state: "executing")
|
||||||
|
|> Repo.update_all(set: [state: "retryable"])
|
||||||
|
|
||||||
|
Logger.info("Reset #{count} executing jobs")
|
||||||
|
end
|
||||||
|
|
||||||
defp apply_default_settings do
|
defp apply_default_settings do
|
||||||
Settings.fetch!(:onboarding, true)
|
Settings.fetch!(:onboarding, true)
|
||||||
Settings.fetch!(:pro_enabled, false)
|
Settings.fetch!(:pro_enabled, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp ensure_directories_are_writeable do
|
|
||||||
directories = [
|
|
||||||
Application.get_env(:pinchflat, :media_directory),
|
|
||||||
Application.get_env(:pinchflat, :tmpfile_directory),
|
|
||||||
Application.get_env(:pinchflat, :metadata_directory)
|
|
||||||
]
|
|
||||||
|
|
||||||
Enum.each(directories, fn dir ->
|
|
||||||
file = Path.join([dir, ".keep"])
|
|
||||||
|
|
||||||
# This will fail if the directory is not writeable, stopping boot
|
|
||||||
FilesystemHelpers.write_p!(file, "")
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
# As part of a large refactor, I ended up moving a bunch of workers around. This
|
# As part of a large refactor, I ended up moving a bunch of workers around. This
|
||||||
# is a problem because the workers are stored in the database and the runner
|
# is a problem because the workers are stored in the database and the runner
|
||||||
# will try to run the OLD jobs. This is also why these tasks run before the job
|
# will try to run the OLD jobs. This is also why these tasks run before the job
|
||||||
|
|||||||
@@ -20,6 +20,21 @@ defmodule Pinchflat.Filesystem.FilesystemHelpers do
|
|||||||
filepath
|
filepath
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Writes content to a file, creating directories as needed.
|
||||||
|
Takes the same args as File.write/3.
|
||||||
|
|
||||||
|
Returns :ok | {:error, any()}
|
||||||
|
"""
|
||||||
|
def write_p(file, content, modes \\ []) do
|
||||||
|
dirname = Path.dirname(file)
|
||||||
|
|
||||||
|
case File.mkdir_p(dirname) do
|
||||||
|
:ok -> File.write(file, content, modes)
|
||||||
|
err -> err
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Writes content to a file, creating directories as needed.
|
Writes content to a file, creating directories as needed.
|
||||||
Takes the same args as File.write!/3.
|
Takes the same args as File.write!/3.
|
||||||
@@ -27,11 +42,7 @@ defmodule Pinchflat.Filesystem.FilesystemHelpers do
|
|||||||
Returns :ok | raises on error
|
Returns :ok | raises on error
|
||||||
"""
|
"""
|
||||||
def write_p!(filepath, content, modes \\ []) do
|
def write_p!(filepath, content, modes \\ []) do
|
||||||
filepath
|
:ok = write_p(filepath, content, modes)
|
||||||
|> Path.dirname()
|
|
||||||
|> File.mkdir_p!()
|
|
||||||
|
|
||||||
File.write!(filepath, content, modes)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ defmodule Pinchflat.Media do
|
|||||||
|> where([mi], mi.source_id == ^source.id and is_nil(mi.media_filepath))
|
|> where([mi], mi.source_id == ^source.id and is_nil(mi.media_filepath))
|
||||||
|> where(^build_format_clauses(media_profile))
|
|> where(^build_format_clauses(media_profile))
|
||||||
|> where(^maybe_apply_cutoff_date(source))
|
|> where(^maybe_apply_cutoff_date(source))
|
||||||
|
|> where(^maybe_apply_title_regex(source))
|
||||||
|> Repo.maybe_limit(limit)
|
|> Repo.maybe_limit(limit)
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
end
|
end
|
||||||
@@ -247,6 +248,14 @@ defmodule Pinchflat.Media do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp maybe_apply_title_regex(source) do
|
||||||
|
if source.title_filter_regex do
|
||||||
|
dynamic([mi], fragment("regexp_like(?, ?)", mi.title, ^source.title_filter_regex))
|
||||||
|
else
|
||||||
|
dynamic(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
defp build_format_clauses(media_profile) do
|
defp build_format_clauses(media_profile) do
|
||||||
mapped_struct = Map.from_struct(media_profile)
|
mapped_struct = Map.from_struct(media_profile)
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ defmodule Pinchflat.Release do
|
|||||||
"""
|
"""
|
||||||
@app :pinchflat
|
@app :pinchflat
|
||||||
|
|
||||||
|
require Logger
|
||||||
|
|
||||||
|
alias Pinchflat.Filesystem.FilesystemHelpers
|
||||||
|
|
||||||
def migrate do
|
def migrate do
|
||||||
load_app()
|
load_app()
|
||||||
|
|
||||||
@@ -18,6 +22,36 @@ defmodule Pinchflat.Release do
|
|||||||
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
|
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_file_permissions do
|
||||||
|
load_app()
|
||||||
|
|
||||||
|
directories = [
|
||||||
|
"/config",
|
||||||
|
"/downloads",
|
||||||
|
Application.get_env(:pinchflat, :media_directory),
|
||||||
|
Application.get_env(:pinchflat, :tmpfile_directory),
|
||||||
|
Application.get_env(:pinchflat, :metadata_directory)
|
||||||
|
]
|
||||||
|
|
||||||
|
Enum.each(directories, fn dir ->
|
||||||
|
Logger.info("Checking permissions for #{dir}")
|
||||||
|
filepath = Path.join([dir, ".keep"])
|
||||||
|
|
||||||
|
case FilesystemHelpers.write_p(filepath, "") do
|
||||||
|
:ok ->
|
||||||
|
Logger.info("Permissions OK")
|
||||||
|
|
||||||
|
{:error, :eacces} ->
|
||||||
|
Logger.error(permission_denied_screed(dir))
|
||||||
|
raise "Permission denied"
|
||||||
|
|
||||||
|
err ->
|
||||||
|
Logger.error("Permissions check failed: #{inspect(err)}")
|
||||||
|
raise "Unknown error"
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
defp repos do
|
defp repos do
|
||||||
Application.fetch_env!(@app, :ecto_repos)
|
Application.fetch_env!(@app, :ecto_repos)
|
||||||
end
|
end
|
||||||
@@ -25,4 +59,31 @@ defmodule Pinchflat.Release do
|
|||||||
defp load_app do
|
defp load_app do
|
||||||
Application.load(@app)
|
Application.load(@app)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp permission_denied_screed(dir) do
|
||||||
|
"""
|
||||||
|
The directory "#{dir}" is not writeable by the Docker container.
|
||||||
|
|
||||||
|
Please ensure that the directory exists and is writeable by the Docker
|
||||||
|
container. All setups are different, but you may be able to run something
|
||||||
|
like this on the *host*:
|
||||||
|
|
||||||
|
chown nobody -R <host path that maps to #{dir}>
|
||||||
|
chmod 755 -R <host path that maps to #{dir}>
|
||||||
|
|
||||||
|
Swapping in your real host path. Then, you should set the user running
|
||||||
|
this container by editing your `docker run` command like so:
|
||||||
|
|
||||||
|
docker run --user 99:100 <rest of the command>
|
||||||
|
|
||||||
|
Or adding `user: '99:100'` to the Pinchflat service of your Docker Compose
|
||||||
|
file. Again, there are many ways to do this depending on your setup and
|
||||||
|
this is just one example. See issue #106 in the Pinchflat Github for more.
|
||||||
|
|
||||||
|
No matter the case, this _is_ a permissions error and allowing the container
|
||||||
|
to write to the directory is the only way to fix it. It is not recommended
|
||||||
|
to run the container as `root` because files created by Pinchflat may not
|
||||||
|
be accessible to other apps that want to modify them.
|
||||||
|
"""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ defmodule Pinchflat.SlowIndexing.FileFollowerServer do
|
|||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@poll_interval_ms Application.compile_env(:pinchflat, :file_watcher_poll_interval)
|
@poll_interval_ms Application.compile_env(:pinchflat, :file_watcher_poll_interval)
|
||||||
@activity_timeout_ms 60_000
|
@activity_timeout_ms 600_000
|
||||||
|
|
||||||
# Client API
|
# Client API
|
||||||
@doc """
|
@doc """
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ defmodule Pinchflat.SlowIndexing.SlowIndexingHelpers do
|
|||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
|
alias Pinchflat.Repo
|
||||||
alias Pinchflat.Media
|
alias Pinchflat.Media
|
||||||
alias Pinchflat.Tasks
|
alias Pinchflat.Tasks
|
||||||
alias Pinchflat.Sources
|
alias Pinchflat.Sources
|
||||||
@@ -60,6 +61,9 @@ defmodule Pinchflat.SlowIndexing.SlowIndexingHelpers do
|
|||||||
# See the method definition below for more info on how file watchers work
|
# See the method definition below for more info on how file watchers work
|
||||||
# (important reading if you're not familiar with it)
|
# (important reading if you're not familiar with it)
|
||||||
{:ok, media_attributes} = get_media_attributes_for_collection_and_setup_file_watcher(source)
|
{:ok, media_attributes} = get_media_attributes_for_collection_and_setup_file_watcher(source)
|
||||||
|
# Reload because the source may have been updated during the (long-running) indexing process
|
||||||
|
# and important settings like `download_media` may have changed.
|
||||||
|
source = Repo.reload!(source)
|
||||||
|
|
||||||
result =
|
result =
|
||||||
Enum.map(media_attributes, fn media_attrs ->
|
Enum.map(media_attributes, fn media_attrs ->
|
||||||
@@ -117,6 +121,10 @@ defmodule Pinchflat.SlowIndexing.SlowIndexingHelpers do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp create_media_item_and_enqueue_download(source, media_attrs) do
|
defp create_media_item_and_enqueue_download(source, media_attrs) do
|
||||||
|
# Reload because the source may have been updated during the (long-running) indexing process
|
||||||
|
# and important settings like `download_media` may have changed.
|
||||||
|
source = Repo.reload!(source)
|
||||||
|
|
||||||
case Media.create_media_item_from_backend_attrs(source, media_attrs) do
|
case Media.create_media_item_from_backend_attrs(source, media_attrs) do
|
||||||
{:ok, %MediaItem{} = media_item} ->
|
{:ok, %MediaItem{} = media_item} ->
|
||||||
if source.download_media && Media.pending_download?(media_item) do
|
if source.download_media && Media.pending_download?(media_item) do
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ defmodule Pinchflat.Sources.Source do
|
|||||||
last_indexed_at
|
last_indexed_at
|
||||||
original_url
|
original_url
|
||||||
download_cutoff_date
|
download_cutoff_date
|
||||||
|
title_filter_regex
|
||||||
media_profile_id
|
media_profile_id
|
||||||
)a
|
)a
|
||||||
|
|
||||||
@@ -57,11 +58,6 @@ defmodule Pinchflat.Sources.Source do
|
|||||||
field :collection_name, :string
|
field :collection_name, :string
|
||||||
field :collection_id, :string
|
field :collection_id, :string
|
||||||
field :collection_type, Ecto.Enum, values: [:channel, :playlist]
|
field :collection_type, Ecto.Enum, values: [:channel, :playlist]
|
||||||
field :nfo_filepath, :string
|
|
||||||
field :poster_filepath, :string
|
|
||||||
field :fanart_filepath, :string
|
|
||||||
field :banner_filepath, :string
|
|
||||||
field :series_directory, :string
|
|
||||||
field :index_frequency_minutes, :integer, default: 60 * 24
|
field :index_frequency_minutes, :integer, default: 60 * 24
|
||||||
field :fast_index, :boolean, default: false
|
field :fast_index, :boolean, default: false
|
||||||
field :download_media, :boolean, default: true
|
field :download_media, :boolean, default: true
|
||||||
@@ -69,6 +65,13 @@ defmodule Pinchflat.Sources.Source do
|
|||||||
# Only download media items that were published after this date
|
# Only download media items that were published after this date
|
||||||
field :download_cutoff_date, :date
|
field :download_cutoff_date, :date
|
||||||
field :original_url, :string
|
field :original_url, :string
|
||||||
|
field :title_filter_regex, :string
|
||||||
|
|
||||||
|
field :series_directory, :string
|
||||||
|
field :nfo_filepath, :string
|
||||||
|
field :poster_filepath, :string
|
||||||
|
field :fanart_filepath, :string
|
||||||
|
field :banner_filepath, :string
|
||||||
|
|
||||||
belongs_to :media_profile, MediaProfile
|
belongs_to :media_profile, MediaProfile
|
||||||
|
|
||||||
@@ -95,7 +98,6 @@ defmodule Pinchflat.Sources.Source do
|
|||||||
|> dynamic_default(:custom_name, fn cs -> get_field(cs, :collection_name) end)
|
|> dynamic_default(:custom_name, fn cs -> get_field(cs, :collection_name) end)
|
||||||
|> validate_required(required_fields)
|
|> validate_required(required_fields)
|
||||||
|> cast_assoc(:metadata, with: &SourceMetadata.changeset/2, required: false)
|
|> cast_assoc(:metadata, with: &SourceMetadata.changeset/2, required: false)
|
||||||
|> unique_constraint([:collection_id, :media_profile_id])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc false
|
@doc false
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<div class="flex h-screen overflow-hidden">
|
<div class="flex h-screen overflow-hidden">
|
||||||
<div class="relative flex flex-1 flex-col overflow-y-auto overflow-x-hidden">
|
<div class="relative flex flex-1 flex-col overflow-y-auto overflow-x-hidden">
|
||||||
<header class="sticky top-0 z-999 flex w-full bg-white drop-shadow-1 dark:bg-boxdark dark:drop-shadow-none">
|
<header class="sticky top-0 z-999 flex w-full bg-white drop-shadow-1 dark:bg-boxdark dark:drop-shadow-none">
|
||||||
<div class="flex flex-grow items-center px-4 py-4 shadow-2 md:px-6 2xl:px-11">
|
<div class="w-65 px-4 py-2 shadow-2 md:px-6">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center gap-2 py-2">
|
||||||
<img src={~p"/images/logo.png?cachebust=2024-02-29"} alt="Pinchflat" class="w-9 h-9" />
|
<img src={~p"/images/logo.png?cachebust=2024-03-20"} alt="Pinchflat" class="w-auto" />
|
||||||
<h2 class="text-xl font-bold text-white pl-2">Pinchflat</h2>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<header class="sticky top-0 z-999 flex w-full bg-white drop-shadow-1 dark:bg-boxdark dark:drop-shadow-none">
|
<header class="sticky top-0 z-999 flex h-20 w-full bg-white drop-shadow-1 dark:bg-boxdark dark:drop-shadow-none">
|
||||||
<div class="flex flex-grow items-center justify-between lg:justify-end px-4 py-4 shadow-2 md:px-6 2xl:px-11">
|
<div class="flex flex-grow items-center justify-between lg:justify-end px-4 py-4 shadow-2 md:px-6 2xl:px-11">
|
||||||
<div class="flex items-center gap-2 sm:gap-4 lg:hidden">
|
<div class="flex items-center gap-2 sm:gap-4 lg:hidden w-2/6">
|
||||||
|
<section class="pr-1">
|
||||||
|
<img src={~p"/images/icon.png?cachebust=2024-03-20"} alt="Pinchflat" class="w-10" />
|
||||||
|
</section>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="z-99999 block rounded-sm border border-stroke bg-white p-1.5 shadow-sm dark:border-strokedark dark:bg-boxdark lg:hidden"
|
class="z-99999 block mx-2 rounded-sm border border-stroke bg-white p-1.5 shadow-sm dark:border-strokedark dark:bg-boxdark lg:hidden"
|
||||||
@click.stop="sidebarVisible = !sidebarVisible"
|
@click.stop="sidebarVisible = !sidebarVisible"
|
||||||
>
|
>
|
||||||
<.icon name="hero-bars-3" />
|
<.icon name="hero-bars-3" />
|
||||||
</button>
|
</button>
|
||||||
<a class="hidden sm:flex items-center lg:hidden" href="/">
|
|
||||||
<img src={~p"/images/logo.png?cachebust=2024-02-29"} alt="Pinchflat" class="w-9 h-9" />
|
|
||||||
<h2 class="text-xl font-bold text-white pl-2">Pinchflat</h2>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-meta-4 rounded-md">
|
<div class="bg-meta-4 rounded-md w-4/6 lg:w-3/6 xl:w-2/6">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<span class="absolute left-2 top-1/2 -translate-y-1/2 flex">
|
<span class="absolute left-2 top-1/2 -translate-y-1/2 flex">
|
||||||
<.icon name="hero-magnifying-glass" />
|
<.icon name="hero-magnifying-glass" />
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
name="q"
|
name="q"
|
||||||
value={@params["q"]}
|
value={@params["q"]}
|
||||||
placeholder="Type to search..."
|
placeholder="Type to search..."
|
||||||
class="w-full bg-transparent pl-9 pr-4 border-0 focus:ring-0 focus:outline-none lg:w-125"
|
class="w-full bg-transparent pl-9 pr-4 border-0 focus:ring-0 focus:outline-none"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
<aside
|
<aside
|
||||||
x-bind:class="sidebarVisible ? 'translate-x-0' : '-translate-x-full'"
|
x-bind:class="sidebarVisible ? 'translate-x-0' : '-translate-x-full'"
|
||||||
class={[
|
class={[
|
||||||
"-translate-x-full absolute left-0 top-0 z-9999 flex h-screen w-60 flex-col overflow-y-hidden justify-between",
|
"-translate-x-full absolute left-0 top-0 z-9999 flex h-screen w-65 flex-col overflow-y-hidden justify-between",
|
||||||
"bg-black duration-300 ease-linear shadow-lg sm:shadow-none dark:bg-boxdark lg:static lg:translate-x-0"
|
"bg-black duration-300 ease-linear shadow-lg sm:shadow-none dark:bg-boxdark lg:static lg:translate-x-0"
|
||||||
]}
|
]}
|
||||||
@click.outside="sidebarVisible = false"
|
@click.outside="sidebarVisible = false"
|
||||||
>
|
>
|
||||||
<section>
|
<section>
|
||||||
<div class="flex items-center justify-between gap-2 px-6 py-5.5 lg:py-6.5">
|
<div class="flex items-center justify-between gap-2 px-6 py-4">
|
||||||
<a href="/" class="flex items-center">
|
<a href="/" class="flex items-center">
|
||||||
<img src={~p"/images/logo.png?cachebust=2024-02-29"} alt="Pinchflat" class="w-9 h-9" />
|
<img src={~p"/images/logo.png?cachebust=2024-03-20"} alt="Pinchflat" class="w-auto" />
|
||||||
<h2 class="text-xl font-bold text-white pl-2">Pinchflat</h2>
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button class="block lg:hidden" @click.stop="sidebarVisible = !sidebarVisible">
|
<button class="block mt-3 lg:hidden" @click.stop="sidebarVisible = !sidebarVisible">
|
||||||
<.icon name="hero-arrow-left" class="fill-current" />
|
<.icon name="hero-arrow-left" class="fill-current" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear">
|
<div class="no-scrollbar flex flex-col overflow-y-auto duration-300 ease-linear">
|
||||||
<nav class="mt-5 px-4 py-4 lg:mt-9 lg:px-6">
|
<nav class="mt-3 px-4 py-4 lg:px-6">
|
||||||
<h3 class="mb-4 ml-4 text-sm font-medium text-bodydark2">MENU</h3>
|
<h3 class="mb-4 ml-4 text-sm font-medium text-bodydark2">MENU</h3>
|
||||||
<div class="flex flex-col justify-between">
|
<div class="flex flex-col justify-between">
|
||||||
<ul class="mb-6 flex flex-col gap-1.5">
|
<ul class="mb-6 flex flex-col gap-1.5">
|
||||||
@@ -31,8 +30,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<nav class="mt-5 px-4 py-4 lg:mt-9 lg:px-6">
|
<nav class="px-4 py-4 lg:px-6">
|
||||||
<ul class="mb-6 flex flex-col gap-1.5">
|
<ul class="mb-6 flex flex-col gap-1.5">
|
||||||
|
<.sidebar_item
|
||||||
|
icon="hero-book-open"
|
||||||
|
text="Docs"
|
||||||
|
target="_blank"
|
||||||
|
href="https://github.com/kieraneglin/pinchflat/wiki"
|
||||||
|
/>
|
||||||
<.sidebar_item
|
<.sidebar_item
|
||||||
icon="hero-code-bracket"
|
icon="hero-code-bracket"
|
||||||
text="Github"
|
text="Github"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<%= assigns[:page_title] || "Pinchflat" %>
|
<%= assigns[:page_title] || "Pinchflat" %>
|
||||||
</.live_title>
|
</.live_title>
|
||||||
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
||||||
<link rel="icon" type="image/x-icon" href={~p"/favicon.ico?cachebust=2024-02-29"} />
|
<link rel="icon" type="image/x-icon" href={~p"/favicon.ico?cachebust=2024-03-20"} />
|
||||||
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -233,12 +233,12 @@
|
|||||||
field={f[:download_source_images]}
|
field={f[:download_source_images]}
|
||||||
type="toggle"
|
type="toggle"
|
||||||
label="Download Series Images"
|
label="Download Series Images"
|
||||||
help="Downloads poster and banner images for use with Jellyfin, Kodi, etc. Only works for full channels (not playlists)"
|
help="Downloads poster and banner images for use with Plex, Jellyfin, Kodi, etc. Only works for full channels (not playlists)"
|
||||||
x-init="$watch('selectedPreset', p => p && (enabled = presets[p]))"
|
x-init="$watch('selectedPreset', p => p && (enabled = presets[p]))"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto">Save Media profile</.button>
|
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto" rounding="rounded-lg">Save Media profile</.button>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">
|
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
<.simple_form :let={f} for={@changeset} action={@action}>
|
<.simple_form
|
||||||
|
:let={f}
|
||||||
|
for={@changeset}
|
||||||
|
action={@action}
|
||||||
|
x-data="{ advancedMode: !!JSON.parse(localStorage.getItem('advancedMode')) }"
|
||||||
|
x-init="$watch('advancedMode', value => localStorage.setItem('advancedMode', JSON.stringify(value)))"
|
||||||
|
>
|
||||||
<.error :if={@changeset.action}>
|
<.error :if={@changeset.action}>
|
||||||
Oops, something went wrong! Please check the errors below.
|
Oops, something went wrong! Please check the errors below.
|
||||||
</.error>
|
</.error>
|
||||||
|
|
||||||
<h3 class="mt-8 text-2xl text-black dark:text-white">
|
<section class="flex justify-between items-center mt-8">
|
||||||
General Options
|
<h3 class=" text-2xl text-black dark:text-white">
|
||||||
</h3>
|
General Options
|
||||||
|
</h3>
|
||||||
|
<span class="cursor-pointer hover:underline" x-on:click="advancedMode = !advancedMode">
|
||||||
|
Editing Mode: <span x-text="advancedMode ? 'Advanced' : 'Basic'"></span>
|
||||||
|
</span>
|
||||||
|
</section>
|
||||||
|
|
||||||
<.input
|
<.input
|
||||||
field={f[:custom_name]}
|
field={f[:custom_name]}
|
||||||
@@ -69,7 +80,24 @@
|
|||||||
help="Only download media uploaded after this date. Leave blank to download all media. Must be in YYYY-MM-DD format"
|
help="Only download media uploaded after this date. Leave blank to download all media. Must be in YYYY-MM-DD format"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto">Save Source</.button>
|
<section x-show="advancedMode">
|
||||||
|
<h3 class="mt-8 text-2xl text-black dark:text-white">
|
||||||
|
Advanced Options
|
||||||
|
</h3>
|
||||||
|
<p class="text-sm mt-2">
|
||||||
|
Tread carefully
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<.input
|
||||||
|
field={f[:title_filter_regex]}
|
||||||
|
type="text"
|
||||||
|
label="Title Filter Regex"
|
||||||
|
placeholder="(?i)^How to Bike$"
|
||||||
|
help="A PCRE-compatible regex. Only media with titles that match this regex will be downloaded. Look up 'SQLean Regex docs' for more"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<.button class="my-10 sm:mb-7.5 w-full sm:w-auto" rounding="rounded-lg">Save Source</.button>
|
||||||
|
|
||||||
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">
|
<div class="rounded-sm dark:bg-meta-4 p-4 md:p-6 mb-5">
|
||||||
<.fast_indexing_help />
|
<.fast_indexing_help />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ defmodule Pinchflat.MixProject do
|
|||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :pinchflat,
|
app: :pinchflat,
|
||||||
version: "0.1.0-alpha.6",
|
version: "0.1.1",
|
||||||
elixir: "~> 1.16",
|
elixir: "~> 1.16",
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
start_permanent: Mix.env() == :prod,
|
start_permanent: Mix.env() == :prod,
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
defmodule Pinchflat.Repo.Migrations.AddTitleRegexToSource do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
alter table(:sources) do
|
||||||
|
add :title_filter_regex, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
defmodule Pinchflat.Repo.Migrations.RemoveUniqueIndexFromSources do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
drop unique_index(:sources, [:collection_id, :media_profile_id])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 164 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd -P -- "$(dirname -- "$0")"
|
||||||
|
exec ./pinchflat eval Pinchflat.Release.check_file_permissions
|
||||||
@@ -1,4 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
/app/bin/check_file_permissions
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Filesystem error. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
/app/bin/migrate
|
/app/bin/migrate
|
||||||
|
|
||||||
cd -P -- "$(dirname -- "$0")"
|
cd -P -- "$(dirname -- "$0")"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ RUN mix local.hex --force && \
|
|||||||
|
|
||||||
# set build ENV
|
# set build ENV
|
||||||
ENV MIX_ENV="prod"
|
ENV MIX_ENV="prod"
|
||||||
|
ENV ERL_FLAGS="+JPperf true"
|
||||||
|
|
||||||
# install mix dependencies
|
# install mix dependencies
|
||||||
COPY mix.exs mix.lock ./
|
COPY mix.exs mix.lock ./
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ defmodule Pinchflat.Downloading.MediaDownloaderTest do
|
|||||||
|
|
||||||
test "it extracts the title", %{media_item: media_item} do
|
test "it extracts the title", %{media_item: media_item} do
|
||||||
assert {:ok, updated_media_item} = MediaDownloader.download_for_media_item(media_item)
|
assert {:ok, updated_media_item} = MediaDownloader.download_for_media_item(media_item)
|
||||||
assert updated_media_item.title == "Trying to Wheelie Without the Rear Brake"
|
assert updated_media_item.title == "Pinchflat Example Video"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it extracts the description", %{media_item: media_item} do
|
test "it extracts the description", %{media_item: media_item} do
|
||||||
|
|||||||
@@ -34,6 +34,29 @@ defmodule Pinchflat.Filesystem.FilesystemHelpersTest do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "write_p/3" do
|
||||||
|
test "writes content to a file" do
|
||||||
|
filepath = FilesystemHelpers.generate_metadata_tmpfile(:json)
|
||||||
|
content = "{}"
|
||||||
|
|
||||||
|
assert :ok = FilesystemHelpers.write_p(filepath, content)
|
||||||
|
assert File.read!(filepath) == content
|
||||||
|
|
||||||
|
File.rm!(filepath)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "creates directories as needed" do
|
||||||
|
tmpfile_directory = Application.get_env(:pinchflat, :tmpfile_directory)
|
||||||
|
filepath = Path.join([tmpfile_directory, "foo", "bar", "file.json"])
|
||||||
|
content = "{}"
|
||||||
|
|
||||||
|
assert :ok = FilesystemHelpers.write_p(filepath, content)
|
||||||
|
assert File.read!(filepath) == content
|
||||||
|
|
||||||
|
File.rm!(filepath)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "write_p!/3" do
|
describe "write_p!/3" do
|
||||||
test "writes content to a file" do
|
test "writes content to a file" do
|
||||||
filepath = FilesystemHelpers.generate_metadata_tmpfile(:json)
|
filepath = FilesystemHelpers.generate_metadata_tmpfile(:json)
|
||||||
|
|||||||
@@ -239,6 +239,26 @@ defmodule Pinchflat.MediaTest do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "list_pending_media_items_for/1 when testing title regex" do
|
||||||
|
test "returns only media items that match the title regex" do
|
||||||
|
source = source_fixture(%{title_filter_regex: "(?i)^FOO$"})
|
||||||
|
|
||||||
|
matching_media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "foo"})
|
||||||
|
_non_matching_media_item = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "bar"})
|
||||||
|
|
||||||
|
assert Media.list_pending_media_items_for(source) == [matching_media_item]
|
||||||
|
end
|
||||||
|
|
||||||
|
test "does not apply a regex if none is specified" do
|
||||||
|
source = source_fixture(%{title_filter_regex: nil})
|
||||||
|
|
||||||
|
media_item_one = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "foo"})
|
||||||
|
media_item_two = media_item_fixture(%{source_id: source.id, media_filepath: nil, title: "bar"})
|
||||||
|
|
||||||
|
assert Media.list_pending_media_items_for(source) == [media_item_one, media_item_two]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "list_downloaded_media_items_for/1" do
|
describe "list_downloaded_media_items_for/1" do
|
||||||
test "returns only media items with a media_filepath" do
|
test "returns only media items with a media_filepath" do
|
||||||
source = source_fixture()
|
source = source_fixture()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ defmodule Pinchflat.Metadata.MetadataParserTest do
|
|||||||
test "it extracts the media filepath", %{metadata: metadata} do
|
test "it extracts the media filepath", %{metadata: metadata} do
|
||||||
result = Parser.parse_for_media_item(metadata)
|
result = Parser.parse_for_media_item(metadata)
|
||||||
|
|
||||||
assert String.contains?(result.media_filepath, "bwRHIkYqYJo")
|
assert String.contains?(result.media_filepath, "Pinchflat Example Video-ABC123")
|
||||||
assert String.ends_with?(result.media_filepath, ".mkv")
|
assert String.ends_with?(result.media_filepath, ".mkv")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -138,49 +138,6 @@ defmodule Pinchflat.SourcesTest do
|
|||||||
assert {:error, %Ecto.Changeset{}} = Sources.create_source(@invalid_source_attrs)
|
assert {:error, %Ecto.Changeset{}} = Sources.create_source(@invalid_source_attrs)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "creation enforces uniqueness of collection_id scoped to the media_profile" do
|
|
||||||
expect(YtDlpRunnerMock, :run, 2, fn _url, _opts, _ot ->
|
|
||||||
{:ok,
|
|
||||||
Phoenix.json_library().encode!(%{
|
|
||||||
channel: "some channel name",
|
|
||||||
channel_id: "some_channel_id_12345678",
|
|
||||||
playlist_id: "some_channel_id_12345678",
|
|
||||||
playlist_title: "some channel name - videos"
|
|
||||||
})}
|
|
||||||
end)
|
|
||||||
|
|
||||||
valid_once_attrs = %{
|
|
||||||
media_profile_id: media_profile_fixture().id,
|
|
||||||
original_url: "https://www.youtube.com/channel/abc123"
|
|
||||||
}
|
|
||||||
|
|
||||||
assert {:ok, %Source{}} = Sources.create_source(valid_once_attrs)
|
|
||||||
assert {:error, %Ecto.Changeset{}} = Sources.create_source(valid_once_attrs)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "creation lets you duplicate collection_ids as long as the media profile is different" do
|
|
||||||
expect(YtDlpRunnerMock, :run, 2, fn _url, _opts, _ot ->
|
|
||||||
{:ok,
|
|
||||||
Phoenix.json_library().encode!(%{
|
|
||||||
channel: "some channel name",
|
|
||||||
channel_id: "some_channel_id_12345678",
|
|
||||||
playlist_id: "some_channel_id_12345678",
|
|
||||||
playlist_title: "some channel name - videos"
|
|
||||||
})}
|
|
||||||
end)
|
|
||||||
|
|
||||||
valid_attrs = %{
|
|
||||||
name: "some name",
|
|
||||||
original_url: "https://www.youtube.com/channel/abc123"
|
|
||||||
}
|
|
||||||
|
|
||||||
source_1_attrs = Map.merge(valid_attrs, %{media_profile_id: media_profile_fixture().id})
|
|
||||||
source_2_attrs = Map.merge(valid_attrs, %{media_profile_id: media_profile_fixture().id})
|
|
||||||
|
|
||||||
assert {:ok, %Source{}} = Sources.create_source(source_1_attrs)
|
|
||||||
assert {:ok, %Source{}} = Sources.create_source(source_2_attrs)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "creation will schedule the indexing task" do
|
test "creation will schedule the indexing task" do
|
||||||
expect(YtDlpRunnerMock, :run, &channel_mock/3)
|
expect(YtDlpRunnerMock, :run, &channel_mock/3)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
|
|||||||
alias Pinchflat.YtDlp.Media
|
alias Pinchflat.YtDlp.Media
|
||||||
alias Pinchflat.YtDlp.MediaCollection
|
alias Pinchflat.YtDlp.MediaCollection
|
||||||
|
|
||||||
@channel_url "https://www.youtube.com/c/TheUselessTrials"
|
@channel_url "https://www.youtube.com/c/PinchflatTestChannel"
|
||||||
|
|
||||||
setup :verify_on_exit!
|
setup :verify_on_exit!
|
||||||
|
|
||||||
@@ -77,10 +77,10 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
|
|||||||
test "it returns a map with data on success" do
|
test "it returns a map with data on success" do
|
||||||
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
|
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
|
||||||
Phoenix.json_library().encode(%{
|
Phoenix.json_library().encode(%{
|
||||||
channel: "TheUselessTrials",
|
channel: "PinchflatTestChannel",
|
||||||
channel_id: "UCQH2",
|
channel_id: "UCQH2",
|
||||||
playlist_id: "PLQH2",
|
playlist_id: "PLQH2",
|
||||||
playlist_title: "TheUselessTrials - Videos"
|
playlist_title: "PinchflatTestChannel - Videos"
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -88,9 +88,9 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
|
|||||||
|
|
||||||
assert %{
|
assert %{
|
||||||
channel_id: "UCQH2",
|
channel_id: "UCQH2",
|
||||||
channel_name: "TheUselessTrials",
|
channel_name: "PinchflatTestChannel",
|
||||||
playlist_id: "PLQH2",
|
playlist_id: "PLQH2",
|
||||||
playlist_name: "TheUselessTrials - Videos"
|
playlist_name: "PinchflatTestChannel - Videos"
|
||||||
} = res
|
} = res
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -121,12 +121,12 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do
|
|||||||
describe "get_source_metadata/1" do
|
describe "get_source_metadata/1" do
|
||||||
test "it returns a map with data on success" do
|
test "it returns a map with data on success" do
|
||||||
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
|
expect(YtDlpRunnerMock, :run, fn _url, _opts, _ot ->
|
||||||
Phoenix.json_library().encode(%{channel: "TheUselessTrials"})
|
Phoenix.json_library().encode(%{channel: "PinchflatTestChannel"})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
assert {:ok, res} = MediaCollection.get_source_metadata(@channel_url)
|
assert {:ok, res} = MediaCollection.get_source_metadata(@channel_url)
|
||||||
|
|
||||||
assert %{"channel" => "TheUselessTrials"} = res
|
assert %{"channel" => "PinchflatTestChannel"} = res
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it passes the expected args to the backend runner" do
|
test "it passes the expected args to the backend runner" do
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ defmodule Pinchflat.YtDlp.MediaTest do
|
|||||||
{:ok, render_metadata(:media_metadata)}
|
{:ok, render_metadata(:media_metadata)}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
assert {:ok, %{"title" => "Trying to Wheelie Without the Rear Brake"}} =
|
assert {:ok, %{"title" => "Pinchflat Example Video"}} =
|
||||||
Media.download(@media_url)
|
Media.download(@media_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 207 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 824 B |
|
After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 824 B |
@@ -1,49 +1,15 @@
|
|||||||
{
|
{
|
||||||
"id": "TheUselessTrials",
|
"id": "PinchflatTestChannel",
|
||||||
"channel": "TheUselessTrials",
|
"channel": "PinchflatTestChannel",
|
||||||
"channel_id": "UCEi9yL4vhQlLafWRsAgAr3w",
|
"channel_id": "UCEABC123",
|
||||||
"title": "TheUselessTrials",
|
"title": "PinchflatTestChannel",
|
||||||
"availability": null,
|
"availability": null,
|
||||||
"channel_follower_count": 35000,
|
"channel_follower_count": 35000,
|
||||||
"description": "My name is Max and I'm a Street Trials bike rider with a passion for making videos. My channel features everything from learning and experiments all the way to just plain bike action. The first video series I started is called Quick New Trick and it featured me trying to learn new bike skills as quickly as possible, to show you how you can learn them as well.\n\nHope you enjoy the videos! See you in the comments section.",
|
"description": "This is a test file for Pinchflat",
|
||||||
"tags": [
|
"tags": ["test", "development"],
|
||||||
"Useless Trials",
|
|
||||||
"TUT",
|
|
||||||
"UT",
|
|
||||||
"Max Fiergolla",
|
|
||||||
"maxfiergolla",
|
|
||||||
"Street Trial Bikes",
|
|
||||||
"Bike Tricks",
|
|
||||||
"How To",
|
|
||||||
"bike trial",
|
|
||||||
"TRIAL BIKE",
|
|
||||||
"quick new trick",
|
|
||||||
"bike hacks",
|
|
||||||
"trials bike",
|
|
||||||
"bike trials",
|
|
||||||
"TRIALS",
|
|
||||||
"street trial",
|
|
||||||
"trial street",
|
|
||||||
"trials biking",
|
|
||||||
"bike tricks",
|
|
||||||
"bmx tricks",
|
|
||||||
"mtb",
|
|
||||||
"mtb tricks",
|
|
||||||
"danny macaskill",
|
|
||||||
"martyn ashton",
|
|
||||||
"macaskill",
|
|
||||||
"bike stunts",
|
|
||||||
"mountainbike stunts",
|
|
||||||
"mountainbiking",
|
|
||||||
"inspired bicycles",
|
|
||||||
"imaginate",
|
|
||||||
"fahrrad tricks",
|
|
||||||
"fahrradtricks",
|
|
||||||
"fahrrad stunts"
|
|
||||||
],
|
|
||||||
"thumbnails": [
|
"thumbnails": [
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w320-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 88,
|
"height": 88,
|
||||||
"width": 320,
|
"width": 320,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -52,7 +18,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.0.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.0.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w320-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 180,
|
"height": 180,
|
||||||
"width": 320,
|
"width": 320,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -61,7 +27,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.1.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.1.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w640-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 175,
|
"height": 175,
|
||||||
"width": 640,
|
"width": 640,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -70,7 +36,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.2.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.2.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w854-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 480,
|
"height": 480,
|
||||||
"width": 854,
|
"width": 854,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -79,7 +45,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.3.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.3.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w960-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 263,
|
"height": 263,
|
||||||
"width": 960,
|
"width": 960,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -88,7 +54,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.4.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.4.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 175,
|
"height": 175,
|
||||||
"width": 1060,
|
"width": 1060,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -97,7 +63,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.5.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.5.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1138-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 188,
|
"height": 188,
|
||||||
"width": 1138,
|
"width": 1138,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -106,7 +72,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.6.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.6.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1280-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 351,
|
"height": 351,
|
||||||
"width": 1280,
|
"width": 1280,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -115,7 +81,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.7.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.7.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1280-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 720,
|
"height": 720,
|
||||||
"width": 1280,
|
"width": 1280,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -124,7 +90,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.8.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.8.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1440-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 395,
|
"height": 395,
|
||||||
"width": 1440,
|
"width": 1440,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -133,7 +99,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.9.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.9.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1707-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 283,
|
"height": 283,
|
||||||
"width": 1707,
|
"width": 1707,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -142,7 +108,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.10.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.10.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1920-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 1080,
|
"height": 1080,
|
||||||
"width": 1920,
|
"width": 1920,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -151,7 +117,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.11.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.11.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2120-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 351,
|
"height": 351,
|
||||||
"width": 2120,
|
"width": 2120,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -160,7 +126,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.12.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.12.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2120-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 1192,
|
"height": 1192,
|
||||||
"width": 2120,
|
"width": 2120,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -169,7 +135,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.13.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.13.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2276-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 377,
|
"height": 377,
|
||||||
"width": 2276,
|
"width": 2276,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -178,7 +144,7 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.14.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.14.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
|
"url": "https://google.ca",
|
||||||
"height": 424,
|
"height": 424,
|
||||||
"width": 2560,
|
"width": 2560,
|
||||||
"preference": -10,
|
"preference": -10,
|
||||||
@@ -187,13 +153,13 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.15.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.15.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=s0",
|
"url": "https://google.ca",
|
||||||
"id": "banner_uncropped",
|
"id": "banner_uncropped",
|
||||||
"preference": -5,
|
"preference": -5,
|
||||||
"filepath": "/app/test/support/files/channel_photos/a.banner_uncropped.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.banner_uncropped.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/ytc/AIdro_kw1KKWzbFmvq6u8WljTbo6QQ318WoAwnjX3AYrjA=s900-c-k-c0x00ffffff-no-rj",
|
"url": "https://google.ca",
|
||||||
"height": 900,
|
"height": 900,
|
||||||
"width": 900,
|
"width": 900,
|
||||||
"id": "17",
|
"id": "17",
|
||||||
@@ -201,24 +167,24 @@
|
|||||||
"filepath": "/app/test/support/files/channel_photos/a.17.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.17.jpg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://yt3.googleusercontent.com/ytc/AIdro_kw1KKWzbFmvq6u8WljTbo6QQ318WoAwnjX3AYrjA=s0",
|
"url": "https://google.ca",
|
||||||
"id": "avatar_uncropped",
|
"id": "avatar_uncropped",
|
||||||
"preference": 1,
|
"preference": 1,
|
||||||
"filepath": "/app/test/support/files/channel_photos/a.avatar_uncropped.jpg"
|
"filepath": "/app/test/support/files/channel_photos/a.avatar_uncropped.jpg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"uploader_id": "@TheUselessTrials",
|
"uploader_id": "@PinchflatTestChannel",
|
||||||
"uploader_url": "https://www.youtube.com/@TheUselessTrials",
|
"uploader_url": "https://www.youtube.com/@PinchflatTestChannel",
|
||||||
"modified_date": null,
|
"modified_date": null,
|
||||||
"view_count": null,
|
"view_count": null,
|
||||||
"playlist_count": 2,
|
"playlist_count": 2,
|
||||||
"uploader": "TheUselessTrials",
|
"uploader": "PinchflatTestChannel",
|
||||||
"channel_url": "https://www.youtube.com/channel/UCEi9yL4vhQlLafWRsAgAr3w",
|
"channel_url": "https://www.youtube.com/channel/UCEABC123",
|
||||||
"_type": "playlist",
|
"_type": "playlist",
|
||||||
"entries": [],
|
"entries": [],
|
||||||
"webpage_url": "https://www.youtube.com/c/TheUselessTrials",
|
"webpage_url": "https://www.youtube.com/c/PinchflatTestChannel",
|
||||||
"original_url": "https://www.youtube.com/c/TheUselessTrials",
|
"original_url": "https://www.youtube.com/c/PinchflatTestChannel",
|
||||||
"webpage_url_basename": "TheUselessTrials",
|
"webpage_url_basename": "PinchflatTestChannel",
|
||||||
"webpage_url_domain": "youtube.com",
|
"webpage_url_domain": "youtube.com",
|
||||||
"extractor": "youtube:tab",
|
"extractor": "youtube:tab",
|
||||||
"extractor_key": "YoutubeTab",
|
"extractor_key": "YoutubeTab",
|
||||||
@@ -227,7 +193,6 @@
|
|||||||
"epoch": 1710800380,
|
"epoch": 1710800380,
|
||||||
"filename": "/app/test/support/files/channel_photos/a.NA",
|
"filename": "/app/test/support/files/channel_photos/a.NA",
|
||||||
"formats_table": null,
|
"formats_table": null,
|
||||||
"thumbnails_table": "ID Width Height URL\n0 320 88 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w320-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj\n1 320 180 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w320-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj\n2 640 175 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w640-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj\n3 854 480 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w854-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj\n4 960 263 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w960-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj\n5 1060 175 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\n6 1138 188 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1138-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\n7 1280 351 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1280-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj\n8 1280 720 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1280-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj\n9 1440 395 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1440-fcrop64=1,32b75a57cd48a5a8-k-c0xffffffff-no-nd-rj\n10 1707 283 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1707-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\n11 1920 1080 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w1920-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj\n12 2120 351 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2120-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\n13 2120 1192 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2120-fcrop64=1,00000000ffffffff-k-c0xffffffff-no-nd-rj\n14 2276 377 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2276-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\n15 2560 424 https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj\nbanner_uncropped unknown unknown https://yt3.googleusercontent.com/_yUVmZqHvZZhNOFq2iMUPA82LylawAvYknCrwTE_9_IUQ0htiLPet2FKxE1ArvLAKf0lVsLccQ=s0\n17 900 900 https://yt3.googleusercontent.com/ytc/AIdro_kw1KKWzbFmvq6u8WljTbo6QQ318WoAwnjX3AYrjA=s900-c-k-c0x00ffffff-no-rj\navatar_uncropped unknown unknown https://yt3.googleusercontent.com/ytc/AIdro_kw1KKWzbFmvq6u8WljTbo6QQ318WoAwnjX3AYrjA=s0",
|
|
||||||
"subtitles_table": null,
|
"subtitles_table": null,
|
||||||
"automatic_captions_table": null,
|
"automatic_captions_table": null,
|
||||||
"duration_string": null,
|
"duration_string": null,
|
||||||
|
|||||||