mirror of
https://github.com/tubearchivist/jellyfin.git
synced 2024-11-17 01:10:14 +00:00
Add ability to have a different name for folder
This commit is contained in:
parent
eb4558569c
commit
2481248736
@ -53,6 +53,7 @@ An example configuration is provided in the docker-compose.yml file. Configure t
|
|||||||
- `TA_TOKEN`: Tube Archivist API token, accessible from the settings page
|
- `TA_TOKEN`: Tube Archivist API token, accessible from the settings page
|
||||||
- `JF_URL`: Full URL where Jellyfin is reachable
|
- `JF_URL`: Full URL where Jellyfin is reachable
|
||||||
- `JF_TOKEN`: Jellyfin API token
|
- `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.
|
- `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.
|
Mount the `/youtube` folder from Tube Archivist also in this container at `/youtube` to give this integration access to the media archive.
|
||||||
@ -83,6 +84,7 @@ pip install requests
|
|||||||
- `ta_token`: Tube Archivist API token, accessible from the settings page
|
- `ta_token`: Tube Archivist API token, accessible from the settings page
|
||||||
- `jf_url`: Full URL where Jellyfin is reachable
|
- `jf_url`: Full URL where Jellyfin is reachable
|
||||||
- `jf_token`: Jellyfin API token
|
- `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.
|
Then run the script from the main folder with python, e.g.
|
||||||
```python
|
```python
|
||||||
|
@ -38,6 +38,7 @@ def get_config_env() -> ConfigType | Literal[False]:
|
|||||||
"ta_token": os.environ["TA_TOKEN"],
|
"ta_token": os.environ["TA_TOKEN"],
|
||||||
"jf_url": os.environ["JF_URL"],
|
"jf_url": os.environ["JF_URL"],
|
||||||
"jf_token": os.environ["JF_TOKEN"],
|
"jf_token": os.environ["JF_TOKEN"],
|
||||||
|
"jf_folder": os.environ['JF_FOLDER']
|
||||||
}
|
}
|
||||||
return config_content
|
return config_content
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ from src.static_types import ConfigType, TAChannel, TAVideo
|
|||||||
|
|
||||||
CONFIG: ConfigType = get_config()
|
CONFIG: ConfigType = get_config()
|
||||||
TIMEOUT = 60
|
TIMEOUT = 60
|
||||||
EXPECTED_ENV = {"ta_url", "ta_token", "jf_url", "jf_token", "ta_video_path"}
|
EXPECTED_ENV = {"ta_url", "ta_token", "jf_url", "jf_token", "ta_video_path"} # js_folder is optional
|
||||||
|
|
||||||
|
|
||||||
class Jellyfin:
|
class Jellyfin:
|
||||||
|
@ -22,8 +22,15 @@ class Library:
|
|||||||
"""get collection id for youtube folder"""
|
"""get collection id for youtube folder"""
|
||||||
path: str = "Items?Recursive=true&includeItemTypes=Folder"
|
path: str = "Items?Recursive=true&includeItemTypes=Folder"
|
||||||
folders: dict = Jellyfin().get(path)
|
folders: dict = Jellyfin().get(path)
|
||||||
|
folder_name: str | None = get_config()["jf_folder"]
|
||||||
|
|
||||||
|
if not folder_name or len(folder_name) < 1:
|
||||||
|
folder_name = "youtube"
|
||||||
|
else:
|
||||||
|
folder_name = folder_name.lower()
|
||||||
|
|
||||||
for folder in folders["Items"]:
|
for folder in folders["Items"]:
|
||||||
if folder.get("Name").lower() == "youtube":
|
if folder.get("Name").lower() == folder_name:
|
||||||
return folder.get("Id")
|
return folder.get("Id")
|
||||||
|
|
||||||
raise ValueError("youtube folder not found")
|
raise ValueError("youtube folder not found")
|
||||||
|
@ -11,6 +11,7 @@ class ConfigType(TypedDict):
|
|||||||
ta_token: str
|
ta_token: str
|
||||||
jf_url: str
|
jf_url: str
|
||||||
jf_token: str
|
jf_token: str
|
||||||
|
jf_folder: str | None
|
||||||
|
|
||||||
|
|
||||||
class TAChannel(TypedDict):
|
class TAChannel(TypedDict):
|
||||||
|
@ -3,5 +3,6 @@
|
|||||||
"ta_url": "http://tubearchivist.local",
|
"ta_url": "http://tubearchivist.local",
|
||||||
"ta_token": "xxxxxxxxxxxxxxxx",
|
"ta_token": "xxxxxxxxxxxxxxxx",
|
||||||
"jf_url": "http://jellyfin.local:8096",
|
"jf_url": "http://jellyfin.local:8096",
|
||||||
"jf_token": "yyyyyyyyyyyyyyyy"
|
"jf_token": "yyyyyyyyyyyyyyyy",
|
||||||
|
"jf_folder": "YouTube"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user