weeb-cli 0.0.2__tar.gz → 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/PKG-INFO +1 -1
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/pyproject.toml +1 -1
- weeb_cli-0.1.0/weeb_cli/__init__.py +1 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli/config.py +9 -2
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli/i18n.py +4 -10
- weeb_cli-0.1.0/weeb_cli/main.py +63 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/PKG-INFO +1 -1
- weeb_cli-0.0.2/weeb_cli/__init__.py +0 -1
- weeb_cli-0.0.2/weeb_cli/main.py +0 -46
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/setup.cfg +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli/__main__.py +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/SOURCES.txt +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/dependency_links.txt +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/entry_points.txt +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/requires.txt +0 -0
- {weeb_cli-0.0.2 → weeb_cli-0.1.0}/weeb_cli.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "weeb-cli"
|
|
7
|
-
version = "0.0
|
|
7
|
+
version = "0.1.0"
|
|
8
8
|
description = "Tarayıcı yok, reklam yok, dikkat dağıtıcı unsur yok. Sadece siz ve eşsiz bir anime izleme deneyimi."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "ewgsta", email = "ewgst@proton.me" }]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -7,7 +7,15 @@ CONFIG_DIR = Path.home() / f".{APP_NAME}"
|
|
|
7
7
|
CONFIG_FILE = CONFIG_DIR / "config.json"
|
|
8
8
|
|
|
9
9
|
DEFAULT_CONFIG = {
|
|
10
|
-
"language": None
|
|
10
|
+
"language": None,
|
|
11
|
+
"aria2_enabled": True,
|
|
12
|
+
"ytdlp_enabled": True,
|
|
13
|
+
"aria2_max_connections": 16,
|
|
14
|
+
"max_concurrent_downloads": 3,
|
|
15
|
+
"download_dir": os.path.join(os.getcwd(), "weeb-downloads"),
|
|
16
|
+
"ytdlp_format": "bestvideo+bestaudio/best",
|
|
17
|
+
"scraping_source": "",
|
|
18
|
+
"api_url": "http://127.0.0.1:8000"
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
class Config:
|
|
@@ -39,5 +47,4 @@ class Config:
|
|
|
39
47
|
self.data[key] = value
|
|
40
48
|
self._save(self.data)
|
|
41
49
|
|
|
42
|
-
# Singleton instance
|
|
43
50
|
config = Config()
|
|
@@ -3,12 +3,11 @@ import os
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from weeb_cli.config import config
|
|
5
5
|
|
|
6
|
-
# Path to the locales directory
|
|
7
6
|
LOCALES_DIR = Path(__file__).parent / "locales"
|
|
8
7
|
|
|
9
8
|
class I18n:
|
|
10
9
|
def __init__(self):
|
|
11
|
-
self.language = config.get("language", "en")
|
|
10
|
+
self.language = config.get("language", "en")
|
|
12
11
|
self.translations = {}
|
|
13
12
|
self.load_translations()
|
|
14
13
|
|
|
@@ -20,7 +19,6 @@ class I18n:
|
|
|
20
19
|
def load_translations(self):
|
|
21
20
|
file_path = LOCALES_DIR / f"{self.language}.json"
|
|
22
21
|
if not file_path.exists():
|
|
23
|
-
# Fallback to English if file missing
|
|
24
22
|
file_path = LOCALES_DIR / "en.json"
|
|
25
23
|
|
|
26
24
|
try:
|
|
@@ -31,11 +29,6 @@ class I18n:
|
|
|
31
29
|
self.translations = {}
|
|
32
30
|
|
|
33
31
|
def get(self, key_path, **kwargs):
|
|
34
|
-
"""
|
|
35
|
-
Get a translation string by dot-separated path.
|
|
36
|
-
Example: i18n.get("menu.title")
|
|
37
|
-
Supports formatting: i18n.get("hello.response", name="User")
|
|
38
|
-
"""
|
|
39
32
|
keys = key_path.split(".")
|
|
40
33
|
value = self.translations
|
|
41
34
|
|
|
@@ -43,7 +36,7 @@ class I18n:
|
|
|
43
36
|
if isinstance(value, dict):
|
|
44
37
|
value = value.get(key)
|
|
45
38
|
else:
|
|
46
|
-
return key_path
|
|
39
|
+
return key_path
|
|
47
40
|
|
|
48
41
|
if value is None:
|
|
49
42
|
return key_path
|
|
@@ -55,6 +48,7 @@ class I18n:
|
|
|
55
48
|
return value
|
|
56
49
|
|
|
57
50
|
return value
|
|
51
|
+
|
|
52
|
+
t = get
|
|
58
53
|
|
|
59
|
-
# Singleton instance
|
|
60
54
|
i18n = I18n()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
import questionary
|
|
3
|
+
import sys
|
|
4
|
+
import time
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from weeb_cli.ui.menu import show_main_menu
|
|
7
|
+
from weeb_cli.commands.search import search_anime
|
|
8
|
+
from weeb_cli.commands.watchlist import open_watchlist
|
|
9
|
+
from weeb_cli.commands.settings import open_settings
|
|
10
|
+
from weeb_cli.config import config
|
|
11
|
+
from weeb_cli.i18n import i18n
|
|
12
|
+
from weeb_cli.commands.setup import start_setup_wizard
|
|
13
|
+
from weeb_cli.services.dependency_manager import dependency_manager
|
|
14
|
+
|
|
15
|
+
app = typer.Typer(add_completion=False)
|
|
16
|
+
console = Console()
|
|
17
|
+
|
|
18
|
+
def check_network():
|
|
19
|
+
with console.status(f"[dim]{i18n.t('common.ctrl_c_hint')}[/dim]", spinner="dots"):
|
|
20
|
+
time.sleep(1)
|
|
21
|
+
|
|
22
|
+
def run_setup():
|
|
23
|
+
langs = {
|
|
24
|
+
"Türkçe": "tr",
|
|
25
|
+
"English": "en"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
selected = questionary.select(
|
|
29
|
+
"Select Language / Dil Seçiniz",
|
|
30
|
+
choices=list(langs.keys()),
|
|
31
|
+
use_indicator=True,
|
|
32
|
+
pointer=">"
|
|
33
|
+
).ask()
|
|
34
|
+
|
|
35
|
+
if selected:
|
|
36
|
+
lang_code = langs[selected]
|
|
37
|
+
i18n.set_language(lang_code)
|
|
38
|
+
|
|
39
|
+
console.print(f"[dim]{i18n.t('common.ctrl_c_hint')}[/dim]")
|
|
40
|
+
start_setup_wizard()
|
|
41
|
+
|
|
42
|
+
def check_ffmpeg_silent():
|
|
43
|
+
if not dependency_manager.check_dependency("ffmpeg"):
|
|
44
|
+
console.print(f"[cyan]{i18n.t('setup.downloading', tool='FFmpeg')}...[/cyan]")
|
|
45
|
+
dependency_manager.install_dependency("ffmpeg")
|
|
46
|
+
|
|
47
|
+
@app.command()
|
|
48
|
+
def start():
|
|
49
|
+
if not config.get("language"):
|
|
50
|
+
run_setup()
|
|
51
|
+
|
|
52
|
+
check_network()
|
|
53
|
+
check_ffmpeg_silent()
|
|
54
|
+
|
|
55
|
+
show_main_menu()
|
|
56
|
+
|
|
57
|
+
@app.callback(invoke_without_command=True)
|
|
58
|
+
def main(ctx: typer.Context):
|
|
59
|
+
if ctx.invoked_subcommand is None:
|
|
60
|
+
start()
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
app()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.2"
|
weeb_cli-0.0.2/weeb_cli/main.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import typer
|
|
2
|
-
import questionary
|
|
3
|
-
from weeb_cli.ui.menu import show_main_menu
|
|
4
|
-
from weeb_cli.commands.hello import say_hello
|
|
5
|
-
from weeb_cli.commands.settings import open_settings
|
|
6
|
-
from weeb_cli.config import config
|
|
7
|
-
from weeb_cli.i18n import i18n
|
|
8
|
-
|
|
9
|
-
app = typer.Typer(add_completion=False)
|
|
10
|
-
|
|
11
|
-
def run_setup():
|
|
12
|
-
"""First run setup to select language."""
|
|
13
|
-
langs = {
|
|
14
|
-
"Türkçe": "tr",
|
|
15
|
-
"English": "en"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
selected = questionary.select(
|
|
19
|
-
"Select Language / Dil Seçiniz",
|
|
20
|
-
choices=list(langs.keys()),
|
|
21
|
-
use_indicator=True
|
|
22
|
-
).ask()
|
|
23
|
-
|
|
24
|
-
if selected:
|
|
25
|
-
i18n.set_language(langs[selected])
|
|
26
|
-
|
|
27
|
-
@app.command()
|
|
28
|
-
def start():
|
|
29
|
-
# If language is not set (first run), run setup
|
|
30
|
-
if not config.get("language"):
|
|
31
|
-
run_setup()
|
|
32
|
-
|
|
33
|
-
# Define actions mapping: Key (for i18n lookup) -> Function
|
|
34
|
-
actions = {
|
|
35
|
-
"hello": say_hello,
|
|
36
|
-
"settings": open_settings
|
|
37
|
-
}
|
|
38
|
-
show_main_menu(actions)
|
|
39
|
-
|
|
40
|
-
@app.callback(invoke_without_command=True)
|
|
41
|
-
def main(ctx: typer.Context):
|
|
42
|
-
if ctx.invoked_subcommand is None:
|
|
43
|
-
start()
|
|
44
|
-
|
|
45
|
-
if __name__ == "__main__":
|
|
46
|
-
app()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|