mirror of
https://github.com/flibusta-apps/library_updater.git
synced 2025-12-06 07:45:35 +01:00
Bump
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
from enum import Enum
|
||||
|
||||
from app.services.updaters.base import BaseUpdater
|
||||
from app.services.updaters.flibusta_updater import FlibustaUpdater
|
||||
from app.services.updaters.fl_updater import FlUpdater
|
||||
|
||||
|
||||
class UpdaterTypes(Enum):
|
||||
FLIBUSTA = 'flibusta'
|
||||
FL = 'fl'
|
||||
|
||||
|
||||
UPDATERS: dict[UpdaterTypes, BaseUpdater] = {
|
||||
UpdaterTypes.FLIBUSTA: FlibustaUpdater
|
||||
UpdaterTypes.FL: FlUpdater
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ def remove_dots(s: str):
|
||||
return s.replace('.', '')
|
||||
|
||||
|
||||
class FlibustaUpdater(BaseUpdater):
|
||||
class FlUpdater(BaseUpdater):
|
||||
SOURCE: int
|
||||
|
||||
FILES = [
|
||||
@@ -83,7 +83,7 @@ class FlibustaUpdater(BaseUpdater):
|
||||
|
||||
async def _import_dump(self, filename: str):
|
||||
result = await run(
|
||||
f"wget -O - http://flibusta.is/sql/{filename}.gz | gunzip | "
|
||||
f"wget -O - {env_config.FL_BASE_URL}/sql/{filename}.gz | gunzip | "
|
||||
f"mysql -h {env_config.MYSQL_HOST} -u {env_config.MYSQL_USER} "
|
||||
f"-p\"{env_config.MYSQL_PASSWORD}\" {env_config.MYSQL_DB_NAME}"
|
||||
)
|
||||
@@ -16,5 +16,7 @@ class EnvConfig(BaseSettings):
|
||||
MYSQL_USER: str
|
||||
MYSQL_PASSWORD: str
|
||||
|
||||
FL_BASE_URL: str
|
||||
|
||||
|
||||
env_config = EnvConfig()
|
||||
|
||||
Reference in New Issue
Block a user