mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2025-07-05 16:51:11 +00:00
Compare commits
No commits in common. "f3661cba452393e56b9927b73868be6ba5d56b6a" and "3e0e13e18e70bbebdfc3d96e0797e829e713eeb5" have entirely different histories.
f3661cba45
...
3e0e13e18e
@ -1,4 +1,4 @@
|
||||
FROM python:3.11.8-slim-bookworm
|
||||
FROM python:3.11.3-slim-bullseye
|
||||
ARG INSTALL_DEBUG
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
|
16
README.md
16
README.md
@ -1,17 +1,3 @@
|
||||
## 📢 Important Announcement: Repository Deprecation and Migration
|
||||
We want to inform you that we are deprecating this repository,
|
||||
[tubearchivist-jf ](https://github.com/tubearchivist/tubearchivist-jf), and moving to an updated repo, [tubearchivist-jf-plugin](https://github.com/tubearchivist/tubearchivist-jf-plugin).
|
||||
This decision comes as part of our efforts to streamline our development process and provide a better experience for our users.
|
||||
|
||||
The new plugin offers better features, as well as a more futureproof codebase.
|
||||
|
||||
***Key Dates:***
|
||||
- [tubearchivist-jf ](https://github.com/tubearchivist/tubearchivist-jf) will be set to read-only on **July 20th, 2024**.
|
||||
|
||||
***What Does This Mean for You?***
|
||||
- We strongly suggest *not* installing this repo as it will stop receiving updates.
|
||||
- Transition to the new repo at your earliest convenience.
|
||||
|
||||
## Tube Archivist Jellyfin Integration
|
||||
Import your Tube Archivist media folder into Jellyfin
|
||||
|
||||
@ -67,7 +53,6 @@ An example configuration is provided in the docker-compose.yml file. Configure t
|
||||
- `TA_TOKEN`: Tube Archivist API token, accessible from the settings page
|
||||
- `JF_URL`: Full URL where Jellyfin is reachable
|
||||
- `JF_TOKEN`: Jellyfin API token
|
||||
- `JF_FOLDER`: Folder override if your folder is not named "YouTube" on your Filesystem.
|
||||
- `LISTEN_PORT`: Optionally change the port where the integration is listening for messages. Defaults to `8001`. If you change this, make sure to also change the json link for auto trigger as described below.
|
||||
|
||||
Mount the `/youtube` folder from Tube Archivist also in this container at `/youtube` to give this integration access to the media archive.
|
||||
@ -98,7 +83,6 @@ pip install requests
|
||||
- `ta_token`: Tube Archivist API token, accessible from the settings page
|
||||
- `jf_url`: Full URL where Jellyfin is reachable
|
||||
- `jf_token`: Jellyfin API token
|
||||
- `jf_folder`: Name of the folder where TubeArchivist puts the files into
|
||||
|
||||
Then run the script from the main folder with python, e.g.
|
||||
```python
|
||||
|
@ -38,7 +38,6 @@ def get_config_env() -> ConfigType | Literal[False]:
|
||||
"ta_token": os.environ["TA_TOKEN"],
|
||||
"jf_url": os.environ["JF_URL"],
|
||||
"jf_token": os.environ["JF_TOKEN"],
|
||||
"jf_folder": os.environ.get("JF_FOLDER", "youtube"),
|
||||
}
|
||||
return config_content
|
||||
|
||||
|
@ -9,14 +9,7 @@ from src.static_types import ConfigType, TAChannel, TAVideo
|
||||
|
||||
CONFIG: ConfigType = get_config()
|
||||
TIMEOUT = 60
|
||||
EXPECTED_ENV = {
|
||||
"ta_url",
|
||||
"ta_token",
|
||||
"jf_url",
|
||||
"jf_token",
|
||||
"ta_video_path",
|
||||
"jf_folder",
|
||||
}
|
||||
EXPECTED_ENV = {"ta_url", "ta_token", "jf_url", "jf_token", "ta_video_path"}
|
||||
|
||||
|
||||
class Jellyfin:
|
||||
|
@ -22,10 +22,8 @@ class Library:
|
||||
"""get collection id for youtube folder"""
|
||||
path: str = "Items?Recursive=true&includeItemTypes=Folder"
|
||||
folders: dict = Jellyfin().get(path)
|
||||
folder_name: str = get_config()["jf_folder"]
|
||||
|
||||
for folder in folders["Items"]:
|
||||
if folder.get("Name").lower() == folder_name.lower():
|
||||
if folder.get("Name").lower() == "youtube":
|
||||
return folder.get("Id")
|
||||
|
||||
raise ValueError("youtube folder not found")
|
||||
@ -78,7 +76,7 @@ class Library:
|
||||
)
|
||||
Jellyfin().post(path, False)
|
||||
|
||||
while True:
|
||||
for _ in range(12):
|
||||
response = Jellyfin().get("Library/VirtualFolders")
|
||||
for folder in response:
|
||||
if not folder["ItemId"] == collection_id:
|
||||
@ -88,7 +86,7 @@ class Library:
|
||||
return
|
||||
|
||||
print("waiting for library refresh")
|
||||
sleep(10)
|
||||
sleep(5)
|
||||
|
||||
|
||||
class Show:
|
||||
@ -215,13 +213,10 @@ class Show:
|
||||
path: str = (
|
||||
f"Items/{jf_id}/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default" # noqa: E501
|
||||
)
|
||||
print(f"[setup] {path=}")
|
||||
Jellyfin().post(path, False)
|
||||
for _ in range(24):
|
||||
for _ in range(12):
|
||||
all_existing: set[str] = set(self._get_existing_seasons())
|
||||
|
||||
print(f"[setup] seasons: {all_existing} {expected_season=}")
|
||||
|
||||
if expected_season in all_existing:
|
||||
return
|
||||
|
||||
|
@ -11,7 +11,6 @@ class ConfigType(TypedDict):
|
||||
ta_token: str
|
||||
jf_url: str
|
||||
jf_token: str
|
||||
jf_folder: str
|
||||
|
||||
|
||||
class TAChannel(TypedDict):
|
||||
|
@ -3,6 +3,5 @@
|
||||
"ta_url": "http://tubearchivist.local",
|
||||
"ta_token": "xxxxxxxxxxxxxxxx",
|
||||
"jf_url": "http://jellyfin.local:8096",
|
||||
"jf_token": "yyyyyyyyyyyyyyyy",
|
||||
"jf_folder": "YouTube"
|
||||
"jf_token": "yyyyyyyyyyyyyyyy"
|
||||
}
|
||||
|
@ -17,12 +17,12 @@ function validate {
|
||||
echo "running black"
|
||||
black --force-exclude "migrations/*" --diff --color --check -l 79 "$check_path"
|
||||
echo "running codespell"
|
||||
codespell --skip="./.git,./.venv,venv,./.mypy_cache" "$check_path"
|
||||
codespell --skip="./.git,./.venv,./.mypy_cache" "$check_path"
|
||||
echo "running flake8"
|
||||
flake8 "$check_path" --exclude "migrations,.venv,venv" --count --max-complexity=10 \
|
||||
flake8 "$check_path" --exclude "migrations,.venv" --count --max-complexity=10 \
|
||||
--max-line-length=79 --show-source --statistics
|
||||
echo "running isort"
|
||||
isort --skip "migrations" --skip ".venv" --skip "venv" --check-only --diff --profile black -l 79 "$check_path"
|
||||
isort --skip "migrations" --skip ".venv" --check-only --diff --profile black -l 79 "$check_path"
|
||||
printf " \n> all validations passed\n"
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user