wi1-bot 1.4.13__py3-none-any.whl → 2.0.1__py3-none-any.whl

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.
wi1_bot/config.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import os
2
2
  import pathlib
3
- from typing import TypedDict
3
+ from typing import NotRequired, TypedDict
4
4
 
5
5
  import yaml
6
6
 
@@ -39,65 +39,27 @@ class PushoverConfig(TypedDict):
39
39
  devices: str
40
40
 
41
41
 
42
- # FIXME: python 3.11 supports typing.NotRequired (PEP 655)
43
-
44
- # from typing import NotRequired
45
-
46
- # class DiscordConfig(TypedDict):
47
- # bot_token: str
48
- # channel_id: int
49
- # admin_id: int
50
- # bot_presence: NotRequired[str]
51
- # quotas: NotRequired[dict[int, float]]
52
-
53
-
54
- # class TranscodingProfile(TypedDict):
55
- # video_codec: NotRequired[str]
56
- # video_bitrate: NotRequired[int]
57
- # audio_codec: NotRequired[str]
58
- # audio_channels: NotRequired[int]
59
- # audio_bitrate: NotRequired[str]
60
-
61
-
62
- # class TranscodingConfig(TypedDict):
63
- # profiles: dict[str, TranscodingProfile]
64
- # hwaccel: NotRequired[str]
65
-
66
-
67
- # class Config(TypedDict):
68
- # radarr: ArrConfig
69
- # sonarr: ArrConfig
70
- # discord: DiscordConfig
71
- # pushover: NotRequired[PushoverConfig]
72
- # transcoding: NotRequired[TranscodingConfig]
73
-
74
-
75
- class DiscordConfigOptional(TypedDict, total=False):
76
- bot_presence: str
77
- quotas: dict[int, float]
78
-
79
-
80
- class DiscordConfig(DiscordConfigOptional):
42
+ class DiscordConfig(TypedDict):
81
43
  bot_token: str
82
44
  channel_id: int
83
45
  admin_id: int
46
+ bot_presence: NotRequired[str]
47
+ quotas: NotRequired[dict[int, float]]
84
48
 
85
49
 
86
- class TranscodingProfile(TypedDict, total=False):
87
- copy_all_streams: bool
88
- video_codec: str
89
- video_bitrate: int
90
- audio_codec: str
91
- audio_channels: int
92
- audio_bitrate: str
93
-
94
-
95
- class TranscodingConfigOptional(TypedDict, total=False):
96
- hwaccel: str # optional
50
+ class TranscodingProfile(TypedDict):
51
+ video_codec: NotRequired[str]
52
+ video_bitrate: NotRequired[int]
53
+ audio_codec: NotRequired[str]
54
+ audio_channels: NotRequired[int]
55
+ audio_bitrate: NotRequired[str]
56
+ copy_all_streams: NotRequired[bool]
57
+ languages: NotRequired[str]
97
58
 
98
59
 
99
- class TranscodingConfig(TranscodingConfigOptional):
60
+ class TranscodingConfig(TypedDict):
100
61
  profiles: dict[str, TranscodingProfile]
62
+ hwaccel: NotRequired[str]
101
63
 
102
64
 
103
65
  class RemotePathMapping(TypedDict):
@@ -105,25 +67,18 @@ class RemotePathMapping(TypedDict):
105
67
  local: str
106
68
 
107
69
 
108
- class GeneralConfigOptional(TypedDict, total=False):
109
- log_dir: str
110
- remote_path_mappings: list[RemotePathMapping]
111
-
112
-
113
- class GeneralConfig(GeneralConfigOptional):
114
- pass
115
-
116
-
117
- class ConfigOptional(TypedDict, total=False):
118
- general: GeneralConfig # optional
119
- pushover: PushoverConfig # optional
120
- transcoding: TranscodingConfig # optional
70
+ class GeneralConfig(TypedDict):
71
+ log_dir: NotRequired[str]
72
+ remote_path_mappings: NotRequired[list[RemotePathMapping]]
121
73
 
122
74
 
123
- class Config(ConfigOptional):
75
+ class Config(TypedDict):
76
+ general: NotRequired[GeneralConfig] # optional
124
77
  radarr: ArrConfig
125
78
  sonarr: ArrConfig
126
79
  discord: DiscordConfig
80
+ pushover: NotRequired[PushoverConfig]
81
+ transcoding: NotRequired[TranscodingConfig]
127
82
 
128
83
 
129
84
  with open(_config_path, "r") as f:
wi1_bot/webhook.py CHANGED
@@ -66,20 +66,13 @@ def on_download(req: dict[str, Any]) -> None:
66
66
 
67
67
  quality_options = config["transcoding"]["profiles"][quality_profile]
68
68
 
69
- # python 3.11: TranscodingProfile and typing.LiteralString
70
- def get_key(d: Any, k: str) -> Any:
71
- try:
72
- return d[k]
73
- except KeyError:
74
- return None
75
-
76
- copy_all_streams = get_key(quality_options, "copy_all_streams")
77
- languages = get_key(quality_options, "languages")
78
- video_codec = get_key(quality_options, "video_codec")
79
- video_bitrate = get_key(quality_options, "video_bitrate")
80
- audio_codec = get_key(quality_options, "audio_codec")
81
- audio_channels = get_key(quality_options, "audio_channels")
82
- audio_bitrate = get_key(quality_options, "audio_bitrate")
69
+ copy_all_streams = quality_options.get("copy_all_streams", None)
70
+ languages = quality_options.get("languages", None)
71
+ video_codec = quality_options.get("video_codec", None)
72
+ video_bitrate = quality_options.get("video_bitrate", None)
73
+ audio_codec = quality_options.get("audio_codec", None)
74
+ audio_channels = quality_options.get("audio_channels", None)
75
+ audio_bitrate = quality_options.get("audio_bitrate", None)
83
76
 
