revert Update dependency aiohttp to ~=3.10.0 (#84)
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [aiohttp](https://github.com/aio-libs/aiohttp) | minor | `~=3.9.1` -> `~=3.10.0` |
---
### Release Notes
<details>
<summary>aio-libs/aiohttp (aiohttp)</summary>
### [`v3.10.0`](https://github.com/aio-libs/aiohttp/blob/HEAD/CHANGES.rst#3100-2024-07-30)
[Compare Source](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.0)
\========================
## Bug fixes
- Fixed server response headers for `Content-Type` and `Content-Encoding` for
static compressed files -- by :user:`steverep`.
Server will now respond with a `Content-Type` appropriate for the compressed
file (e.g. `"application/gzip"`), and omit the `Content-Encoding` header.
Users should expect that most clients will no longer decompress such responses
by default.
*Related issues and pull requests on GitHub:*
:issue:`4462`.
- Fixed duplicate cookie expiration calls in the CookieJar implementation
*Related issues and pull requests on GitHub:*
:issue:`7784`.
- Adjusted `FileResponse` to check file existence and access when preparing the response -- by :user:`steverep`.
The :py:class:`~aiohttp.web.FileResponse` class was modified to respond with
403 Forbidden or 404 Not Found as appropriate. Previously, it would cause a
server error if the path did not exist or could not be accessed. Checks for
existence, non-regular files, and permissions were expected to be done in the
route handler. For static routes, this now permits a compressed file to exist
without its uncompressed variant and still be served. In addition, this
changes the response status for files without read permission to 403, and for
non-regular files from 404 to 403 for consistency.
*Related issues and pull requests on GitHub:*
:issue:`8182`.
- Fixed `AsyncResolver` to match `ThreadedResolver` behavior
\-- by :user:`bdraco`.
On system with IPv6 support, the :py:class:`~aiohttp.resolver.AsyncResolver` would not fallback
to providing A records when AAAA records were not available.
Additionally, unlike the :py:class:`~aiohttp.resolver.ThreadedResolver`, the :py:class:`~aiohttp.resolver.AsyncResolver`
did not handle link-local addresses correctly.
This change makes the behavior consistent with the :py:class:`~aiohttp.resolver.ThreadedResolver`.
*Related issues and pull requests on GitHub:*
:issue:`8270`.
- Fixed `ws_connect` not respecting `receive_timeout`` on WS(S) connection. -- by :user:`arcivanov\`.
*Related issues and pull requests on GitHub:*
:issue:`8444`.
- Removed blocking I/O in the event loop for static resources and refactored
exception handling -- by :user:`steverep`.
File system calls when handling requests for static routes were moved to a
separate thread to potentially improve performance. Exception handling
was tightened in order to only return 403 Forbidden or 404 Not Found responses
for expected scenarios; 500 Internal Server Error would be returned for any
unknown errors.
*Related issues and pull requests on GitHub:*
:issue:`8507`.
## Features
- Added a Request.wait_for_disconnection() method, as means of allowing request handlers to be notified of premature client disconnections.
*Related issues and pull requests on GitHub:*
:issue:`2492`.
- Added 5 new exceptions: :py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlClientError`, :py:exc:`~aiohttp.InvalidUrlRedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
:py:exc:`~aiohttp.InvalidUrlRedirectClientError`, :py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
are raised instead of :py:exc:`ValueError` or :py:exc:`~aiohttp.InvalidURL` when the redirect URL is invalid. Classes
:py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlClientError` are base for them.
The :py:exc:`~aiohttp.InvalidURL` now exposes a `description` property with the text explanation of the error details.
\-- by :user:`setla`, :user:`AraHaan`, and :user:`bdraco`
*Related issues and pull requests on GitHub:*
:issue:`2507`, :issue:`3315`, :issue:`6722`, :issue:`8481`, :issue:`8482`.
- Added a feature to retry closed connections automatically for idempotent methods. -- by :user:`Dreamsorcerer`
*Related issues and pull requests on GitHub:*
:issue:`7297`.
- Implemented filter_cookies() with domain-matching and path-matching on the keys, instead of testing every single cookie.
This may break existing cookies that have been saved with `CookieJar.save()`. Cookies can be migrated with this script::
import pickle
with file_path.open("rb") as f:
cookies = pickle.load(f)
morsels = [(name, m) for c in cookies.values() for name, m in c.items()]
cookies.clear()
for name, m in morsels:
cookies[(m["domain"], m["path"].rstrip("/"))][name] = m
with file_path.open("wb") as f:
pickle.dump(cookies, f, pickle.HIGHEST_PROTOCOL)
*Related issues and pull requests on GitHub:*
:issue:`7583`, :issue:`8535`.
- Separated connection and socket timeout errors, from ServerTimeoutError.
*Related issues and pull requests on GitHub:*
:issue:`7801`.
- Implemented happy eyeballs
*Related issues and pull requests on GitHub:*
:issue:`7954`.
- Added server capability to check for static files with Brotli compression via a `.br` extension -- by :user:`steverep`.
*Related issues and pull requests on GitHub:*
:issue:`8062`.
## Removals and backward incompatible breaking changes
- The shutdown logic in 3.9 waited on all tasks, which caused issues with some libraries.
In 3.10 we've changed this logic to only wait on request handlers. This means that it's
important for developers to correctly handle the lifecycle of background tasks using a
library such as `aiojobs`. If an application is using `handler_cancellation=True` then
it is also a good idea to ensure that any :func:`asyncio.shield` calls are replaced with
:func:`aiojobs.aiohttp.shield`.
Please read the updated documentation on these points: \
https://docs.aiohttp.org/en/stable/web_advanced.html#graceful-shutdown \
https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation
\-- by :user:`Dreamsorcerer`
*Related issues and pull requests on GitHub:*
:issue:`8495`.
## Improved documentation
- Added documentation for `aiohttp.web.FileResponse`.
*Related issues and pull requests on GitHub:*
:issue:`3958`.
- Improved the docs for the `ssl` params.
*Related issues and pull requests on GitHub:*
:issue:`8403`.
## Contributor-facing changes
- Enabled HTTP parser tests originally intended for 3.9.2 release -- by :user:`pajod`.
*Related issues and pull requests on GitHub:*
:issue:`8088`.
## Miscellaneous internal changes
- Improved URL handler resolution time by indexing resources in the UrlDispatcher.
For applications with a large number of handlers, this should increase performance significantly.
\-- by :user:`bdraco`
*Related issues and pull requests on GitHub:*
:issue:`7829`.
- Added `nacl_middleware <https://github.com/CosmicDNA/nacl_middleware>`\_ to the list of middlewares in the third party section of the documentation.
*Related issues and pull requests on GitHub:*
:issue:`8346`.
- Minor improvements to static typing -- by :user:`Dreamsorcerer`.
*Related issues and pull requests on GitHub:*
:issue:`8364`.
- Added a 3.11-specific overloads to `ClientSession` -- by :user:`max-muoto`.
*Related issues and pull requests on GitHub:*
:issue:`8463`.
- Simplified path checks for `UrlDispatcher.add_static()` method -- by :user:`steverep`.
*Related issues and pull requests on GitHub:*
:issue:`8491`.
- Avoided creating a future on every websocket receive -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8498`.
- Updated identity checks for all `WSMsgType` type compares -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8501`.
- When using Python 3.12 or later, the writer is no longer scheduled on the event loop if it can finish synchronously. Avoiding event loop scheduling reduces latency and improves performance. -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8510`.
- Restored :py:class:`~aiohttp.resolver.AsyncResolver` to be the default resolver. -- by :user:`bdraco`.
:py:class:`~aiohttp.resolver.AsyncResolver` was disabled by default because
of IPv6 compatibility issues. These issues have been resolved and
:py:class:`~aiohttp.resolver.AsyncResolver` is again now the default resolver.
*Related issues and pull requests on GitHub:*
:issue:`8522`.
***
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #84
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [aiohttp](https://github.com/aio-libs/aiohttp) | minor | `~=3.9.1` -> `~=3.10.0` |
---
### Release Notes
<details>
<summary>aio-libs/aiohttp (aiohttp)</summary>
### [`v3.10.0`](https://github.com/aio-libs/aiohttp/blob/HEAD/CHANGES.rst#3100-2024-07-30)
[Compare Source](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.0)
\========================
## Bug fixes
- Fixed server response headers for `Content-Type` and `Content-Encoding` for
static compressed files -- by :user:`steverep`.
Server will now respond with a `Content-Type` appropriate for the compressed
file (e.g. `"application/gzip"`), and omit the `Content-Encoding` header.
Users should expect that most clients will no longer decompress such responses
by default.
*Related issues and pull requests on GitHub:*
:issue:`4462`.
- Fixed duplicate cookie expiration calls in the CookieJar implementation
*Related issues and pull requests on GitHub:*
:issue:`7784`.
- Adjusted `FileResponse` to check file existence and access when preparing the response -- by :user:`steverep`.
The :py:class:`~aiohttp.web.FileResponse` class was modified to respond with
403 Forbidden or 404 Not Found as appropriate. Previously, it would cause a
server error if the path did not exist or could not be accessed. Checks for
existence, non-regular files, and permissions were expected to be done in the
route handler. For static routes, this now permits a compressed file to exist
without its uncompressed variant and still be served. In addition, this
changes the response status for files without read permission to 403, and for
non-regular files from 404 to 403 for consistency.
*Related issues and pull requests on GitHub:*
:issue:`8182`.
- Fixed `AsyncResolver` to match `ThreadedResolver` behavior
\-- by :user:`bdraco`.
On system with IPv6 support, the :py:class:`~aiohttp.resolver.AsyncResolver` would not fallback
to providing A records when AAAA records were not available.
Additionally, unlike the :py:class:`~aiohttp.resolver.ThreadedResolver`, the :py:class:`~aiohttp.resolver.AsyncResolver`
did not handle link-local addresses correctly.
This change makes the behavior consistent with the :py:class:`~aiohttp.resolver.ThreadedResolver`.
*Related issues and pull requests on GitHub:*
:issue:`8270`.
- Fixed `ws_connect` not respecting `receive_timeout`` on WS(S) connection. -- by :user:`arcivanov\`.
*Related issues and pull requests on GitHub:*
:issue:`8444`.
- Removed blocking I/O in the event loop for static resources and refactored
exception handling -- by :user:`steverep`.
File system calls when handling requests for static routes were moved to a
separate thread to potentially improve performance. Exception handling
was tightened in order to only return 403 Forbidden or 404 Not Found responses
for expected scenarios; 500 Internal Server Error would be returned for any
unknown errors.
*Related issues and pull requests on GitHub:*
:issue:`8507`.
## Features
- Added a Request.wait_for_disconnection() method, as means of allowing request handlers to be notified of premature client disconnections.
*Related issues and pull requests on GitHub:*
:issue:`2492`.
- Added 5 new exceptions: :py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlClientError`, :py:exc:`~aiohttp.InvalidUrlRedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
:py:exc:`~aiohttp.InvalidUrlRedirectClientError`, :py:exc:`~aiohttp.NonHttpUrlRedirectClientError`
are raised instead of :py:exc:`ValueError` or :py:exc:`~aiohttp.InvalidURL` when the redirect URL is invalid. Classes
:py:exc:`~aiohttp.InvalidUrlClientError`, :py:exc:`~aiohttp.RedirectClientError`,
:py:exc:`~aiohttp.NonHttpUrlClientError` are base for them.
The :py:exc:`~aiohttp.InvalidURL` now exposes a `description` property with the text explanation of the error details.
\-- by :user:`setla`, :user:`AraHaan`, and :user:`bdraco`
*Related issues and pull requests on GitHub:*
:issue:`2507`, :issue:`3315`, :issue:`6722`, :issue:`8481`, :issue:`8482`.
- Added a feature to retry closed connections automatically for idempotent methods. -- by :user:`Dreamsorcerer`
*Related issues and pull requests on GitHub:*
:issue:`7297`.
- Implemented filter_cookies() with domain-matching and path-matching on the keys, instead of testing every single cookie.
This may break existing cookies that have been saved with `CookieJar.save()`. Cookies can be migrated with this script::
import pickle
with file_path.open("rb") as f:
cookies = pickle.load(f)
morsels = [(name, m) for c in cookies.values() for name, m in c.items()]
cookies.clear()
for name, m in morsels:
cookies[(m["domain"], m["path"].rstrip("/"))][name] = m
with file_path.open("wb") as f:
pickle.dump(cookies, f, pickle.HIGHEST_PROTOCOL)
*Related issues and pull requests on GitHub:*
:issue:`7583`, :issue:`8535`.
- Separated connection and socket timeout errors, from ServerTimeoutError.
*Related issues and pull requests on GitHub:*
:issue:`7801`.
- Implemented happy eyeballs
*Related issues and pull requests on GitHub:*
:issue:`7954`.
- Added server capability to check for static files with Brotli compression via a `.br` extension -- by :user:`steverep`.
*Related issues and pull requests on GitHub:*
:issue:`8062`.
## Removals and backward incompatible breaking changes
- The shutdown logic in 3.9 waited on all tasks, which caused issues with some libraries.
In 3.10 we've changed this logic to only wait on request handlers. This means that it's
important for developers to correctly handle the lifecycle of background tasks using a
library such as `aiojobs`. If an application is using `handler_cancellation=True` then
it is also a good idea to ensure that any :func:`asyncio.shield` calls are replaced with
:func:`aiojobs.aiohttp.shield`.
Please read the updated documentation on these points: \
https://docs.aiohttp.org/en/stable/web_advanced.html#graceful-shutdown \
https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation
\-- by :user:`Dreamsorcerer`
*Related issues and pull requests on GitHub:*
:issue:`8495`.
## Improved documentation
- Added documentation for `aiohttp.web.FileResponse`.
*Related issues and pull requests on GitHub:*
:issue:`3958`.
- Improved the docs for the `ssl` params.
*Related issues and pull requests on GitHub:*
:issue:`8403`.
## Contributor-facing changes
- Enabled HTTP parser tests originally intended for 3.9.2 release -- by :user:`pajod`.
*Related issues and pull requests on GitHub:*
:issue:`8088`.
## Miscellaneous internal changes
- Improved URL handler resolution time by indexing resources in the UrlDispatcher.
For applications with a large number of handlers, this should increase performance significantly.
\-- by :user:`bdraco`
*Related issues and pull requests on GitHub:*
:issue:`7829`.
- Added `nacl_middleware <https://github.com/CosmicDNA/nacl_middleware>`\_ to the list of middlewares in the third party section of the documentation.
*Related issues and pull requests on GitHub:*
:issue:`8346`.
- Minor improvements to static typing -- by :user:`Dreamsorcerer`.
*Related issues and pull requests on GitHub:*
:issue:`8364`.
- Added a 3.11-specific overloads to `ClientSession` -- by :user:`max-muoto`.
*Related issues and pull requests on GitHub:*
:issue:`8463`.
- Simplified path checks for `UrlDispatcher.add_static()` method -- by :user:`steverep`.
*Related issues and pull requests on GitHub:*
:issue:`8491`.
- Avoided creating a future on every websocket receive -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8498`.
- Updated identity checks for all `WSMsgType` type compares -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8501`.
- When using Python 3.12 or later, the writer is no longer scheduled on the event loop if it can finish synchronously. Avoiding event loop scheduling reduces latency and improves performance. -- by :user:`bdraco`.
*Related issues and pull requests on GitHub:*
:issue:`8510`.
- Restored :py:class:`~aiohttp.resolver.AsyncResolver` to be the default resolver. -- by :user:`bdraco`.
:py:class:`~aiohttp.resolver.AsyncResolver` was disabled by default because
of IPv6 compatibility issues. These issues have been resolved and
:py:class:`~aiohttp.resolver.AsyncResolver` is again now the default resolver.
*Related issues and pull requests on GitHub:*
:issue:`8522`.
***
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #84
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | patch | `==3.2.2` -> `==3.2.3` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #83
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.5` -> `==0.1.6` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #81
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [async_pymongo](https://github.com/Mayuri-Chan/async_pymongo) | patch | `==0.1.4` -> `==0.1.5` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Co-authored-by: Profitroll <profitroll@noreply.localhost>
Reviewed-on: #80
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | patch | `==3.2.1` -> `==3.2.2` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #79
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | minor | `==3.1.0` -> `==3.2.1` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #78
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [libbot](https://git.end-play.xyz/profitroll/LibBotUniversal) | minor | `==3.0.0` -> `==3.1.0` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #77
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| photosapi_client | minor | `==0.5.0` -> `==0.6.0` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Co-authored-by: profitroll <vozhd.kk@gmail.com>
Reviewed-on: #75
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [pykeyboard](https://github.com/pystorage/pykeyboard) | patch | `==0.1.5` -> `==0.1.7` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #74
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [libbot](https://github.com/botlibx/libbot) | minor | `==2.0.1` -> `==2.1.0` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #71
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| libbot | patch | `==2.0.0` -> `==2.0.1` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4zNS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMzUuMCIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->
Reviewed-on: #39
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| libbot | major | `==0.2.2` -> `==2.0.0` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9-->
Reviewed-on: #38
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| libbot | minor | `==1.8` -> `==1.9` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9-->
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Reviewed-on: #35
Co-authored-by: Renovate <renovate@noreply.localhost>
Co-committed-by: Renovate <renovate@noreply.localhost>
* `/report` command added
* Updated to libbot 1.5
* Moved to [PhotosAPI_Client](https://git.end-play.xyz/profitroll/PhotosAPI_Client) v0.5.0 from using self-made API client
* Video support (almost stable)
* Bug fixes and improvements
Co-authored-by: profitroll <vozhd.kk@gmail.com>
Reviewed-on: #27
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [psutil](https://github.com/giampaolo/psutil) | patch | `==5.9.4` -> `==5.9.5` |
---
### Release Notes
<details>
<summary>giampaolo/psutil</summary>
### [`v5.9.5`](https://github.com/giampaolo/psutil/blob/HEAD/HISTORY.rst#​595)
[Compare Source](https://github.com/giampaolo/psutil/compare/release-5.9.4...release-5.9.5)
\=====
2023-04-17
**Enhancements**
- 2196\_: in case of exception, display a cleaner error traceback by hiding the
`KeyError` bit deriving from a missed cache hit.
- 2217\_: print the full traceback when a `DeprecationWarning` or `UserWarning`
is raised.
- 2230\_, \[OpenBSD]: `psutil.net_connections`\_ implementation was rewritten from
scratch:
- We're now able to retrieve the path of AF_UNIX sockets (before it was an
empty string)
- The function is faster since it no longer iterates over all processes.
- No longer produces duplicate connection entries.
- 2238\_: there are cases where `Process.cwd()`\_ cannot be determined
(e.g. directory no longer exists), in which case we returned either `None`
or an empty string. This was consolidated and we now return `""` on all
platforms.
- 2239\_, \[UNIX]: if process is a zombie, and we can only determine part of the
its truncated `Process.name()`\_ (15 chars), don't fail with `ZombieProcess`\_
when we try to guess the full name from the `Process.cmdline()`\_. Just
return the truncated name.
- 2240\_, \[NetBSD], \[OpenBSD]: add CI testing on every commit for NetBSD and
OpenBSD platforms (python 3 only).
**Bug fixes**
- 1043\_, \[OpenBSD] `psutil.net_connections`\_ returns duplicate entries.
- 1915\_, \[Linux]: on certain kernels, `"MemAvailable"` field from
`/proc/meminfo` returns `0` (possibly a kernel bug), in which case we
calculate an approximation for `available` memory which matches "free"
CLI utility.
- 2164\_, \[Linux]: compilation fails on kernels < 2.6.27 (e.g. CentOS 5).
- 2186\_, \[FreeBSD]: compilation fails with Clang 15. (patch by Po-Chuan Hsieh)
- 2191\_, \[Linux]: `disk_partitions()`*: do not unnecessarily read
/proc/filesystems and raise `AccessDenied`* unless user specified `all=False`
argument.
- 2216\_, \[Windows]: fix tests when running in a virtual environment (patch by
Matthieu Darbois)
- 2225\_, \[POSIX]: `users()`\_ loses precision for `started` attribute (off by
1 minute).
- 2229\_, \[OpenBSD]: unable to properly recognize zombie processes.
`NoSuchProcess`\_ may be raised instead of `ZombieProcess`\_.
- 2231\_, \[NetBSD]: *available* `virtual_memory()`\_ is higher than *total*.
- 2234\_, \[NetBSD]: `virtual_memory()`\_ metrics are wrong: *available* and
*used* are too high. We now match values shown by *htop* CLI utility.
- 2236\_, \[NetBSD]: `Process.num_threads()`\_ and `Process.threads()`\_ return
threads that are already terminated.
- 2237\_, \[OpenBSD], \[NetBSD]: `Process.cwd()`\_ may raise `FileNotFoundError`
if cwd no longer exists. Return an empty string instead.
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS41NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNTQuMCJ9-->
Reviewed-on: #17
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
Welcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.
🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.
---
### Detected Package Files
* `requirements.txt` (pip_requirements)
### Configuration Summary
Based on the default config's presets, Renovate will:
- Start dependency updates only once this onboarding PR is merged
- Enable Renovate Dependency Dashboard creation.
- Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use.
- Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories.
- Group known monorepo packages together.
- Use curated list of recommended non-monorepo package groupings.
- Apply crowd-sourced package replacement rules.
- Apply crowd-sourced workarounds for known problems with packages.
🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the `.renovaterc` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.
---
### What to Expect
It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.
---
❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section.
If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions).
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
Reviewed-on: #14
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
This bot is used for one and only task - post pictures from my personal archive. Here's its source code so you can also host a bot and have fun with it. Just don't exepect it to be brilliant. It is not. But hey, you can always fork it ;)
> Шукаєш інструкцію українською? А вона [ось тут](https://git.end-play.xyz/profitroll/TelegramPoster/src/branch/master/README_uk.md) знаходиться)
This bot is used for one and only task - post pictures from my personal archive. Here's its source code so you can also host a bot and have fun with it. Just don't exepect it to be brilliant. It is not. But hey, you can always fork it ;)
Use [MongoDB's installation manual](https://www.mongodb.com/docs/manual/installation) and [Photos API's README](https://git.end-play.xyz/profitroll/PhotosAPI/src/branch/master/README.md).
Please note that Photos API also requires MongoDB so it makes sense to install and configure Mongo first.
## Installation
To make this bot run at first you need to have a Python interpreter and git. Google is your friend finding it. You can also ignore git and simply download source code, should also work fine. After that you're ready to go.
1. Download the bot.
1.`git clone https://git.end-play.xyz/profitroll/TelegramSender.git` (if you want to use git)
2.`cd ./TelegramSender`
To make this bot run at first you need to have a Python interpreter, Photos API, MongoDB and optionally git (if you want to update using `git pull`). You can also ignore git and simply download source code, should also work fine. After that you're ready to go.
> In this README I assume that you're using default python in your
> system and your system's PATH contains it. If your default python
> is `python3` or for example `/home/user/.local/bin/python3.9` - use it instead.
> If it's non-standard executable path - you should also change
> it in scripts you will use (`loop.sh`, `loop.bat`, `start.sh` and `start.bat`).
1. Install MongoDB and Photos API:
1. Install MongoDB by following [official installation manual](https://www.mongodb.com/docs/manual/installation)
2. Install Photos API by following [Photos API's README](https://git.end-play.xyz/profitroll/PhotosAPI/src/branch/master/README.md)
2. Download the bot:
1.`git clone -b dev https://git.end-play.xyz/profitroll/TelegramPoster.git` (if you're using git)
These are not required but can make the bot run a bit faster
5.Configure required keys with your favorite text editor:
4. Configure your bot with a favorite text editor:
`nano config.json`
You can edit with vim, nano, on Windows it's Notepad or Notepad++. Whatever.
If you don't know where to find bot_token and your id - here you can find some hints: [get bot token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [get your id](https://www.alphr.com/telegram-find-user-id/), [get api_hash and api_id](https://core.telegram.org/api/obtaining_api_id).
2. Open `config.json` using your favorite text editor. For example `nano config.json`, but you can also edit it with vim, mcedit, or Notepad/Notepad++ on Windows
3. Change `"bot.owner"`, `"bot.api_id"`, `"bot.api_hash"` and `"bot.bot_token"` keys' values.
5. Add bot to the channel
To use your bot of course you need to have a channel or group otherwise makes no sense to have such a bot. [Here](https://stackoverflow.com/a/33497769) you can find a quick guide how to add your bot to a channel.
If you don't know where to find bot_token and your id - here you can find some hints: [get bot token](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [get your id](https://www.alphr.com/telegram-find-user-id), [get api_hash and api_id](https://core.telegram.org/api/obtaining_api_id).
6.Fill your contents folder
Of course bot cannot post something from nothing. Configure your `config.json` what media types bot should post (`"posting", "extensions"`), when to post them (`"posting", "time"`) and also where to find them (`"locations"`). You can also move them when sent by setting `"posting", "move_sent"` to `true`.
6.Configure database and API:
6. Good to go, run it!
`python ./main.py`
1. Configure database:
1. Change database host and port in keys `"database.host"` and `"database.port"`. For default local installation those will be `127.0.0.1` and `27017` respectively
2. Change database name to the one you like in `"database.name"`. It will be automatically created on start
3. If you've changed user and password to access the db, you should also change `"database.user"` and `"database.password"` keys, otherwise leave them `null` (default).
2. Configure Photos API:
1. Change `"posting.api.address"` and `"posting.api.address_external"` to the ones your API server uses
2. Run your bot using `python main.py --create-user --create-album` to configure its new user and album. You can also use manual user and album creation described [in the wiki](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-API). You can also change username, password and album in`"posting.api"` to the user and album you have if you already have Photos API album and user set up. In that case you don't need to create a new one.
7. Add bot to the channel:
To use your bot of course you need to have a channel or group otherwise it makes no sense to have such a bot. [Here](https://stackoverflow.com/a/33497769) you can find a quick guide how to add your bot to a channel. After that simply set `"posting.channel"` to your channel's ID and `"posting.comments"` to comments group's ID.
8. Configure posting time:
To make your bot post random content you need to configure `"posting.time"` with a list of "DD:MM" formatted strings or use `"posting.interval"` formatted as "XdXhXmXs". To use interval instead of selected time, set `"posting.use_interval"` to `true`.
9. Good to go, run it!
Make sure MongoDB and Photos API are running and use `python main.py` to start the bot.
Or you can also use `.\start.bat` on Windows and `bash ./start.sh` on Linux.
Additionally there are `loop.sh` and `loop.bat` available if you want your bot to start again after being stopped or after using `/shutdown` command.
If you need any further instructions on how to configure your bot or you had any difficulties doing so - please use [wiki in this repository](https://git.end-play.xyz/profitroll/TelegramPoster/wiki) to get more detailed instructions.
## CLI arguments
## Command line arguments
Of course bot also has them. You can perform some actions with them.
*`--move-sent` - allows you to move all sent files from queue to sent directories
*`--cleanup` - purge files in both `queue` and `sent` folders if they're sent. Requires `--confirm` argument
*`--cleanup-index` - purge all sent entries from index. Requires `--confirm` argument
*`--norun` - allows you to execute above arguments without tiggering the bot start itself
*`--create-user` - create new API user. Requires config key `"posting.api.address"` to be set;
*`--create-album` - create new API album. Requires API address and user config (`"posting.api"`) to be complete.
Examples:
*`python3 ./main.py --move-sent --norun`
*`python3 ./main.py --cleanup --confirm`
*`pythonmain.py --create-user`
*`python main.py --create-user --create-album`
## Tips and improvements
* You may want to configure your bot to work as a systemd service instead. There's [a tutorial for that](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-Service) in the wiki.
## Localization
Bot is capable of using custom locales. There are some that are pre-installed (English and Ukrainian), however you can add your own locales too.
All localization files are located in the `locale`. Just copy locale file of your choice, name it in accordance to [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (if you want your locale to be compatible with Telegram's locales) or define your own name. Save it as json and you're good to go. If you want to change default locale for messages - edit `"locale"` parameter in the `config.json`.
We recommend to only make changes to your custom locale. Or at least always have your backup of for example `en.json` as your fallback.
Цей бот використовується для однієї-єдиної задачі - публікувати фотографії з мого особистого архіву. Ось його код, тож ви також можете запустити бота і погратися з ним самостійно. Тільки не очікуйте, що він буде ідеальним. Це не так. Але ви завжди можете його форкнути ;)
Користуйтесь [інструкцією зі встановлення MongoDB](https://www.mongodb.com/docs/manual/installation) та [README Photos API](https://git.end-play.xyz/profitroll/PhotosAPI/src/branch/master/README.md).
Зверніть увагу, що Photos API також потребує MongoDB, тому має сенс спочатку встановити й налаштувати Mongo.
## Встановлення
Щоб запустити бота, вам потрібно мати інтерпретатор Python, Photos API, MongoDB і, за бажанням, git (якщо ви хочете оновлювати за допомогою `git pull`). Ви також можете проігнорувати git і просто завантажити вихідний код, це також повинно спрацювати. Після цього ви готові до роботи.
> У цьому README я припускаю, що ви використовуєте python за замовчуванням у вашій
> системі, і він міститься у вашому системному PATH. Якщо ваш python за замовчуванням
> це `python3` або, наприклад, `/home/user/.local/bin/python3.9` - використовуйте його.
> Якщо це нестандартний шлях до виконуваного файлу - вам також слід змінити
> його у скриптах, які ви будете використовувати (`loop.sh`, `loop.bat`, `start.sh` та `start.bat`).
1. Встановіть MongoDB та Photos API:
1. Встановіть MongoDB, дотримуючись [офіційного посібника зі встановлення](https://www.mongodb.com/docs/manual/installation)
2. Відкрийте `config.json` за допомогою вашого улюбленого текстового редактора. Наприклад, `nano config.json`, але ви також можете відредагувати його за допомогою vim, mcedit або Notepad/Notepad++ на Windows
3. Змініть значення ключів `"bot.owner"`, `"bot.api_id"`, `"bot.api_hash"`і`"bot.bot_token"`.
Якщо ви не знаєте, де знайти bot_token і ваш id - тут ви можете знайти кілька підказок: [отримати токен бота](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token), [отримати свій id](https://www.alphr.com/telegram-find-user-id), [отримати api_hash та api_id](https://core.telegram.org/api/obtaining_api_id).
6. Налаштування бази даних та API:
1. Налаштуйте базу даних:
1. Змініть хост і порт бази даних у ключах `"database.host"`і`"database.port"`. Для локальної установки за замовчуванням це будуть `127.0.0.1`і`27017` відповідно
2. Змініть ім'я бази даних в `"database.name"`. Вона буде автоматично створена при запуску
3. Якщо ви змінили користувача та пароль для доступу до бази даних, вам також слід змінити ключі `"database.user"` та `"database.password"`, інакше залиште їх `null` (за замовчуванням).
2. Налаштуйте Photos API:
1. Змініть `"posting.api.address"` та `"posting.api.address_external"` на ті, що використовує ваш сервер API
2. Запустіть бота за допомогою `python main.py --create-user --create-album`, щоб налаштувати нового користувача та альбом. Ви також можете скористатися ручним створенням користувача і альбому, описаним [у вікі](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-API). Ви також можете змінити ім'я користувача, пароль і альбом у`"posting.api"` на користувача і альбом, які у вас є, якщо у вас вже налаштовані альбом і користувач Photos API. У цьому випадку вам не потрібно створювати нові.
7. Додайте бота до каналу:
Щоб використовувати бота, вам, звичайно, потрібно мати канал або групу, інакше немає сенсу мати такого бота. [Тут](https://stackoverflow.com/a/33497769) ви можете знайти короткий посібник, як додати бота до каналу. Після цього просто встановіть `"posting.channel"` на ID вашого каналу і`"posting.comments"` на ID групи коментарів.
8. Налаштуйте час публікації:
Щоб ваш бот публікував випадковий контент, вам потрібно налаштувати `"posting.time"` зі списком рядків у форматі "ДД:ММ" або використовувати `"posting.interval"`у форматі "XdXhXmXs". Щоб використовувати інтервал замість вибраного часу, встановіть `"posting.use_interval"`у значення `true`.
9. Готово, запускайте!
Переконайтеся, що MongoDB і Photos API запущені і використовуйте `python main.py` для запуску бота.
Або ви також можете використовувати `.\start.bat` в Windows і`bash ./start.sh` в Linux.
Додатково доступні `loop.sh`і`loop.bat`, якщо ви хочете, щоб ваш бот запустився знову після зупинки або після використання команди `/shutdown`.
Якщо вам потрібні додаткові інструкції щодо налаштування бота абоу вас виникли труднощі - скористайтеся [вікі в цьому репозиторії](https://git.end-play.xyz/profitroll/TelegramPoster/wiki), щоб отримати детальніші інструкції.
## CLI аргументи
Звичайно, бот також має CLI аргументи. За допомогою них можна виконувати деякі дії.
*`--create-user` - створити нового користувача API. Потребує встановленого конфігураційного ключа `"posting.api.address"`;
*`--create-album` - створити новий альбом API. Вимагає заповнених адреси API та конфігурації користувача (`"posting.api"`).
Приклади:
*`python main.py --create-user`
*`python main.py --create-user --create-album`
## Поради та покращення
* Можливо, ви захочете налаштувати бота для роботи як системну службу. У вікі є [сторінка з цього питання](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Configuring-Service).
## Локалізація
Бот може використовувати файли локалізації. Деякі з них встановлено за замовчуванням (англійська та українська), але ви також можете додавати свої власні.
Усі файли локалізації знаходяться у теці `locale`. Просто скопіюйте файл локалі за вашим вибором, назвіть його відповідно до [мовних кодів IETF](https://en.wikipedia.org/wiki/IETF_language_tag) (якщо ви хочете, щоб ваша локаль була сумісна з локалями Telegram) або дайте йому власну назву. Збережіть переклад у форматі json, і все буде готово. Якщо ви хочете змінити локаль за замовчуванням для повідомлень - відредагуйте параметр `"locale"`у файлі `config.json`.
Ми рекомендуємо вносити зміни лише у вашу власну локаль. Або, принаймні, завжди мати резервну копію, наприклад, `en.json` як запасний варіант.
"start":"Hi and welcome!\n\nYou can submit your pictures and videos here. We'll review and add them, if we like them. Make sure you send your stuff one at a time and have chosen media that corresponds to our rules.\n\nYou can also write something to us in the description field. We'll send it with the submission itself, if needed.\n\nAlso, make sure you follow the /rules of submission, otherwise your submission will be declined. In case of spam/abuse you may even be blocked.\n\nHave fun and happy submitting!",
"rules":"Photos submission rules:\n1. No porn, only erotics and aesthetics\n2. Nipples are semi-allowed, should be either veiled or barely visible\n3. Genitalia strictly prohibited, but labia prints on clothes or nice pubes/panties/butts - are fine\n4. Submitting russians is forbidden",
"shutdown":"Shutting down bot with pid `{0}`",
"startup":"Starting with pid `{0}`",
"startup_downtime_minutes":"Starting with pid `{0}` (was down for {1} m.)",
"startup_downtime_hours":"Starting with pid `{0}` (was down for {1} h.)",
"startup_downtime_days":"Starting with pid `{0}` (was down for {1} d.)",
"remove_failure":"Could not remove media with ID `{0}`. Check if provided ID is correct and if it is - you can also check bot's log for details.",
"remove_kind":"Please choose the type of media to delete. Use /cancel if you want to abort this operation.",
"remove_unknown":"Unknown media type. It can only be \"{0}\" or \"{1}\".",
"update_available":"**New version found**\nThere's a newer version of a bot found. You can update your bot to [{0}]({1}) using command line of your host.\n\n**Release notes**\n{2}\n\nRead more about updating you bot on the [wiki page](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Updating-Instance).\n\nPlease not that you can also disable this notification by editing `reports.update` key of the config.",
"shutdown_confirm":"There are {0} unfinished users' contexts. If you turn off the bot, those will be lost. Please confirm shutdown using a button below.",
"report_sent":"We've notified admins about presumable violation. Thank you for cooperation.",
"report_received":"This message has been reported by **{0}** (@{1}, `{2}`)"
},
"button":{
"sub_yes":"✅ Accept",
"sub_yes_caption":"✅ Accept + 📝",
"sub_no":"❌ Deny",
"sub_block":"☠️ Block sender",
"sub_unblock":"🏳️ Unblock sender",
"post_view":"View in channel",
"accepted":"✅ Accepted",
"declined":"❌ Declined",
"shutdown":"Confirm shutdown",
"photo":"Photo",
"video":"Video"
},
"callback":{
"sub_yes":"✅ Submission approved",
"sub_no":"❌ Submission declined",
"sub_block":"User {0} has been blocked",
"sub_unblock":"User {0} has been unblocked",
"sub_msg_unavail":"Submission message no longer exist",
"sub_media_unavail":"Could not download submission",
"sub_done":"You've already decided what to do with submission",
"sub_duplicates_found":"There're duplicates in bot's database",
"export":"Отримати .zip архів з усіма фотографіями",
"remove":"Видалити фото за його ID",
"purge":"Повністю видалити всю чергу бота",
"shutdown":"Вимкнути бота"
},
"message":{
"start":"Привіт і ласкаво просимо!\n\nТут можна пропонувати свої фотографії та відео. Ми переглянемо та додамо їх, якщо вони нам сподобаються. Переконайтеся, що ви надсилаєте свої матеріали по одному та вибираєте медіа, які відповідають нашим правилам.\n\nВи також можете написати нам щось у полі опису. За потреби ми надішлемо це разом із самим фото.\n\nКрім того, переконайтеся, що ви дотримуєтеся /rules (правил) подання, інакше вашу пропозицію буде відхилено. У разі спаму/зловживань вас можуть навіть заблокувати.\n\nГарного дня та щасливого надсилання!",
"rules":"Правила пропонування фото:\n1. Ніякого порно, тільки еротика та естетика\n2. Соски можна, але або завуальовані, або зовсім ледь помітні\n3. Геніталії суворо ні, а ось відбитки статевих губ на одязі або гарні лобочки/трусики/попки - без проблем\n4. Пропонувати русню заборонено",
"shutdown":"Вимкнення бота з підом `{0}`",
"startup":"Запуск бота з підом `{0}`",
"startup_downtime_minutes":"Запуск бота з підом `{0}` (лежав {1} хв.)",
"startup_downtime_hours":"Запуск бота з підом `{0}` (лежав {1} год.)",
"startup_downtime_days":"Запуск бота з підом `{0}` (лежав {1} дн.)",
"sub_yes":"✅ Подання схвалено та прийнято",
"sub_yes_auto":"✅ Подання автоматично прийнято",
"sub_no":"❌ Подання розглянуто та відхилено",
"sub_dup":"⚠️ Подання автоматично відхилено через наявність цього фото в базі даних",
"sub_deleted":"⚠️ Запис подання у базі даних ({0}) недоступний.",
"sub_blocked":"Вас заблокували, ви більше не можете надсилати медіафайли.",
"sub_unblocked":"Вас розблокували, тепер ви можете надсилати медіафайли.",
"sub_by":"\n\nПредставлено:",
"sub_sent":"Медіа-файл надіслано.\nСкоро ми повідомимо вас, чи буде його прийнято.",
"sub_cooldown":"Ви можете надсилати лише 1 медіафайл на {0} секунд",
"sub_media_failed":"Не вдалося завантажити подання на сервер. Перевірте логи для деталей.",
"sub_media_duplicates":"⚠️ Знайдено зображення-дублікати",
"sub_media_duplicates_list":"Здається, подане зображення має дублікати в базі даних.\n\nНаступні файли було відмічено як дуже схожі з поданням:\n • {0}",
"document_too_large":"Надісланий файл завеликий. Будь ласка, надсилайте файли не більше {0} Мб",
"mime_not_allowed":"Тип файлу не дозволений. Розгляньте можливість використання одного з цих: {0}",
"post_exception":"Не вдалося надіслати контент через `{0}`\n\nTraceback:\n```{1}```",
"api_queue_empty":"Не вдалося надіслати контент: `Черга порожня або містить лише непідтримувані файли`.",
"api_queue_error":"Не вдалось отримати фото з черги API. Погляньте на логи вище а також на лог помилок API щоб дізнатись подробиці.",
"post_low":"Мала кількість контенту: `Залишилось всього {0} файлів в черзі.`",
"api_creds_invalid":"Не вдалося авторизувати запит до API. Будь ласка, перевірте чи дані авторизації в конфігураційному файлі вірні та оновіть їх, якщо це не так.",
"sub_wip":"Подання постів зараз знаходиться у розробці. Він буде знову доступний через кілька днів. Дякуємо за ваше терпіння.",
"sub_error":"⚠️ Не вдалось завантажити фото через помилку бота. Адміністрацію повідомлено.",
"sub_error_admin":"Користувач {0} не зміг надіслати фото без додаткової перевірки через помилку:\n```\n{1}\n```",
"import_request":"Будь ласка, надішліть zip-архів з медіа для імпортування. Використовуйте /cancel, якщо ви хочете перервати цю операцію.",
"import_invalid_media":"Файл для імпорту має бути zip-архівом. Перериваємо.",
"import_invalid_mime":"Наданий файл не підтримується. Будь ласка, надішліть `application/zip`. Перервано.",
"import_too_big":"Ваш архів має розмір `{0} GiB`, але система має лише `{1} GiB` вільних. Розпакування може зайняти значно більше місця. Перервано.",
"import_downloading":"Завантажуємо архів...",
"import_unpacking":"Розпаковуємо архів...",
"import_unpack_error":"Не вдалося розпакувати архів\n\nПомилка: {0}\n\nTraceback:\n```python\n{1}\n```",
"import_uploading":"Завантажуємо вміст архіву...",
"import_upload_error_duplicate":"Не вдалося завантажити `{0}`, оскільки на сервері є дублікати.",
"import_upload_error_other":"Не вдалося завантажити `{0}`. Ймовірно, заборонений тип файлу.",
"import_finished":"Імпорт завершено.",
"locale_choice":"Гаразд. Будь ласка, оберіть мову за допомогою клавіатури нижче.",
"remove_request":"Будь ласка, надішліть мені ID для видалення. Ви могли отримати його з діалогу завантаження. Використовуйте /cancel, якщо ви хочете перервати цю операцію.",
"remove_failure":"Не вдалося видалити медіа з ID `{0}`. Перевірте, чи вказано правильний ID, і якщо він правильний, ви також можете переглянути логи бота для отримання більш детальної інформації.",
"remove_kind":"Будь ласка, оберіть тип контенту для видалення. Використовуйте /cancel, якщо ви хочете перервати цю операцію.",
"remove_unknown":"Невідомий тип контенту. Може бути тільки \"{0}\" або \"{1}\".",
"update_available":"**Знайдено нову версію**\nЗнайдено нову версію бота. Ви можете оновити бота до [{0}]({1}) за допомогою командного рядка вашого хосту.\n\n**Примітки до релізу**\n{2}\n\nДетальніше про оновлення бота можна знайти на [вікі-сторінці](https://git.end-play.xyz/profitroll/TelegramPoster/wiki/Updating-Instance).\n\nЗверніть увагу, що ви також можете вимкнути це сповіщення, відредагувавши ключ `reports.update` у конфігурації.",
"shutdown_confirm":"Існує {0} незавершених контекстів користувачів. Якщо ви вимкнете бота, вони будуть втрачені. Будь ласка, підтвердіть вимкнення за допомогою кнопки нижче.",
"report_sent":"Ми повідомили адміністрацію про потенційне порушення. Дякую за співпрацю.",
"report_received":"На це повідомлення було отримано скаргу від **{0}** (@{1}, `{2}`)"
},
"button":{
"sub_yes":"✅ Прийняти",
"sub_yes_caption":"✅ Прийняти + 📝",
"sub_no":"❌ Відхилити",
"sub_block":"☠️ Заблокувати відправника",
"sub_unblock":"🏳️ Розблокувати відправника",
"post_view":"Переглянути на каналі",
"accepted":"✅ Прийнято",
"declined":"❌ Відхилено",
"shutdown":"Підтвердити вимкнення",
"photo":"Фото",
"video":"Відео"
},
"callback":{
"sub_yes":"✅ Подання схвалено",
"sub_no":"❌ Подання відхилено",
"sub_block":"Користувача {0} заблоковано",
"sub_unblock":"Користувача {0} розблоковано",
"sub_msg_unavail":"Повідомлення більше не існує",
"sub_media_unavail":"Не вдалося завантажити подання",
"sub_done":"Ви вже обрали що зробити з цим поданням",
"sub_duplicates_found":"Знайдено дублікати в базі даних бота",
logWrite(f"Could not send content due to queue folder empty with allowed extensions")
ifconfigGet("error","reports"):
app.send_message(configGet("admin","reports"),f"Could not send content: `Queue folder is empty or contains only unsupported or already sent files.`")# type: ignore
"To set up Photos API connection you need to create a new user.\nIf you have email confirmation enabled in your Photos API config - you need to use a real email that will get a confirmation code afterwards.",
flush=True,
)
username=input("Choose username for new Photos API user: ").strip()
email=input(f"Choose email for user '{username}': ").strip()
password=input(f"Choose password for user '{username}': ").strip()
"Alright. If you have email confirmation enabled - please confirm registration by using the link in your email. After that press Enter. Otherwise just press Enter."
)
exceptExceptionasexc:
print(f"Could not create a user due to {exc}",flush=True)
print_exc()
exit()
ifnotargs.create_album:
print("You're done!",flush=True)
exit()
returnNone
asyncdefcli_create_album()->None:
print(
"To use Photos API your user needs to have an album to store its data.\nThis wizard will help you to create a new album with its name and title.",
flush=True,
)
name=input("Choose a name for your album: ").strip()
title=input(f"Choose a title for album '{name}': ").strip()
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.