wi1-bot 1.4.12__tar.gz → 2.0.0__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.
Files changed (55) hide show
  1. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/.dockerignore +1 -0
  2. wi1_bot-2.0.0/.envrc +3 -0
  3. wi1_bot-2.0.0/.github/workflows/docker.yaml +59 -0
  4. wi1_bot-2.0.0/.github/workflows/pypi-publish.yml +33 -0
  5. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/.gitignore +3 -3
  6. wi1_bot-2.0.0/Dockerfile +32 -0
  7. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/PKG-INFO +19 -41
  8. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/README.md +7 -2
  9. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/compose.yaml +7 -1
  10. wi1_bot-2.0.0/flake.nix +45 -0
  11. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/pyproject.toml +24 -24
  12. wi1_bot-2.0.0/uv.lock +996 -0
  13. wi1_bot-2.0.0/wi1_bot/__init__.py +6 -0
  14. wi1_bot-2.0.0/wi1_bot/config.py +90 -0
  15. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/bot.py +4 -6
  16. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/scripts/start.py +2 -1
  17. wi1_bot-1.4.12/.github/workflows/pypi-publish.yml +0 -36
  18. wi1_bot-1.4.12/.vscode/launch.json +0 -15
  19. wi1_bot-1.4.12/.vscode/settings.json +0 -3
  20. wi1_bot-1.4.12/Dockerfile +0 -20
  21. wi1_bot-1.4.12/setup.cfg +0 -4
  22. wi1_bot-1.4.12/wi1_bot/__init__.py +0 -1
  23. wi1_bot-1.4.12/wi1_bot/_version.py +0 -16
  24. wi1_bot-1.4.12/wi1_bot/config.py +0 -136
  25. wi1_bot-1.4.12/wi1_bot.egg-info/PKG-INFO +0 -103
  26. wi1_bot-1.4.12/wi1_bot.egg-info/SOURCES.txt +0 -46
  27. wi1_bot-1.4.12/wi1_bot.egg-info/dependency_links.txt +0 -1
  28. wi1_bot-1.4.12/wi1_bot.egg-info/entry_points.txt +0 -5
  29. wi1_bot-1.4.12/wi1_bot.egg-info/requires.txt +0 -13
  30. wi1_bot-1.4.12/wi1_bot.egg-info/top_level.txt +0 -1
  31. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/.pre-commit-config.yaml +0 -0
  32. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/LICENSE +0 -0
  33. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/config.yaml.template +0 -0
  34. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/tests/movie_downloaded.py +0 -0
  35. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/__init__.py +0 -0
  36. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/download.py +0 -0
  37. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/episode.py +0 -0
  38. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/movie.py +0 -0
  39. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/radarr.py +0 -0
  40. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/sonarr.py +0 -0
  41. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/arr/util.py +0 -0
  42. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/__init__.py +0 -0
  43. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/cogs/__init__.py +0 -0
  44. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/cogs/movie.py +0 -0
  45. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/cogs/series.py +0 -0
  46. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/discord/helpers.py +0 -0
  47. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/push.py +0 -0
  48. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/scripts/__init__.py +0 -0
  49. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/scripts/add_tag.py +0 -0
  50. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/scripts/rescan.py +0 -0
  51. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/scripts/transcode_item.py +0 -0
  52. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/transcoder/__init__.py +0 -0
  53. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/transcoder/transcode_queue.py +0 -0
  54. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/transcoder/transcoder.py +0 -0
  55. {wi1_bot-1.4.12 → wi1_bot-2.0.0}/wi1_bot/webhook.py +0 -0
@@ -1,3 +1,4 @@
1
+ env/
1
2
  config.yaml
2
3
  tests/files/
3
4
  log/
