emby-cli 0.0.0rc1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- emby_cli-0.0.0rc1/.env.example +15 -0
- emby_cli-0.0.0rc1/.github/workflows/ci.yml +38 -0
- emby_cli-0.0.0rc1/.github/workflows/publish.yml +53 -0
- emby_cli-0.0.0rc1/.github/workflows/release.yml +140 -0
- emby_cli-0.0.0rc1/.gitignore +11 -0
- emby_cli-0.0.0rc1/AGENTS.md +518 -0
- emby_cli-0.0.0rc1/CHANGELOG.md +244 -0
- emby_cli-0.0.0rc1/LICENSE +20 -0
- emby_cli-0.0.0rc1/PKG-INFO +287 -0
- emby_cli-0.0.0rc1/README.md +252 -0
- emby_cli-0.0.0rc1/pyproject.toml +82 -0
- emby_cli-0.0.0rc1/src/emby_cli/__init__.py +14 -0
- emby_cli-0.0.0rc1/src/emby_cli/__main__.py +4 -0
- emby_cli-0.0.0rc1/src/emby_cli/_version.py +24 -0
- emby_cli-0.0.0rc1/src/emby_cli/api/__init__.py +7 -0
- emby_cli-0.0.0rc1/src/emby_cli/api/collections.py +110 -0
- emby_cli-0.0.0rc1/src/emby_cli/api/items.py +380 -0
- emby_cli-0.0.0rc1/src/emby_cli/api/libraries.py +49 -0
- emby_cli-0.0.0rc1/src/emby_cli/auth_cache.py +389 -0
- emby_cli-0.0.0rc1/src/emby_cli/cli.py +703 -0
- emby_cli-0.0.0rc1/src/emby_cli/client.py +1059 -0
- emby_cli-0.0.0rc1/src/emby_cli/collection_ops.py +368 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/__init__.py +1 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/collection.py +495 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/config.py +130 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/help.py +27 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/info.py +131 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/item.py +361 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/library.py +259 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/login.py +29 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/logout.py +73 -0
- emby_cli-0.0.0rc1/src/emby_cli/commands/version.py +38 -0
- emby_cli-0.0.0rc1/src/emby_cli/constants.py +30 -0
- emby_cli-0.0.0rc1/src/emby_cli/credentials.py +115 -0
- emby_cli-0.0.0rc1/src/emby_cli/data_cache.py +72 -0
- emby_cli-0.0.0rc1/src/emby_cli/detail_output.py +167 -0
- emby_cli-0.0.0rc1/src/emby_cli/download_ops.py +75 -0
- emby_cli-0.0.0rc1/src/emby_cli/item_ops.py +1013 -0
- emby_cli-0.0.0rc1/src/emby_cli/library_ops.py +183 -0
- emby_cli-0.0.0rc1/src/emby_cli/media_sort.py +92 -0
- emby_cli-0.0.0rc1/src/emby_cli/output.py +80 -0
- emby_cli-0.0.0rc1/src/emby_cli/resolve.py +375 -0
- emby_cli-0.0.0rc1/src/emby_cli/types.py +125 -0
- emby_cli-0.0.0rc1/src/emby_cli/util.py +170 -0
- emby_cli-0.0.0rc1/src/emby_cli/version.py +17 -0
- emby_cli-0.0.0rc1/tests/test_auth_cache.py +195 -0
- emby_cli-0.0.0rc1/tests/test_auth_expired.py +71 -0
- emby_cli-0.0.0rc1/tests/test_client.py +192 -0
- emby_cli-0.0.0rc1/tests/test_client_collection.py +225 -0
- emby_cli-0.0.0rc1/tests/test_client_item.py +170 -0
- emby_cli-0.0.0rc1/tests/test_client_library.py +59 -0
- emby_cli-0.0.0rc1/tests/test_client_retry.py +688 -0
- emby_cli-0.0.0rc1/tests/test_collection.py +357 -0
- emby_cli-0.0.0rc1/tests/test_collection_ops.py +237 -0
- emby_cli-0.0.0rc1/tests/test_config.py +143 -0
- emby_cli-0.0.0rc1/tests/test_credentials.py +125 -0
- emby_cli-0.0.0rc1/tests/test_data_cache.py +21 -0
- emby_cli-0.0.0rc1/tests/test_download_one.py +129 -0
- emby_cli-0.0.0rc1/tests/test_download_ops.py +112 -0
- emby_cli-0.0.0rc1/tests/test_info.py +113 -0
- emby_cli-0.0.0rc1/tests/test_item.py +398 -0
- emby_cli-0.0.0rc1/tests/test_item_ops.py +402 -0
- emby_cli-0.0.0rc1/tests/test_item_performance.py +35 -0
- emby_cli-0.0.0rc1/tests/test_library.py +219 -0
- emby_cli-0.0.0rc1/tests/test_library_ops.py +114 -0
- emby_cli-0.0.0rc1/tests/test_logout.py +90 -0
- emby_cli-0.0.0rc1/tests/test_media_sort.py +55 -0
- emby_cli-0.0.0rc1/tests/test_output.py +46 -0
- emby_cli-0.0.0rc1/tests/test_parser.py +257 -0
- emby_cli-0.0.0rc1/tests/test_resolve.py +70 -0
- emby_cli-0.0.0rc1/tests/test_resolve_table.py +137 -0
- emby_cli-0.0.0rc1/tests/test_resolve_titles.py +164 -0
- emby_cli-0.0.0rc1/tests/test_session_auth.py +125 -0
- emby_cli-0.0.0rc1/tests/test_urllib3_warning.py +22 -0
- emby_cli-0.0.0rc1/tests/test_util.py +90 -0
- emby_cli-0.0.0rc1/tests/test_validate_args.py +198 -0
- emby_cli-0.0.0rc1/tests/test_version.py +130 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Emby server (required)
|
|
2
|
+
EMBY_SERVER=http://emby.example:8096
|
|
3
|
+
|
|
4
|
+
# Auth: API key OR username/password
|
|
5
|
+
EMBY_API_KEY=
|
|
6
|
+
EMBY_USERNAME=
|
|
7
|
+
EMBY_PASSWORD=
|
|
8
|
+
|
|
9
|
+
# Optional defaults
|
|
10
|
+
# EMBY_OUTPUT=./downloads
|
|
11
|
+
# EMBY_METHOD=download
|
|
12
|
+
# EMBY_PATH_STRIP=/mnt/media
|
|
13
|
+
# EMBY_PLAYER=vlc
|
|
14
|
+
# EMBY_CACHE_DIR=
|
|
15
|
+
# EMBY_NO_AUTH_CACHE=
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.9", "3.11", "3.12"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
pip install -e ".[dev]"
|
|
33
|
+
|
|
34
|
+
- name: Lint with ruff
|
|
35
|
+
run: ruff check .
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: pytest -q
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment: pypi
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.11"
|
|
25
|
+
|
|
26
|
+
- name: Install build tools
|
|
27
|
+
run: python -m pip install --upgrade pip build
|
|
28
|
+
|
|
29
|
+
- name: Install package with dev dependencies
|
|
30
|
+
run: pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
- name: Lint with ruff
|
|
33
|
+
run: ruff check .
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: pytest -q
|
|
37
|
+
|
|
38
|
+
- name: Build package
|
|
39
|
+
run: python -m build
|
|
40
|
+
|
|
41
|
+
- name: Verify version matches tag
|
|
42
|
+
run: |
|
|
43
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
44
|
+
TAG="${TAG#v}"
|
|
45
|
+
WHEEL_VERSION=$(unzip -p dist/*.whl '*.dist-info/METADATA' | grep '^Version:' | cut -d' ' -f2)
|
|
46
|
+
echo "Tag: $TAG — Wheel: $WHEEL_VERSION"
|
|
47
|
+
test "$WHEEL_VERSION" = "$TAG"
|
|
48
|
+
|
|
49
|
+
- name: Check metadata
|
|
50
|
+
run: pip install twine && twine check dist/*
|
|
51
|
+
|
|
52
|
+
- name: Publish to PyPI
|
|
53
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: Release standalone binaries
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
test_version:
|
|
10
|
+
description: "Test version label (e.g. v0.0.0-test.1)"
|
|
11
|
+
required: true
|
|
12
|
+
default: "v0.0.0-test.1"
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
include:
|
|
23
|
+
- os: macos-latest
|
|
24
|
+
suffix: macos-arm64
|
|
25
|
+
- os: macos-13
|
|
26
|
+
suffix: macos-x64
|
|
27
|
+
|
|
28
|
+
runs-on: ${{ matrix.os }}
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0
|
|
34
|
+
|
|
35
|
+
- name: Set up Python
|
|
36
|
+
uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
|
|
40
|
+
- name: Install package and PyInstaller
|
|
41
|
+
run: pip install . pyinstaller
|
|
42
|
+
env:
|
|
43
|
+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event_name == 'workflow_dispatch' && '0.0.0' || '' }}
|
|
44
|
+
|
|
45
|
+
- name: Resolve version
|
|
46
|
+
id: version
|
|
47
|
+
run: |
|
|
48
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
49
|
+
echo "tag=${{ github.event.inputs.test_version }}" >> "$GITHUB_OUTPUT"
|
|
50
|
+
else
|
|
51
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
52
|
+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
- name: Build light variant (no bundled ffmpeg)
|
|
56
|
+
run: |
|
|
57
|
+
pyinstaller --onefile \
|
|
58
|
+
--name emby-cli \
|
|
59
|
+
--hidden-import emby_cli \
|
|
60
|
+
--hidden-import static_ffmpeg \
|
|
61
|
+
--hidden-import static_ffmpeg.run \
|
|
62
|
+
--collect-submodules emby_cli \
|
|
63
|
+
src/emby_cli/__main__.py
|
|
64
|
+
mv dist/emby-cli dist/emby-cli-${{ steps.version.outputs.tag }}-${{ matrix.suffix }}
|
|
65
|
+
|
|
66
|
+
- name: Clean PyInstaller state for second build
|
|
67
|
+
run: rm -rf build/ dist/emby-cli emby-cli.spec
|
|
68
|
+
|
|
69
|
+
- name: Pre-fetch ffmpeg for current platform
|
|
70
|
+
run: python -c "from static_ffmpeg.run import get_or_fetch_platform_executables_else_raise; get_or_fetch_platform_executables_else_raise()"
|
|
71
|
+
|
|
72
|
+
- name: Locate ffmpeg binaries
|
|
73
|
+
id: ffmpeg
|
|
74
|
+
run: |
|
|
75
|
+
FFMPEG_DIR=$(python -c "from static_ffmpeg.run import get_platform_dir; print(get_platform_dir())")
|
|
76
|
+
echo "dir=$FFMPEG_DIR" >> "$GITHUB_OUTPUT"
|
|
77
|
+
echo "key=$(python -c 'from static_ffmpeg.run import get_platform_key; print(get_platform_key())')" >> "$GITHUB_OUTPUT"
|
|
78
|
+
|
|
79
|
+
- name: Build full variant (bundled ffmpeg)
|
|
80
|
+
run: |
|
|
81
|
+
pyinstaller --onefile \
|
|
82
|
+
--name emby-cli \
|
|
83
|
+
--hidden-import emby_cli \
|
|
84
|
+
--hidden-import static_ffmpeg \
|
|
85
|
+
--hidden-import static_ffmpeg.run \
|
|
86
|
+
--collect-submodules emby_cli \
|
|
87
|
+
--add-data "${{ steps.ffmpeg.outputs.dir }}:static_ffmpeg/bin/${{ steps.ffmpeg.outputs.key }}" \
|
|
88
|
+
src/emby_cli/__main__.py
|
|
89
|
+
mv dist/emby-cli dist/emby-cli-${{ steps.version.outputs.tag }}-${{ matrix.suffix }}-full
|
|
90
|
+
|
|
91
|
+
- name: Generate checksums
|
|
92
|
+
run: |
|
|
93
|
+
cd dist
|
|
94
|
+
for f in emby-cli-*; do
|
|
95
|
+
shasum -a 256 "$f" > "$f.sha256"
|
|
96
|
+
done
|
|
97
|
+
|
|
98
|
+
- name: Upload artifacts
|
|
99
|
+
uses: actions/upload-artifact@v4
|
|
100
|
+
with:
|
|
101
|
+
name: binaries-${{ matrix.suffix }}
|
|
102
|
+
path: dist/emby-cli-*
|
|
103
|
+
if-no-files-found: error
|
|
104
|
+
retention-days: 1
|
|
105
|
+
|
|
106
|
+
release:
|
|
107
|
+
name: Create GitHub Release
|
|
108
|
+
needs: build
|
|
109
|
+
runs-on: ubuntu-latest
|
|
110
|
+
|
|
111
|
+
steps:
|
|
112
|
+
- name: Download all artifacts
|
|
113
|
+
uses: actions/download-artifact@v4
|
|
114
|
+
with:
|
|
115
|
+
pattern: binaries-*
|
|
116
|
+
merge-multiple: true
|
|
117
|
+
path: assets
|
|
118
|
+
|
|
119
|
+
- name: List assets
|
|
120
|
+
run: ls -lh assets/
|
|
121
|
+
|
|
122
|
+
- name: Resolve release tag
|
|
123
|
+
id: release_tag
|
|
124
|
+
run: |
|
|
125
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
126
|
+
echo "tag=${{ github.event.inputs.test_version }}" >> "$GITHUB_OUTPUT"
|
|
127
|
+
echo "draft=true" >> "$GITHUB_OUTPUT"
|
|
128
|
+
else
|
|
129
|
+
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
130
|
+
echo "draft=false" >> "$GITHUB_OUTPUT"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
- name: Publish GitHub Release
|
|
134
|
+
uses: softprops/action-gh-release@v2
|
|
135
|
+
with:
|
|
136
|
+
tag_name: ${{ steps.release_tag.outputs.tag }}
|
|
137
|
+
name: ${{ steps.release_tag.outputs.tag }}
|
|
138
|
+
draft: ${{ steps.release_tag.outputs.draft }}
|
|
139
|
+
generate_release_notes: true
|
|
140
|
+
files: assets/*
|