84
77
  transcoder.queue.add(
85
78
  path=str(path),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wi1-bot
3
- Version: 1.4.13
3
+ Version: 2.0.1
4
4
  Summary: Discord bot for Radarr/Sonarr integration
5
5
  Project-URL: Homepage, https://github.com/wthueb/wi1-bot
6
6
  Author-email: William Huebner <wilhueb@gmail.com>
@@ -8,8 +8,8 @@ License-Expression: MIT
8
8
  License-File: LICENSE
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3 :: Only
11
- Classifier: Programming Language :: Python :: 3.10
12
- Requires-Python: >=3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Requires-Python: >=3.11
13
13
  Requires-Dist: discord-py==2.3.2
14
14
  Requires-Dist: flask==3.0.2
15
15
  Requires-Dist: mongoengine==0.29.1
@@ -35,13 +35,14 @@ A Discord bot to integrate [Radarr](https://radarr.video/) & [Sonarr](https://so
35
35
  3. `pip install -e .[dev]`
36
36
  4. `pre-commit install`
37
37
 
38
- Requires Python >=3.10.
38
+ Requires Python >=3.11.
39
39
 
40
40
  ### TODO
41
41
 
42
42
  - use sqlite
43
43
  - dynamically copy streams
44
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
45
46
  - https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
46
47
  - link discord user to overseerr user
47
48
  - https://github.com/kkroening/ffmpeg-python
@@ -1,7 +1,7 @@
1
1
  wi1_bot/__init__.py,sha256=dYlvBffClqwInBRSxSAoJHuujuh4yuPderFR4n7Odko,161
2
- wi1_bot/config.py,sha256=AtzOXvCeat_lb-w_Wy37XyWIpV3LmKh38OGigluJ2nM,3139
2
+ wi1_bot/config.py,sha256=ndL3BxiOpXiDQGYNEIPtuusekS25miPFQrEphINxnsQ,2226
3
3
  wi1_bot/push.py,sha256=6EwQ1eXcJnQimAi0dOm1_t7Am056zob-1-EOkytGZWg,783
4
- wi1_bot/webhook.py,sha256=11rzmxhXnDeXWlgEnOLh26WP79rLeG71HaDvKUXuUcA,3665
4
+ wi1_bot/webhook.py,sha256=xTN_-Ivdt1ANJFWkhF4W8csyqwfBNH33d-eWbsWOPS4,3482
5
5
  wi1_bot/arr/__init__.py,sha256=-6UE81yY6OhD6-nbLindChE_HlwsNRuL8JijUmo_Q6k,149
6
6
  wi1_bot/arr/download.py,sha256=02AYFglnFdWSG8xj_TaJc6l2wjybyhUW6F97CnoyUFw,1381
7
7
  wi1_bot/arr/episode.py,sha256=0K_auUYwkBBd_Ludc4-4z7lSW8HRQ3mchFQ7FR10JSU,1041
@@ -23,8 +23,8 @@ wi1_bot/scripts/transcode_item.py,sha256=21MeeIZ9wIRhAY-FOEgOdPsg6YOLlSUj59r8NkT
23
23
  wi1_bot/transcoder/__init__.py,sha256=B4xr82UtIFc3tyy_MEZdZKMukYW0yejPnfsGowaTIM0,105
24
24
  wi1_bot/transcoder/transcode_queue.py,sha256=W7r2I7OD8QuxseCEb7_ddOvYXiBBLmKLvCs2IgJJ92I,1856
25
25
  wi1_bot/transcoder/transcoder.py,sha256=2wIgDPkrrXcrSjA1HpYGd0RX5wonw1zfltJqGzCaorM,9163
26
- wi1_bot-1.4.13.dist-info/METADATA,sha256=yjnHN9HH8j8SYx13ZPrhG1AoCnrisOjCh9Iz-2Wt-AI,3475
27
- wi1_bot-1.4.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
- wi1_bot-1.4.13.dist-info/entry_points.txt,sha256=pF5EawAQsUNMHs5exynpNdRq9g4dODg-RaPkx2MyYLU,184
29
- wi1_bot-1.4.13.dist-info/licenses/LICENSE,sha256=6V4_mQoPoLJl77_WMsQRQMDG2mnIhDUdfCmMkqM9Qwc,1072
30
- wi1_bot-1.4.13.dist-info/RECORD,,
26
+ wi1_bot-2.0.1.dist-info/METADATA,sha256=bfPmddao9hTXv6WmyqiJP4kN06dFLAA8TMnle7LDWo8,3663
27
+ wi1_bot-2.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
28
+ wi1_bot-2.0.1.dist-info/entry_points.txt,sha256=pF5EawAQsUNMHs5exynpNdRq9g4dODg-RaPkx2MyYLU,184
29
+ wi1_bot-2.0.1.dist-info/licenses/LICENSE,sha256=6V4_mQoPoLJl77_WMsQRQMDG2mnIhDUdfCmMkqM9Qwc,1072
30
+ wi1_bot-2.0.1.dist-info/RECORD,,