wi1_bot-2.0.0/.envrc ADDED
@@ -0,0 +1,3 @@
1
+ if command -v nix-shell &>/dev/null; then
2
+ use flake
3
+ fi
@@ -0,0 +1,59 @@
1
+ name: docker
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ docker:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ packages: write
13
+ contents: read
14
+ attestations: write
15
+ id-token: write
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Login to Docker Hub
23
+ uses: docker/login-action@v3
24
+ with:
25
+ username: ${{ vars.DOCKERHUB_USERNAME }}
26
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
27
+
28
+ - name: Login to GitHub Container Registry
29
+ uses: docker/login-action@v3
30
+ with:
31
+ registry: ghcr.io
32
+ username: ${{ github.actor }}
33
+ password: ${{ secrets.GITHUB_TOKEN }}
34
+
35
+ - name: Set up QEMU
36
+ uses: docker/setup-qemu-action@v3
37
+
38
+ - name: Set up Docker Buildx
39
+ uses: docker/setup-buildx-action@v3
40
+
41
+ - name: Docker meta
42
+ id: meta
43
+ uses: docker/metadata-action@v5
44
+ with:
45
+ images: |
46
+ wthueb/wi1-bot
47
+ ghcr.io/wthueb/wi1-bot
48
+
49
+ - name: Build and push
50
+ id: push
51
+ uses: docker/build-push-action@v6
52
+ with:
53
+ context: .
54
+ cache-from: type=gha
55
+ cache-to: type=gha,mode=max
56
+ platforms: linux/amd64,linux/arm64
57
+ push: true
58
+ tags: wthueb/wi1-bot:latest
59
+ labels: ${{ steps.meta.outputs.labels }}
@@ -0,0 +1,33 @@
1
+ name: Upload to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+
12
+ jobs:
13
+ deploy:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v3
22
+ with:
23
+ enable-cache: true
24
+ cache-dependency-glob: uv.lock
25
+
26
+ - name: Install python
27
+ run: uv python install 3.10
28
+
29
+ - name: build
30
+ run: uv build
31
+
32
+ - name: publish
33
+ run: uv publish
@@ -2,7 +2,7 @@ config.yaml
2
2
  tests/files/
3
3
  log/
4
4
 
5
- build/
6
5
  dist/
7
- *.egg-info/
8
- _version.py
6
+ flake.lock
7
+ .direnv/
8
+ .vscode/
@@ -0,0 +1,32 @@
1
+ FROM jrottenberg/ffmpeg:7.1-nvidia2404 AS base
2
+
3
+ RUN apt-get update && apt-get install -yqq --no-install-recommends python3
4
+
5
+ FROM base AS compiler
6
+
7
+ RUN apt-get install -yqq --no-install-recommends python3-venv git
8
+
9
+ RUN python3 -m venv /opt/venv
10
+ ENV PATH="/opt/venv/bin:$PATH"
11
+
12
+ WORKDIR /app
13
+ COPY . .
14
+ RUN pip install .
15
+
16
+ FROM base
17
+
18
+ COPY --from=compiler /opt/venv /opt/venv
19
+ ENV PATH="/opt/venv/bin:$PATH"
20
+
21
+ LABEL org.opencontainers.image.source="https://github.com/wthueb/wi1-bot"
22
+ LABEL org.opencontainers.image.maintainer="wilhueb@gmail.com"
23
+
24
+ ENV WB_CONFIG_PATH=/config/config.yaml
25
+ ENV WB_LOG_DIR=/logs
26
+
27
+ RUN mkdir -p /config
28
+ RUN mkdir -p /logs
29
+
30
+ EXPOSE 9000
31
+
32
+ ENTRYPOINT ["python", "-m", "wi1_bot.scripts.start"]
@@ -1,49 +1,22 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: wi1-bot
3
- Version: 1.4.12
3
+ Version: 2.0.0
4
4
  Summary: Discord bot for Radarr/Sonarr integration
5
- Author-email: William Huebner <wilhueb@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2022 William Huebner
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
5
  Project-URL: Homepage, https://github.com/wthueb/wi1-bot
6
+ Author-email: William Huebner <wilhueb@gmail.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
29
9
  Classifier: Programming Language :: Python :: 3
30
10
  Classifier: Programming Language :: Python :: 3 :: Only
31
- Classifier: Programming Language :: Python :: 3.10
32
- Requires-Python: >=3.10
33
- Description-Content-Type: text/markdown
34
- License-File: LICENSE
35
- Requires-Dist: discord.py==2.3.2
36
- Requires-Dist: Flask==3.0.2
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Requires-Python: >=3.11
13
+ Requires-Dist: discord-py==2.3.2
14
+ Requires-Dist: flask==3.0.2
37
15
  Requires-Dist: mongoengine==0.29.1
