mirror of
https://github.com/tropicoo/yt-dlp-bot.git
synced 2024-09-20 14:56:09 +08:00
Maintenance
This commit is contained in:
parent
d344008c2b
commit
32e9b92eeb
|
@ -13,4 +13,4 @@
|
||||||
**/*Dockerfile*
|
**/*Dockerfile*
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
.ruff.toml
|
pyproject.toml
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
PyYAML==6.0.1
|
PyYAML==6.0.1
|
||||||
addict==2.4.0
|
|
||||||
pyrofork==2.3.21.post3
|
pyrofork==2.3.21.post3
|
||||||
tenacity==8.2.3
|
tenacity==8.2.3
|
||||||
tgcrypto-pyrofork==1.2.6
|
tgcrypto-pyrofork==1.2.6
|
||||||
|
|
|
@ -53,7 +53,7 @@ class EncodeToH264Task(AbstractFfBinaryTask):
|
||||||
|
|
||||||
proc = await self._run_proc(cmd)
|
proc = await self._run_proc(cmd)
|
||||||
if not proc:
|
if not proc:
|
||||||
return None
|
return
|
||||||
|
|
||||||
stdout, stderr = await self._get_stdout_stderr(proc)
|
stdout, stderr = await self._get_stdout_stderr(proc)
|
||||||
self._log.info(
|
self._log.info(
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
|
[tool.ruff]
|
||||||
line-length = 88
|
line-length = 88
|
||||||
|
indent-width = 4
|
||||||
|
target-version = "py312"
|
||||||
src = ["app_api", "app_bot", "app_worker"]
|
src = ["app_api", "app_bot", "app_worker"]
|
||||||
|
required-version = ">=0.3.4"
|
||||||
|
|
||||||
[lint]
|
[tool.ruff.lint]
|
||||||
select = ["F", "E", "W", "I001"]
|
select = ["F", "E", "W", "I001", "RET", "SLF001"]
|
||||||
ignore = ["E501"] # Skip line length violations
|
ignore = ["E501"] # Skip line length violations
|
||||||
|
|
||||||
[format]
|
[tool.ruff.format]
|
||||||
indent-style = "space"
|
indent-style = "space"
|
||||||
quote-style = "single"
|
quote-style = "single"
|
||||||
line-ending = "lf"
|
line-ending = "lf"
|
|
@ -24,6 +24,7 @@ setup(
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'Natural Language :: English',
|
'Natural Language :: English',
|
||||||
'Programming Language :: Python :: 3.11',
|
'Programming Language :: Python :: 3.11',
|
||||||
|
'Programming Language :: Python :: 3.12',
|
||||||
],
|
],
|
||||||
description='Common shared utils for yt downloader bot',
|
description='Common shared utils for yt downloader bot',
|
||||||
install_requires=get_requirements(),
|
install_requires=get_requirements(),
|
||||||
|
|
|
@ -5,7 +5,7 @@ import aiohttp
|
||||||
from yt_shared.schemas.ytdlp import LatestVersion
|
from yt_shared.schemas.ytdlp import LatestVersion
|
||||||
|
|
||||||
|
|
||||||
class YtDlpGithubClient:
|
class YtdlpGithubClient:
|
||||||
"""yt-dlp Github version number checker."""
|
"""yt-dlp Github version number checker."""
|
||||||
|
|
||||||
LATEST_TAG_URL = 'https://github.com/yt-dlp/yt-dlp/releases/latest'
|
LATEST_TAG_URL = 'https://github.com/yt-dlp/yt-dlp/releases/latest'
|
||||||
|
|
|
@ -2,7 +2,7 @@ import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
from yt_shared.clients.github import YtDlpGithubClient
|
from yt_shared.clients.github import YtdlpGithubClient
|
||||||
from yt_shared.repositories.ytdlp import YtdlpRepository
|
from yt_shared.repositories.ytdlp import YtdlpRepository
|
||||||
from yt_shared.schemas.ytdlp import CurrentVersion, LatestVersion, VersionContext
|
from yt_shared.schemas.ytdlp import CurrentVersion, LatestVersion, VersionContext
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class YtdlpVersionChecker:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self._log = logging.getLogger(self.__class__.__name__)
|
self._log = logging.getLogger(self.__class__.__name__)
|
||||||
self._ytdlp_repository = YtdlpRepository()
|
self._ytdlp_repository = YtdlpRepository()
|
||||||
self._ytdlp_client = YtDlpGithubClient()
|
self._ytdlp_client = YtdlpGithubClient()
|
||||||
|
|
||||||
async def get_version_context(self, db: AsyncSession) -> VersionContext:
|
async def get_version_context(self, db: AsyncSession) -> VersionContext:
|
||||||
latest, current = await asyncio.gather(
|
latest, current = await asyncio.gather(
|
||||||
|
|
Loading…
Reference in a new issue