21 Commits

Author SHA1 Message Date
450476c8a8 Resolves #87 2024-08-10 14:19:40 +02:00
0b0ca6b832 revert 7f786d59ca
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>
2024-08-01 00:44:21 +03:00
7f786d59ca 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>
2024-07-31 02:13:38 +03:00
e2093605bb Update dependency libbot to v3.2.3 (#83)
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>
2024-07-10 08:11:54 +03:00
c38d79afe1 Update dependency pillow to ~=10.4.0 (#82)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pillow](https://github.com/python-pillow/Pillow) ([changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)) | minor | `~=10.3.0` -> `~=10.4.0` |

---

### Release Notes

<details>
<summary>python-pillow/Pillow (pillow)</summary>

### [`v10.4.0`](https://github.com/python-pillow/Pillow/blob/HEAD/CHANGES.rst#1040-2024-07-01)

[Compare Source](https://github.com/python-pillow/Pillow/compare/10.3.0...10.4.0)

-   Raise FileNotFoundError if show_file() path does not exist [#&#8203;8178](https://github.com/python-pillow/Pillow/issues/8178)
    \[radarhere]

-   Improved reading 16-bit TGA images with colour [#&#8203;7965](https://github.com/python-pillow/Pillow/issues/7965)
    \[Yay295, radarhere]

-   Deprecate non-image ImageCms modes [#&#8203;8031](https://github.com/python-pillow/Pillow/issues/8031)
    \[radarhere]

-   Fixed processing multiple JPEG EXIF markers [#&#8203;8127](https://github.com/python-pillow/Pillow/issues/8127)
    \[radarhere]

-   Do not preserve EXIFIFD tag by default when saving TIFF images [#&#8203;8110](https://github.com/python-pillow/Pillow/issues/8110)
    \[radarhere]

-   Added ImageFont.load_default_imagefont() [#&#8203;8086](https://github.com/python-pillow/Pillow/issues/8086)
    \[radarhere]

-   Added Image.WARN_POSSIBLE_FORMATS [#&#8203;8063](https://github.com/python-pillow/Pillow/issues/8063)
    \[radarhere]

-   Remove zero-byte end padding when parsing any XMP data [#&#8203;8171](https://github.com/python-pillow/Pillow/issues/8171)
    \[radarhere]

-   Do not detect Ultra HDR images as MPO [#&#8203;8056](https://github.com/python-pillow/Pillow/issues/8056)
    \[radarhere]

-   Raise SyntaxError specific to JP2 [#&#8203;8146](https://github.com/python-pillow/Pillow/issues/8146)
    \[Yay295, radarhere]

-   Do not use first frame duration for other frames when saving APNG images [#&#8203;8104](https://github.com/python-pillow/Pillow/issues/8104)
    \[radarhere]

-   Consider I;16 pixel size when using a 1 mode mask [#&#8203;8112](https://github.com/python-pillow/Pillow/issues/8112)
    \[radarhere]

-   When saving multiple PNG frames, convert to mode rather than raw mode [#&#8203;8087](https://github.com/python-pillow/Pillow/issues/8087)
    \[radarhere]

-   Added byte support to FreeTypeFont [#&#8203;8141](https://github.com/python-pillow/Pillow/issues/8141)
    \[radarhere]

-   Allow float center for rotate operations [#&#8203;8114](https://github.com/python-pillow/Pillow/issues/8114)
    \[radarhere]

-   Do not read layers immediately when opening PSD images [#&#8203;8039](https://github.com/python-pillow/Pillow/issues/8039)
    \[radarhere]

-   Restore original thread state [#&#8203;8065](https://github.com/python-pillow/Pillow/issues/8065)
    \[radarhere]

-   Read IM and TIFF images as RGB, rather than RGBX [#&#8203;7997](https://github.com/python-pillow/Pillow/issues/7997)
    \[radarhere]

-   Only preserve TIFF IPTC_NAA_CHUNK tag if type is BYTE or UNDEFINED [#&#8203;7948](https://github.com/python-pillow/Pillow/issues/7948)
    \[radarhere]

-   Clarify ImageDraw2 error message when size is missing [#&#8203;8165](https://github.com/python-pillow/Pillow/issues/8165)
    \[radarhere]

-   Support unpacking more rawmodes to RGBA palettes [#&#8203;7966](https://github.com/python-pillow/Pillow/issues/7966)
    \[radarhere]

-   Removed support for Qt 5 [#&#8203;8159](https://github.com/python-pillow/Pillow/issues/8159)
    \[radarhere]

-   Improve `ImageFont.freetype` support for XDG directories on Linux [#&#8203;8135](https://github.com/python-pillow/Pillow/issues/8135)
    \[mamg22, radarhere]

-   Improved consistency of XMP handling [#&#8203;8069](https://github.com/python-pillow/Pillow/issues/8069)
    \[radarhere]

-   Use pkg-config to help find libwebp and raqm [#&#8203;8142](https://github.com/python-pillow/Pillow/issues/8142)
    \[radarhere]

-   Accept 't' suffix for libtiff version [#&#8203;8126](https://github.com/python-pillow/Pillow/issues/8126), [#&#8203;8129](https://github.com/python-pillow/Pillow/issues/8129)
    \[radarhere]

-   Deprecate ImageDraw.getdraw hints parameter [#&#8203;8124](https://github.com/python-pillow/Pillow/issues/8124)
    \[radarhere, hugovk]

-   Added ImageDraw circle() [#&#8203;8085](https://github.com/python-pillow/Pillow/issues/8085)
    \[void4, hugovk, radarhere]

-   Add mypy target to Makefile [#&#8203;8077](https://github.com/python-pillow/Pillow/issues/8077)
    \[Yay295]

-   Added more modes to Image.MODES [#&#8203;7984](https://github.com/python-pillow/Pillow/issues/7984)
    \[radarhere]

-   Deprecate BGR;15, BGR;16 and BGR;24 modes [#&#8203;7978](https://github.com/python-pillow/Pillow/issues/7978)
    \[radarhere, hugovk]

-   Fix ImagingAccess for I;16N on big-endian [#&#8203;7921](https://github.com/python-pillow/Pillow/issues/7921)
    \[Yay295, radarhere]

-   Support reading P mode TIFF images with padding [#&#8203;7996](https://github.com/python-pillow/Pillow/issues/7996)
    \[radarhere]

-   Deprecate support for libtiff < 4 [#&#8203;7998](https://github.com/python-pillow/Pillow/issues/7998)
    \[radarhere, hugovk]

-   Corrected ImageShow UnixViewer command [#&#8203;7987](https://github.com/python-pillow/Pillow/issues/7987)
    \[radarhere]

-   Use functools.cached_property in ImageStat [#&#8203;7952](https://github.com/python-pillow/Pillow/issues/7952)
    \[nulano, hugovk, radarhere]

-   Add support for reading BITMAPV2INFOHEADER and BITMAPV3INFOHEADER [#&#8203;7956](https://github.com/python-pillow/Pillow/issues/7956)
    \[Cirras, radarhere]

-   Support reading CMYK JPEG2000 images [#&#8203;7947](https://github.com/python-pillow/Pillow/issues/7947)
    \[radarhere]

</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: https://git.end-play.xyz/profitroll/TelegramPoster/pulls/82
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-07-02 00:55:50 +03:00
81748a889d Update dependency async_pymongo to v0.1.6 (#81)
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>
2024-06-23 14:34:11 +03:00
37479f69b3 Update dependency async_pymongo to v0.1.5 (#80)
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>
2024-06-02 12:58:16 +03:00
6388bc1274 Update dependency libbot to v3.2.2 (#79)
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>
2024-05-26 23:58:15 +03:00
b122a36f6c Update dependency libbot to v3.2.1 (#78)
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>
2024-05-26 19:40:47 +03:00
533e177f64 Update dependency libbot to v3.1.0 (#77)
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>
2024-05-24 22:46:24 +03:00
c9f37ea2b6 Fixed deletion not working properly 2024-05-06 12:47:09 +02:00
7f107b2306 Fixed raw_result absent on deleted object 2024-05-06 13:29:26 +03:00
818afa0b74 Fixed caption being added explicitly 2024-04-30 20:57:51 +02:00
c99f22b1b8 Update dependency pillow to ~=10.3.0 (#76)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pillow](https://github.com/python-pillow/Pillow) ([changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)) | minor | `~=10.2.0` -> `~=10.3.0` |

---

### Release Notes

<details>
<summary>python-pillow/Pillow (pillow)</summary>

### [`v10.3.0`](https://github.com/python-pillow/Pillow/blob/HEAD/CHANGES.rst#1030-2024-04-01)

[Compare Source](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

-   CVE-2024-28219: Use `strncpy` to avoid buffer overflow [#&#8203;7928](https://github.com/python-pillow/Pillow/issues/7928)
    \[radarhere, hugovk]

-   Deprecate `eval()`, replacing it with `lambda_eval()` and `unsafe_eval()` [#&#8203;7927](https://github.com/python-pillow/Pillow/issues/7927)
    \[radarhere, hugovk]

-   Raise `ValueError` if seeking to greater than offset-sized integer in TIFF [#&#8203;7883](https://github.com/python-pillow/Pillow/issues/7883)
    \[radarhere]

-   Add `--report` argument to `__main__.py` to omit supported formats [#&#8203;7818](https://github.com/python-pillow/Pillow/issues/7818)
    \[nulano, radarhere, hugovk]

-   Added RGB to I;16, I;16L, I;16B and I;16N conversion [#&#8203;7918](https://github.com/python-pillow/Pillow/issues/7918), [#&#8203;7920](https://github.com/python-pillow/Pillow/issues/7920)
    \[radarhere]

-   Fix editable installation with custom build backend and configuration options [#&#8203;7658](https://github.com/python-pillow/Pillow/issues/7658)
    \[nulano, radarhere]

-   Fix putdata() for I;16N on big-endian [#&#8203;7209](https://github.com/python-pillow/Pillow/issues/7209)
    \[Yay295, hugovk, radarhere]

-   Determine MPO size from markers, not EXIF data [#&#8203;7884](https://github.com/python-pillow/Pillow/issues/7884)
    \[radarhere]

-   Improved conversion from RGB to RGBa, LA and La [#&#8203;7888](https://github.com/python-pillow/Pillow/issues/7888)
    \[radarhere]

-   Support FITS images with GZIP\_1 compression [#&#8203;7894](https://github.com/python-pillow/Pillow/issues/7894)
    \[radarhere]

-   Use I;16 mode for 9-bit JPEG 2000 images [#&#8203;7900](https://github.com/python-pillow/Pillow/issues/7900)
    \[scaramallion, radarhere]

-   Raise ValueError if kmeans is negative [#&#8203;7891](https://github.com/python-pillow/Pillow/issues/7891)
    \[radarhere]

-   Remove TIFF tag OSUBFILETYPE when saving using libtiff [#&#8203;7893](https://github.com/python-pillow/Pillow/issues/7893)
    \[radarhere]

-   Raise ValueError for negative values when loading P1-P3 PPM images [#&#8203;7882](https://github.com/python-pillow/Pillow/issues/7882)
    \[radarhere]

-   Added reading of JPEG2000 palettes [#&#8203;7870](https://github.com/python-pillow/Pillow/issues/7870)
    \[radarhere]

-   Added alpha_quality argument when saving WebP images [#&#8203;7872](https://github.com/python-pillow/Pillow/issues/7872)
    \[radarhere]

-   Fixed joined corners for ImageDraw rounded_rectangle() non-integer dimensions [#&#8203;7881](https://github.com/python-pillow/Pillow/issues/7881)
    \[radarhere]

-   Stop reading EPS image at EOF marker [#&#8203;7753](https://github.com/python-pillow/Pillow/issues/7753)
    \[radarhere]

-   PSD layer co-ordinates may be negative [#&#8203;7706](https://github.com/python-pillow/Pillow/issues/7706)
    \[radarhere]

-   Use subprocess with CREATE_NO_WINDOW flag in ImageShow WindowsViewer [#&#8203;7791](https://github.com/python-pillow/Pillow/issues/7791)
    \[radarhere]

-   When saving GIF frame that restores to background color, do not fill identical pixels [#&#8203;7788](https://github.com/python-pillow/Pillow/issues/7788)
    \[radarhere]

-   Fixed reading PNG iCCP compression method [#&#8203;7823](https://github.com/python-pillow/Pillow/issues/7823)
    \[radarhere]

-   Allow writing IFDRational to UNDEFINED tag [#&#8203;7840](https://github.com/python-pillow/Pillow/issues/7840)
    \[radarhere]

-   Fix logged tag name when loading Exif data [#&#8203;7842](https://github.com/python-pillow/Pillow/issues/7842)
    \[radarhere]

-   Use maximum frame size in IHDR chunk when saving APNG images [#&#8203;7821](https://github.com/python-pillow/Pillow/issues/7821)
    \[radarhere]

-   Prevent opening P TGA images without a palette [#&#8203;7797](https://github.com/python-pillow/Pillow/issues/7797)
    \[radarhere]

-   Use palette when loading ICO images [#&#8203;7798](https://github.com/python-pillow/Pillow/issues/7798)
    \[radarhere]

-   Use consistent arguments for load_read and load_seek [#&#8203;7713](https://github.com/python-pillow/Pillow/issues/7713)
    \[radarhere]

-   Turn off nullability warnings for macOS SDK [#&#8203;7827](https://github.com/python-pillow/Pillow/issues/7827)
    \[radarhere]

-   Fix shift-sign issue in Convert.c [#&#8203;7838](https://github.com/python-pillow/Pillow/issues/7838)
    \[r-barnes, radarhere]

-   Open 16-bit grayscale PNGs as I;16 [#&#8203;7849](https://github.com/python-pillow/Pillow/issues/7849)
    \[radarhere]

-   Handle truncated chunks at the end of PNG images [#&#8203;7709](https://github.com/python-pillow/Pillow/issues/7709)
    \[lajiyuan, radarhere]

-   Match mask size to pasted image size in GifImagePlugin [#&#8203;7779](https://github.com/python-pillow/Pillow/issues/7779)
    \[radarhere]

-   Release GIL while calling `WebPAnimDecoderGetNext` [#&#8203;7782](https://github.com/python-pillow/Pillow/issues/7782)
    \[evanmiller, radarhere]

-   Fixed reading FLI/FLC images with a prefix chunk [#&#8203;7804](https://github.com/python-pillow/Pillow/issues/7804)
    \[twolife]

-   Update wl-paste handling and return None for some errors in grabclipboard() on Linux [#&#8203;7745](https://github.com/python-pillow/Pillow/issues/7745)
    \[nik012003, radarhere]

-   Remove execute bit from `setup.py` [#&#8203;7760](https://github.com/python-pillow/Pillow/issues/7760)
    \[hugovk]

-   Do not support using test-image-results to upload images after test failures [#&#8203;7739](https://github.com/python-pillow/Pillow/issues/7739)
    \[radarhere]

-   Changed ImageMath.ops to be static [#&#8203;7721](https://github.com/python-pillow/Pillow/issues/7721)
    \[radarhere]

-   Fix APNG info after seeking backwards more than twice [#&#8203;7701](https://github.com/python-pillow/Pillow/issues/7701)
    \[esoma, radarhere]

-   Deprecate ImageCms constants and versions() function [#&#8203;7702](https://github.com/python-pillow/Pillow/issues/7702)
    \[nulano, radarhere]

-   Added PerspectiveTransform [#&#8203;7699](https://github.com/python-pillow/Pillow/issues/7699)
    \[radarhere]

-   Add support for reading and writing grayscale PFM images [#&#8203;7696](https://github.com/python-pillow/Pillow/issues/7696)
    \[nulano, hugovk]

-   Add LCMS2 flags to ImageCms [#&#8203;7676](https://github.com/python-pillow/Pillow/issues/7676)
    \[nulano, radarhere, hugovk]

-   Rename x64 to AMD64 in winbuild [#&#8203;7693](https://github.com/python-pillow/Pillow/issues/7693)
    \[nulano]

</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: https://git.end-play.xyz/profitroll/TelegramPoster/pulls/76
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-04-02 15:09:37 +03:00
1ac5abd7bf Update dependency photosapi_client to v0.6.0 (#75)
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>
2024-03-19 23:25:03 +02:00
bd43ee15ae Replaced find_one_and* with proper methods 2024-03-11 21:37:01 +01:00
f8ec8f6335 Bump libbot to 3.0.0 2024-01-28 21:24:01 +02:00
e345f31c56 Update dependency pykeyboard to v0.1.7 (#74)
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>
2024-01-28 21:23:30 +02:00
1c53476e37 Update dependency pillow to ~=10.2.0 (#73)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pillow](https://github.com/python-pillow/Pillow) ([changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)) | minor | `~=10.1.0` -> `~=10.2.0` |

---

### Release Notes

<details>
<summary>python-pillow/Pillow (pillow)</summary>

### [`v10.2.0`](https://github.com/python-pillow/Pillow/blob/HEAD/CHANGES.rst#1020-2024-01-02)

[Compare Source](https://github.com/python-pillow/Pillow/compare/10.1.0...10.2.0)

-   Add `keep_rgb` option when saving JPEG to prevent conversion of RGB colorspace [#&#8203;7553](https://github.com/python-pillow/Pillow/issues/7553)
    \[bgilbert, radarhere]

-   Trim glyph size in ImageFont.getmask() [#&#8203;7669](https://github.com/python-pillow/Pillow/issues/7669), [#&#8203;7672](https://github.com/python-pillow/Pillow/issues/7672)
    \[radarhere, nulano]

-   Deprecate IptcImagePlugin helpers [#&#8203;7664](https://github.com/python-pillow/Pillow/issues/7664)
    \[nulano, hugovk, radarhere]

-   Allow uncompressed TIFF images to be saved in chunks [#&#8203;7650](https://github.com/python-pillow/Pillow/issues/7650)
    \[radarhere]

-   Concatenate multiple JPEG EXIF markers [#&#8203;7496](https://github.com/python-pillow/Pillow/issues/7496)
    \[radarhere]

-   Changed IPTC tile tuple to match other plugins [#&#8203;7661](https://github.com/python-pillow/Pillow/issues/7661)
    \[radarhere]

-   Do not assign new fp attribute when exiting context manager [#&#8203;7566](https://github.com/python-pillow/Pillow/issues/7566)
    \[radarhere]

-   Support arbitrary masks for uncompressed RGB DDS images [#&#8203;7589](https://github.com/python-pillow/Pillow/issues/7589)
    \[radarhere, akx]

-   Support setting ROWSPERSTRIP tag [#&#8203;7654](https://github.com/python-pillow/Pillow/issues/7654)
    \[radarhere]

-   Apply ImageFont.MAX_STRING_LENGTH to ImageFont.getmask() [#&#8203;7662](https://github.com/python-pillow/Pillow/issues/7662)
    \[radarhere]

-   Optimise `ImageColor` using `functools.lru_cache` [#&#8203;7657](https://github.com/python-pillow/Pillow/issues/7657)
    \[hugovk]

-   Restricted environment keys for ImageMath.eval() [#&#8203;7655](https://github.com/python-pillow/Pillow/issues/7655)
    \[wiredfool, radarhere]

-   Optimise `ImageMode.getmode` using `functools.lru_cache` [#&#8203;7641](https://github.com/python-pillow/Pillow/issues/7641)
    \[hugovk, radarhere]

-   Fix incorrect color blending for overlapping glyphs [#&#8203;7497](https://github.com/python-pillow/Pillow/issues/7497)
    \[ZachNagengast, nulano, radarhere]

-   Attempt memory mapping when tile args is a string [#&#8203;7565](https://github.com/python-pillow/Pillow/issues/7565)
    \[radarhere]

-   Fill identical pixels with transparency in subsequent frames when saving GIF [#&#8203;7568](https://github.com/python-pillow/Pillow/issues/7568)
    \[radarhere]

-   Corrected duration when combining multiple GIF frames into single frame [#&#8203;7521](https://github.com/python-pillow/Pillow/issues/7521)
    \[radarhere]

-   Handle disposing GIF background from outside palette [#&#8203;7515](https://github.com/python-pillow/Pillow/issues/7515)
    \[radarhere]

-   Seek past the data when skipping a PSD layer [#&#8203;7483](https://github.com/python-pillow/Pillow/issues/7483)
    \[radarhere]

-   Import plugins relative to the module [#&#8203;7576](https://github.com/python-pillow/Pillow/issues/7576)
    \[deliangyang, jaxx0n]

-   Translate encoder error codes to strings; deprecate `ImageFile.raise_oserror()` [#&#8203;7609](https://github.com/python-pillow/Pillow/issues/7609)
    \[bgilbert, radarhere]

-   Support reading BC4U and DX10 BC1 images [#&#8203;6486](https://github.com/python-pillow/Pillow/issues/6486)
    \[REDxEYE, radarhere, hugovk]

-   Optimize ImageStat.Stat.extrema [#&#8203;7593](https://github.com/python-pillow/Pillow/issues/7593)
    \[florath, radarhere]

-   Handle pathlib.Path in FreeTypeFont [#&#8203;7578](https://github.com/python-pillow/Pillow/issues/7578)
    \[radarhere, hugovk, nulano]

-   Added support for reading DX10 BC4 DDS images [#&#8203;7603](https://github.com/python-pillow/Pillow/issues/7603)
    \[sambvfx, radarhere]

-   Optimized ImageStat.Stat.count [#&#8203;7599](https://github.com/python-pillow/Pillow/issues/7599)
    \[florath]

-   Correct PDF palette size when saving [#&#8203;7555](https://github.com/python-pillow/Pillow/issues/7555)
    \[radarhere]

-   Fixed closing file pointer with olefile 0.47 [#&#8203;7594](https://github.com/python-pillow/Pillow/issues/7594)
    \[radarhere]

-   Raise ValueError when TrueType font size is not greater than zero [#&#8203;7584](https://github.com/python-pillow/Pillow/issues/7584), [#&#8203;7587](https://github.com/python-pillow/Pillow/issues/7587)
    \[akx, radarhere]

-   If absent, do not try to close fp when closing image [#&#8203;7557](https://github.com/python-pillow/Pillow/issues/7557)
    \[RaphaelVRossi, radarhere]

-   Allow configuring JPEG restart marker interval on save [#&#8203;7488](https://github.com/python-pillow/Pillow/issues/7488)
    \[bgilbert, radarhere]

-   Decrement reference count for PyObject [#&#8203;7549](https://github.com/python-pillow/Pillow/issues/7549)
    \[radarhere]

-   Implement `streamtype=1` option for tables-only JPEG encoding [#&#8203;7491](https://github.com/python-pillow/Pillow/issues/7491)
    \[bgilbert, radarhere]

-   If save_all PNG only has one frame, do not create animated image [#&#8203;7522](https://github.com/python-pillow/Pillow/issues/7522)
    \[radarhere]

-   Fixed frombytes() for images with a zero dimension [#&#8203;7493](https://github.com/python-pillow/Pillow/issues/7493)
    \[radarhere]

</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: https://git.end-play.xyz/profitroll/TelegramPoster/pulls/73
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2024-01-02 13:12:31 +02:00
898a63012f Update dependency libbot to v2.1.0 (#71)
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>
2023-12-27 16:21:23 +02:00
854e3d2832 Update dependency aiohttp to ~=3.9.1 (#68)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aiohttp](https://github.com/aio-libs/aiohttp) | minor | `~=3.8.4` -> `~=3.9.1` |

---

### Release Notes

<details>
<summary>aio-libs/aiohttp (aiohttp)</summary>

### [`v3.9.1`](https://github.com/aio-libs/aiohttp/blob/HEAD/CHANGES.rst#391-2023-11-26)

[Compare Source](https://github.com/aio-libs/aiohttp/compare/v3.9.0...v3.9.1)

\==================

## Bugfixes

-   Fixed importing aiohttp under PyPy on Windows.

    `#&#8203;7848 <https://github.com/aio-libs/aiohttp/issues/7848>`\_

-   Fixed async concurrency safety in websocket compressor.

    `#&#8203;7865 <https://github.com/aio-libs/aiohttp/issues/7865>`\_

-   Fixed `ClientResponse.close()` releasing the connection instead of closing.

    `#&#8203;7869 <https://github.com/aio-libs/aiohttp/issues/7869>`\_

-   Fixed a regression where connection may get closed during upgrade. -- by :user:`Dreamsorcerer`

    `#&#8203;7879 <https://github.com/aio-libs/aiohttp/issues/7879>`\_

-   Fixed messages being reported as upgraded without an Upgrade header in Python parser. -- by :user:`Dreamsorcerer`

    `#&#8203;7895 <https://github.com/aio-libs/aiohttp/issues/7895>`\_

***

### [`v3.9.0`](https://github.com/aio-libs/aiohttp/blob/HEAD/CHANGES.rst#390-2023-11-18)

[Compare Source](https://github.com/aio-libs/aiohttp/compare/v3.8.6...v3.9.0)

\==================

## Features

-   Introduced `AppKey` for static typing support of `Application` storage.
    See https://docs.aiohttp.org/en/stable/web_advanced.html#application-s-config

    `#&#8203;5864 <https://github.com/aio-libs/aiohttp/issues/5864>`\_

-   Added a graceful shutdown period which allows pending tasks to complete before the application's cleanup is called.
    The period can be adjusted with the `shutdown_timeout` parameter. -- by :user:`Dreamsorcerer`.
    See https://docs.aiohttp.org/en/latest/web_advanced.html#graceful-shutdown

    `#&#8203;7188 <https://github.com/aio-libs/aiohttp/issues/7188>`\_

-   Added `handler_cancellation <https://docs.aiohttp.org/en/stable/web_advanced.html#web-handler-cancellation>`\_ parameter to cancel web handler on client disconnection. -- by :user:`mosquito`
    This (optionally) reintroduces a feature removed in a previous release.
    Recommended for those looking for an extra level of protection against denial-of-service attacks.

    `#&#8203;7056 <https://github.com/aio-libs/aiohttp/issues/7056>`\_

-   Added support for setting response header parameters `max_line_size` and `max_field_size`.

    `#&#8203;2304 <https://github.com/aio-libs/aiohttp/issues/2304>`\_

-   Added `auto_decompress` parameter to `ClientSession.request` to override `ClientSession._auto_decompress`. -- by :user:`Daste745`

    `#&#8203;3751 <https://github.com/aio-libs/aiohttp/issues/3751>`\_

-   Changed `raise_for_status` to allow a coroutine.

    `#&#8203;3892 <https://github.com/aio-libs/aiohttp/issues/3892>`\_

-   Added client brotli compression support (optional with runtime check).

    `#&#8203;5219 <https://github.com/aio-libs/aiohttp/issues/5219>`\_

-   Added `client_max_size` to `BaseRequest.clone()` to allow overriding the request body size. -- :user:`anesabml`.

    `#&#8203;5704 <https://github.com/aio-libs/aiohttp/issues/5704>`\_

-   Added a middleware type alias `aiohttp.typedefs.Middleware`.

    `#&#8203;5898 <https://github.com/aio-libs/aiohttp/issues/5898>`\_

-   Exported `HTTPMove` which can be used to catch any redirection request
    that has a location -- :user:`dreamsorcerer`.

    `#&#8203;6594 <https://github.com/aio-libs/aiohttp/issues/6594>`\_

-   Changed the `path` parameter in `web.run_app()` to accept a `pathlib.Path` object.

    `#&#8203;6839 <https://github.com/aio-libs/aiohttp/issues/6839>`\_

-   Performance: Skipped filtering `CookieJar` when the jar is empty or all cookies have expired.

    `#&#8203;7819 <https://github.com/aio-libs/aiohttp/issues/7819>`\_

-   Performance: Only check origin if insecure scheme and there are origins to treat as secure, in `CookieJar.filter_cookies()`.

    `#&#8203;7821 <https://github.com/aio-libs/aiohttp/issues/7821>`\_

-   Performance: Used timestamp instead of `datetime` to achieve faster cookie expiration in `CookieJar`.

    `#&#8203;7824 <https://github.com/aio-libs/aiohttp/issues/7824>`\_

-   Added support for passing a custom server name parameter to HTTPS connection.

    `#&#8203;7114 <https://github.com/aio-libs/aiohttp/issues/7114>`\_

-   Added support for using Basic Auth credentials from :file:`.netrc` file when making HTTP requests with the
    :py:class:`~aiohttp.ClientSession` `trust_env` argument is set to `True`. -- by :user:`yuvipanda`.

    `#&#8203;7131 <https://github.com/aio-libs/aiohttp/issues/7131>`\_

-   Turned access log into no-op when the logger is disabled.

    `#&#8203;7240 <https://github.com/aio-libs/aiohttp/issues/7240>`\_

-   Added typing information to `RawResponseMessage`. -- by :user:`Gobot1234`

    `#&#8203;7365 <https://github.com/aio-libs/aiohttp/issues/7365>`\_

-   Removed `async-timeout` for Python 3.11+ (replaced with `asyncio.timeout()` on newer releases).

    `#&#8203;7502 <https://github.com/aio-libs/aiohttp/issues/7502>`\_

-   Added support for `brotlicffi` as an alternative to `brotli` (fixing Brotli support on PyPy).

    `#&#8203;7611 <https://github.com/aio-libs/aiohttp/issues/7611>`\_

-   Added `WebSocketResponse.get_extra_info()` to access a protocol transport's extra info.

    `#&#8203;7078 <https://github.com/aio-libs/aiohttp/issues/7078>`\_

-   Allow `link` argument to be set to None/empty in HTTP 451 exception.

    `#&#8203;7689 <https://github.com/aio-libs/aiohttp/issues/7689>`\_

## Bugfixes

-   Implemented stripping the trailing dots from fully-qualified domain names in `Host` headers and TLS context when acting as an HTTP client.
    This allows the client to connect to URLs with FQDN host name like `https://example.com./`.
    \-- by :user:`martin-sucha`.

    `#&#8203;3636 <https://github.com/aio-libs/aiohttp/issues/3636>`\_

-   Fixed client timeout not working when incoming data is always available without waiting. -- by :user:`Dreamsorcerer`.

    `#&#8203;5854 <https://github.com/aio-libs/aiohttp/issues/5854>`\_

-   Fixed `readuntil` to work with a delimiter of more than one character.

    `#&#8203;6701 <https://github.com/aio-libs/aiohttp/issues/6701>`\_

-   Added `__repr__` to `EmptyStreamReader` to avoid `AttributeError`.

    `#&#8203;6916 <https://github.com/aio-libs/aiohttp/issues/6916>`\_

-   Fixed bug when using `TCPConnector` with `ttl_dns_cache=0`.

    `#&#8203;7014 <https://github.com/aio-libs/aiohttp/issues/7014>`\_

-   Fixed response returned from expect handler being thrown away. -- by :user:`Dreamsorcerer`

    `#&#8203;7025 <https://github.com/aio-libs/aiohttp/issues/7025>`\_

-   Avoided raising `UnicodeDecodeError` in multipart and in HTTP headers parsing.

    `#&#8203;7044 <https://github.com/aio-libs/aiohttp/issues/7044>`\_

-   Changed `sock_read` timeout to start after writing has finished, avoiding read timeouts caused by an unfinished write. -- by :user:`dtrifiro`

    `#&#8203;7149 <https://github.com/aio-libs/aiohttp/issues/7149>`\_

-   Fixed missing query in tracing method URLs when using `yarl` 1.9+.

    `#&#8203;7259 <https://github.com/aio-libs/aiohttp/issues/7259>`\_

-   Changed max 32-bit timestamp to an aware datetime object, for consistency with the non-32-bit one, and to avoid a `DeprecationWarning` on Python 3.12.

    `#&#8203;7302 <https://github.com/aio-libs/aiohttp/issues/7302>`\_

-   Fixed `EmptyStreamReader.iter_chunks()` never ending. -- by :user:`mind1m`

    `#&#8203;7616 <https://github.com/aio-libs/aiohttp/issues/7616>`\_

-   Fixed a rare `RuntimeError: await wasn't used with future` exception. -- by :user:`stalkerg`

    `#&#8203;7785 <https://github.com/aio-libs/aiohttp/issues/7785>`\_

-   Fixed issue with insufficient HTTP method and version validation.

    `#&#8203;7700 <https://github.com/aio-libs/aiohttp/issues/7700>`\_

-   Added check to validate that absolute URIs have schemes.

    `#&#8203;7712 <https://github.com/aio-libs/aiohttp/issues/7712>`\_

-   Fixed unhandled exception when Python HTTP parser encounters unpaired Unicode surrogates.

    `#&#8203;7715 <https://github.com/aio-libs/aiohttp/issues/7715>`\_

-   Updated parser to disallow invalid characters in header field names and stop accepting LF as a request line separator.

    `#&#8203;7719 <https://github.com/aio-libs/aiohttp/issues/7719>`\_

-   Fixed Python HTTP parser not treating 204/304/1xx as an empty body.

    `#&#8203;7755 <https://github.com/aio-libs/aiohttp/issues/7755>`\_

-   Ensure empty body response for 1xx/204/304 per RFC 9112 sec 6.3.

    `#&#8203;7756 <https://github.com/aio-libs/aiohttp/issues/7756>`\_

-   Fixed an issue when a client request is closed before completing a chunked payload. -- by :user:`Dreamsorcerer`

    `#&#8203;7764 <https://github.com/aio-libs/aiohttp/issues/7764>`\_

-   Edge Case Handling for ResponseParser for missing reason value.

    `#&#8203;7776 <https://github.com/aio-libs/aiohttp/issues/7776>`\_

-   Fixed `ClientWebSocketResponse.close_code` being erroneously set to `None` when there are concurrent async tasks receiving data and closing the connection.

    `#&#8203;7306 <https://github.com/aio-libs/aiohttp/issues/7306>`\_

-   Added HTTP method validation.

    `#&#8203;6533 <https://github.com/aio-libs/aiohttp/issues/6533>`\_

-   Fixed arbitrary sequence types being allowed to inject values via version parameter. -- by :user:`Dreamsorcerer`

    `#&#8203;7835 <https://github.com/aio-libs/aiohttp/issues/7835>`\_

-   Performance: Fixed increase in latency with small messages from websocket compression changes.

    `#&#8203;7797 <https://github.com/aio-libs/aiohttp/issues/7797>`\_

## Improved Documentation

-   Fixed the `ClientResponse.release`'s type in the doc. Changed from `comethod` to `method`.

    `#&#8203;5836 <https://github.com/aio-libs/aiohttp/issues/5836>`\_

-   Added information on behavior of base_url parameter in `ClientSession`.

    `#&#8203;6647 <https://github.com/aio-libs/aiohttp/issues/6647>`\_

-   Fixed `ClientResponseError` docs.

    `#&#8203;6700 <https://github.com/aio-libs/aiohttp/issues/6700>`\_

-   Updated Redis code examples to follow the latest API.

    `#&#8203;6907 <https://github.com/aio-libs/aiohttp/issues/6907>`\_

-   Added a note about possibly needing to update headers when using `on_response_prepare`. -- by :user:`Dreamsorcerer`

    `#&#8203;7283 <https://github.com/aio-libs/aiohttp/issues/7283>`\_

-   Completed `trust_env` parameter description to honor `wss_proxy`, `ws_proxy` or `no_proxy` env.

    `#&#8203;7325 <https://github.com/aio-libs/aiohttp/issues/7325>`\_

-   Expanded SSL documentation with more examples (e.g. how to use certifi). -- by :user:`Dreamsorcerer`

    `#&#8203;7334 <https://github.com/aio-libs/aiohttp/issues/7334>`\_

-   Fix, update, and improve client exceptions documentation.

    `#&#8203;7733 <https://github.com/aio-libs/aiohttp/issues/7733>`\_

## Deprecations and Removals

-   Added `shutdown_timeout` parameter to `BaseRunner`, while
    deprecating `shutdown_timeout` parameter from `BaseSite`. -- by :user:`Dreamsorcerer`

    `#&#8203;7718 <https://github.com/aio-libs/aiohttp/issues/7718>`\_

-   Dropped Python 3.6 support.

    `#&#8203;6378 <https://github.com/aio-libs/aiohttp/issues/6378>`\_

-   Dropped Python 3.7 support. -- by :user:`Dreamsorcerer`

    `#&#8203;7336 <https://github.com/aio-libs/aiohttp/issues/7336>`\_

-   Removed support for abandoned `tokio` event loop. -- by :user:`Dreamsorcerer`

    `#&#8203;7281 <https://github.com/aio-libs/aiohttp/issues/7281>`\_

## Misc

-   Made `print` argument in `run_app()` optional.

    `#&#8203;3690 <https://github.com/aio-libs/aiohttp/issues/3690>`\_

-   Improved performance of `ceil_timeout` in some cases.

    `#&#8203;6316 <https://github.com/aio-libs/aiohttp/issues/6316>`\_

-   Changed importing Gunicorn to happen on-demand, decreasing import time by ~53%. -- :user:`Dreamsorcerer`

    `#&#8203;6591 <https://github.com/aio-libs/aiohttp/issues/6591>`\_

-   Improved import time by replacing `http.server` with `http.HTTPStatus`.

    `#&#8203;6903 <https://github.com/aio-libs/aiohttp/issues/6903>`\_

-   Fixed annotation of `ssl` parameter to disallow `True`. -- by :user:`Dreamsorcerer`.

    `#&#8203;7335 <https://github.com/aio-libs/aiohttp/issues/7335>`\_

***

</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: https://git.end-play.xyz/profitroll/TelegramPoster/pulls/68
Co-authored-by: Renovate <renovate@git.end-play.xyz>
Co-committed-by: Renovate <renovate@git.end-play.xyz>
2023-11-26 21:37:23 +02:00
8 changed files with 57 additions and 33 deletions

4
.gitignore vendored
View File

@@ -153,8 +153,12 @@ cython_debug/
#.idea/
# Custom
cache/
config.json
*.session
*.session-wal
*.session-shm
*.session-journal
venv

View File

@@ -57,7 +57,7 @@ class PyroClient(PyroClient):
self.config["bot"]["owner"]
]
self.sender_session = ClientSession()
self.sender_session: Union[ClientSession, None] = None
self.scopes_placeholders: Dict[str, int] = {
"owner": self.owner,
@@ -67,6 +67,9 @@ class PyroClient(PyroClient):
async def start(self):
await super().start()
if self.sender_session is None:
self.sender_session = ClientSession()
if self.config["reports"]["update"]:
try:
async with ClientSession(
@@ -134,12 +137,14 @@ class PyroClient(PyroClient):
)
await http_session.close()
if self.sender_session is not None:
await self.sender_session.close()
await super().stop()
async def submit_media(
self, id: str
self, id: str, purge_caption: bool = False
) -> Tuple[Union[Message, None], Union[str, None]]:
db_entry = await col_submitted.find_one({"_id": ObjectId(id)})
submission = None
@@ -179,7 +184,7 @@ class PyroClient(PyroClient):
response = await photo_upload(
self.config["posting"]["api"]["album"],
client=client,
multipart_data=BodyPhotoUpload(
body=BodyPhotoUpload(
File(media_bytes, filepath.name, "image/jpeg")
),
ignore_duplicates=self.config["submission"]["allow_duplicates"],
@@ -190,16 +195,14 @@ class PyroClient(PyroClient):
response = await video_upload(
self.config["posting"]["api"]["album"],
client=client,
multipart_data=BodyVideoUpload(
File(media_bytes, filepath.name, "video/*")
),
body=BodyVideoUpload(File(media_bytes, filepath.name, "video/*")),
caption="queue",
)
# elif db_entry["type"] == SubmissionType.ANIMATION.value:
# response = await video_upload(
# self.config["posting"]["api"]["album"],
# client=client,
# multipart_data=BodyVideoUpload(
# body=BodyVideoUpload(
# File(media_bytes, filepath.name, "video/*")
# ),
# caption="queue",
@@ -226,10 +229,14 @@ class PyroClient(PyroClient):
)
raise SubmissionDuplicatesError(str(filepath), duplicates)
await col_submitted.find_one_and_update(
{"_id": ObjectId(id)}, {"$set": {"done": True}}
db_update = (
{"$set": {"done": True, "caption": None}}
if purge_caption
else {"$set": {"done": True}}
)
await col_submitted.update_one({"_id": ObjectId(id)}, db_update)
try:
if db_entry["temp"]["uuid"] is not None:
rmtree(

View File

@@ -32,6 +32,7 @@
"sub_yes_auto": "✅ Submission automatically accepted",
"sub_no": "❌ Submission reviewed and declined",
"sub_dup": "⚠️ Submission automatically declined because database already contains this photo",
"sub_deleted": "⚠️ Submission's database record ({0}) is not available.",
"sub_blocked": "You were blocked and you can't submit media anymore.",
"sub_unblocked": "You were unblocked and you can now submit media.",
"sub_by": "\n\nSubmitted by:",

View File

@@ -31,6 +31,7 @@
"sub_yes_auto": "✅ Подання автоматично прийнято",
"sub_no": "❌ Подання розглянуто та відхилено",
"sub_dup": "⚠️ Подання автоматично відхилено через наявність цього фото в базі даних",
"sub_deleted": "⚠️ Запис подання у базі даних ({0}) недоступний.",
"sub_blocked": "Вас заблокували, ви більше не можете надсилати медіафайли.",
"sub_unblocked": "Вас розблокували, тепер ви можете надсилати медіафайли.",
"sub_by": "\n\nПредставлено:",

View File

@@ -117,16 +117,14 @@ async def authorize(custom_session: Union[ClientSession, None] = None) -> str:
unauthorized_client = Client(
base_url=sync.config_get("address", "posting", "api"),
timeout=sync.config_get("timeout", "posting", "api"),
verify_ssl=True,
sync.config_get("address", "posting", "api"),
raise_on_unexpected_status=True,
follow_redirects=False,
timeout=sync.config_get("timeout", "posting", "api"),
)
login_token = login(
client=unauthorized_client,
form_data=BodyLoginForAccessTokenTokenPost(
body=BodyLoginForAccessTokenTokenPost(
grant_type="password",
scope="me albums.list albums.read albums.write photos.list photos.read photos.write videos.list videos.read videos.write",
username=sync.config_get("username", "posting", "api"),
@@ -141,12 +139,10 @@ if not isinstance(login_token, Token):
exit()
client = AuthenticatedClient(
base_url=sync.config_get("address", "posting", "api"),
timeout=sync.config_get("timeout", "posting", "api"),
verify_ssl=True,
raise_on_unexpected_status=True,
sync.config_get("address", "posting", "api"),
token=login_token.access_token,
follow_redirects=False,
raise_on_unexpected_status=True,
timeout=sync.config_get("timeout", "posting", "api"),
)
if __name__ == "__main__":

View File

@@ -28,7 +28,10 @@ async def callback_query_yes(app: PyroClient, callback: CallbackQuery):
db_entry = await col_submitted.find_one({"_id": ObjectId(fullcallback[2])})
try:
submission = await app.submit_media(fullcallback[2])
submission = await app.submit_media(
fullcallback[2],
purge_caption=("caption" not in fullcallback),
)
except SubmissionUnavailableError:
await callback.answer(
text=app._("sub_msg_unavail", "callback", locale=user.locale),
@@ -120,6 +123,11 @@ async def callback_query_yes(app: PyroClient, callback: CallbackQuery):
fullcallback[2],
submission[1],
)
logger.info(
"Submission with ID '%s' accepted and uploaded with ID '%s'",
fullcallback[2],
submission[1],
)
@Client.on_callback_query(filters.regex("sub_no_[\s\S]*"))
@@ -127,12 +135,19 @@ async def callback_query_no(app: PyroClient, callback: CallbackQuery):
user = await app.find_user(callback.from_user)
fullcallback = str(callback.data).split("_")
db_entry = await col_submitted.find_one_and_delete(
{"_id": ObjectId(fullcallback[2])}
db_entry = await col_submitted.delete_one({"_id": ObjectId(fullcallback[2])})
if db_entry.deleted_count == 0:
await callback.answer(
text=app._("sub_deleted", "callback", locale=user.locale).format(
fullcallback[2]
),
show_alert=True,
)
return
if (
db_entry["temp"]["uuid"] is not None
db_entry.raw_result["temp"]["uuid"] is not None
and Path(
f"{app.config['locations']['data']}/submissions/{db_entry['temp']['uuid']}"
).exists()

View File

@@ -158,7 +158,7 @@ async def cmd_import(app: PyroClient, message: Message):
uploaded = await photo_upload(
app.config["posting"]["api"]["album"],
client=client,
multipart_data=BodyPhotoUpload(
body=BodyPhotoUpload(
File(photo_bytes, Path(filename).name, "image/jpeg")
),
ignore_duplicates=app.config["submission"]["allow_duplicates"],

View File

@@ -1,11 +1,11 @@
aiohttp~=3.9.0
aiohttp~=3.10.2
async_pymongo==0.1.6
convopyro==0.5
pillow~=10.1.0
pykeyboard==0.1.5
pillow~=10.4.0
pykeyboard==0.1.7
pytimeparse~=1.1.8
tgcrypto==1.2.5
uvloop==0.19.0
#uvloop==0.19.0
--extra-index-url https://git.end-play.xyz/api/packages/profitroll/pypi/simple
async_pymongo==0.1.4
libbot[speed,pyrogram]==2.0.1
photosapi_client==0.5.0
libbot[speed,pyrogram]==3.2.3
photosapi_client==0.6.0