38
16
  Requires-Dist: pyarr==5.2.0
39
- Requires-Dist: PyYAML==6.0.1
40
- Requires-Dist: requests==2.31.0
41
- Provides-Extra: dev
42
- Requires-Dist: mongo-types==0.15.1; extra == "dev"
43
- Requires-Dist: mypy==1.3.0; extra == "dev"
44
- Requires-Dist: pre-commit==3.6.2; extra == "dev"
45
- Requires-Dist: ruff==0.3.0; extra == "dev"
46
- Requires-Dist: types-PyYAML==6.0.12.12; extra == "dev"
17
+ Requires-Dist: pyyaml==6.0.1
18
+ Requires-Dist: requests>=2.32.4
19
+ Description-Content-Type: text/markdown
47
20
 
48
21
  # wi1-bot
49
22
 
@@ -62,16 +35,21 @@ A Discord bot to integrate [Radarr](https://radarr.video/) & [Sonarr](https://so
62
35
  3. `pip install -e .[dev]`
63
36
  4. `pre-commit install`
64
37
 
65
- Requires Python >=3.10.
38
+ Requires Python >=3.11.
66
39
 
67
40
  ### TODO
68
41
 
42
+ - use sqlite
43
+ - dynamically copy streams
44
+ - i.e. if mov_text in input, -c:s srt
45
+ - https://github.com/HaveAGitGat/Tdarr_Plugins/blob/aef12f3c65905f5fc7d045b1a96ddc6a58dc55e7/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts#L77
46
+ - https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
47
+ - link discord user to overseerr user
69
48
  - https://github.com/kkroening/ffmpeg-python
70
49
  - `ffmpeg -codecs`, `ffmpeg -hwaccels`
71
50
  - ffmpeg filters for deinterlacing, scaling
72
51
  - https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html#hwaccel-transcode-with-scaling
73
52
  - ffmpeg remove bad subtitle streams
74
- - use sqlite
75
53
  - have config.discord.users be a dict with 'quotas' and 'name' for *arr tags
76
54
  - Better pushover notifications
77
55
  - Failures for pretty much everything
@@ -15,16 +15,21 @@ A Discord bot to integrate [Radarr](https://radarr.video/) & [Sonarr](https://so
15
15
  3. `pip install -e .[dev]`
16
16
  4. `pre-commit install`
17
17
 
18
- Requires Python >=3.10.
18
+ Requires Python >=3.11.
19
19
 
20
20
  ### TODO
21
21
 
22
+ - use sqlite
23
+ - dynamically copy streams
24
+ - i.e. if mov_text in input, -c:s srt
25
+ - https://github.com/HaveAGitGat/Tdarr_Plugins/blob/aef12f3c65905f5fc7d045b1a96ddc6a58dc55e7/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts#L77
26
+ - https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
27
+ - link discord user to overseerr user
22
28
  - https://github.com/kkroening/ffmpeg-python
23
29
  - `ffmpeg -codecs`, `ffmpeg -hwaccels`
24
30
  - ffmpeg filters for deinterlacing, scaling
25
31
  - https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html#hwaccel-transcode-with-scaling
26
32
  - ffmpeg remove bad subtitle streams
27
- - use sqlite
28
33
  - have config.discord.users be a dict with 'quotas' and 'name' for *arr tags
29
34
  - Better pushover notifications
30
35
  - Failures for pretty much everything
@@ -8,9 +8,15 @@ services:
8
8
  reservations:
9
9
  devices:
10
10
  - capabilities:
11
- - gpu
11
+ - gpu
12
12
  environment:
13
13
  - WB_CONFIG_PATH=/data/config.yaml
14
14
  - WB_LOG_PATH=/data/logs
15
15
  volumes:
16
16
  - .:/data
17
+
18
+ mongodb:
19
+ container_name: mongodb
20
+ image: mongo:8.0
21
+ ports:
22
+ - 27017:27017
@@ -0,0 +1,45 @@
1
+ {
2
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
3
+
4
+ outputs =
5
+ { self, nixpkgs }:
6
+ let
7
+ forAllSystems =
8
+ f:
9
+ nixpkgs.lib.genAttrs
10
+ [
11
+ "x86_64-linux"
12
+ "aarch64-linux"
13
+ "x86_64-darwin"
14
+ "aarch64-darwin"
15
+ ]
16
+ (
17
+ system:
18
+ f rec {
19
+ pkgs = nixpkgs.legacyPackages.${system};
20
+ python = pkgs.python311;
21
+ }
22
+ );
23
+ in
24
+ {
25
+ devShells = forAllSystems (
26
+ { pkgs, python }:
27
+ {
28
+ default = pkgs.mkShell {
29
+ packages = with pkgs; [
30
+ mongosh
31
+ uv
32
+ ];
33
+ env = {
34
+ UV_PYTHON_DOWNLOADS = "never";
35
+ UV_PYTHON = python.interpreter;
36
+ };
37
+ shellHook = ''
38
+ uv sync
39
+ source .venv/bin/activate
40
+ '';
41
+ };
42
+ }
43
+ );
44
+ };
45
+ }
@@ -1,23 +1,23 @@
1
1
  [project]
2
2
  name = "wi1-bot"
3
+ dynamic = ["version"]
3
4
  description = "Discord bot for Radarr/Sonarr integration"
4
5
  authors = [{ name = "William Huebner", email = "wilhueb@gmail.com" }]
5
6
  readme = "README.md"
6
- license = { file = "LICENSE" }
7
+ license = "MIT"
7
8
  classifiers = [
8
9
  "Programming Language :: Python :: 3",
9
10
  "Programming Language :: Python :: 3 :: Only",
10
- "Programming Language :: Python :: 3.10"
11
+ "Programming Language :: Python :: 3.11"
11
12
  ]
12
- dynamic = ["version"]
13
- requires-python = ">=3.10"
13
+ requires-python = ">=3.11"
14
14
  dependencies = [
15
- "discord.py==2.3.2",
16
- "Flask==3.0.2",
15
+ "discord-py==2.3.2",
16
+ "flask==3.0.2",
17
17
  "mongoengine==0.29.1",
18
18
  "pyarr==5.2.0",
19
- "PyYAML==6.0.1",
20
- "requests==2.31.0"
19
+ "pyyaml==6.0.1",
20
+ "requests>=2.32.4",
21
21
  ]
22
22
 
23
23
  [project.urls]
@@ -29,25 +29,15 @@ transcode-item = "wi1_bot.scripts.transcode_item:main"
29
29
  add-tag = "wi1_bot.scripts.add_tag:main"
30
30
  rescan = "wi1_bot.scripts.rescan:main"
31
31
 
32
- [project.optional-dependencies]
32
+ [dependency-groups]
33
33
  dev = [
34
- "mongo-types==0.15.1",
35
- "mypy==1.3.0",
36
- "pre-commit==3.6.2",
37
- "ruff==0.3.0",
38
- "types-PyYAML==6.0.12.12",
34
+ "mongo-types>=0.15.1",
35
+ "mypy>=1.16.0",
36
+ "pre-commit>=4.2.0",
37
+ "ruff>=0.11.13",
38
+ "types-pyyaml>=6.0.12.20250516",
39
39
  ]
40
40
 
41
- [build-system]
42
- requires = ["setuptools>=64", "setuptools-scm>=8"]
43
- build-backend = "setuptools.build_meta"
44
-
45
- [tool.setuptools]
46
- packages = ["wi1_bot"]
47
-
48
- [tool.setuptools_scm]
49
- write_to = "wi1_bot/_version.py"
50
-
51
41
  [tool.ruff]
52
42
  line-length = 100
53
43
 
@@ -57,3 +47,13 @@ select = ["E", "F", "I"]
57
47
  [tool.mypy]
58
48
  packages = "wi1_bot"
59
49
  strict = true
50
+
51
+ [build-system]
52
+ requires = ["hatchling", "uv-dynamic-versioning"]
53
+ build-backend = "hatchling.build"
54
+
55
+ [tool.hatch.version]
56
+ source = "uv-dynamic-versioning"
57
+
58
+ [tool.uv-dynamic-versioning]
59
+ fallback-version = "0.0.0"