txa-m 2.0.7__py3-none-any.whl → 2.1.0__py3-none-any.whl
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.
- {txa_m-2.0.7.dist-info → txa_m-2.1.0.dist-info}/METADATA +1 -1
- txa_m-2.1.0.dist-info/RECORD +8 -0
- txa_mediafire/cli.py +72 -3
- txa_mediafire/translations.json +14 -2
- txa_m-2.0.7.dist-info/RECORD +0 -8
- {txa_m-2.0.7.dist-info → txa_m-2.1.0.dist-info}/WHEEL +0 -0
- {txa_m-2.0.7.dist-info → txa_m-2.1.0.dist-info}/entry_points.txt +0 -0
- {txa_m-2.0.7.dist-info → txa_m-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
txa_mediafire/__init__.py,sha256=vJfxJh8-WpzNM9GvoKORSBDfF1UdJb6sHUmP2KjAQ98,28
|
|
2
|
+
txa_mediafire/cli.py,sha256=nl1hhFo-lAB8XoRWWiMOpDVhRk0Bosc8fu0GzPvWdEo,31816
|
|
3
|
+
txa_mediafire/translations.json,sha256=42yX0AIdKTULjDmq1gf_IEzMXGWeBTHii-4oQ8NVwqY,5142
|
|
4
|
+
txa_m-2.1.0.dist-info/METADATA,sha256=QaiUGTBwLpI29_A3QAUMxnsIXfgAYGl4BcFj3jjsRto,4128
|
|
5
|
+
txa_m-2.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
+
txa_m-2.1.0.dist-info/entry_points.txt,sha256=cDQgfUn0g87jECRW-pi0P4nAhZ5iWf7OUrkt3oklnyw,49
|
|
7
|
+
txa_m-2.1.0.dist-info/top_level.txt,sha256=-xUoP0BsB9fBFX_zBvgJ6vjkqMkoFCyG498DgBJCm6M,14
|
|
8
|
+
txa_m-2.1.0.dist-info/RECORD,,
|
txa_mediafire/cli.py
CHANGED
|
@@ -41,7 +41,7 @@ from rich.theme import Theme
|
|
|
41
41
|
from rich import box
|
|
42
42
|
|
|
43
43
|
# --- Configuration ---
|
|
44
|
-
APP_VERSION = "2.0
|
|
44
|
+
APP_VERSION = "2.1.0"
|
|
45
45
|
|
|
46
46
|
# Default ignore lists
|
|
47
47
|
IGNORE_EXTENSIONS = {".pyc", ".pyo", ".pyd", ".DS_Store", "Thumbs.db"}
|
|
@@ -98,6 +98,66 @@ def save_config(language):
|
|
|
98
98
|
console.print(f"[bold red]Error saving config:[/bold red] {e}")
|
|
99
99
|
return False
|
|
100
100
|
|
|
101
|
+
def get_history_path():
|
|
102
|
+
return path.join(path.dirname(get_config_path()), "history.txa")
|
|
103
|
+
|
|
104
|
+
def xor_cipher(data: str) -> str:
|
|
105
|
+
key = "txamediafire"
|
|
106
|
+
return "".join(chr(ord(c) ^ ord(key[i % len(key)])) for i, c in enumerate(data))
|
|
107
|
+
|
|
108
|
+
def save_to_history(filename, size_str):
|
|
109
|
+
history_path = get_history_path()
|
|
110
|
+
try:
|
|
111
|
+
data = []
|
|
112
|
+
if path.exists(history_path):
|
|
113
|
+
with open(history_path, "rb") as f:
|
|
114
|
+
enc_data = f.read()
|
|
115
|
+
try:
|
|
116
|
+
decrypted = xor_cipher(base64.b64decode(enc_data).decode("utf-8"))
|
|
117
|
+
data = json.loads(decrypted)
|
|
118
|
+
except: data = []
|
|
119
|
+
|
|
120
|
+
entry = {
|
|
121
|
+
"date": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
122
|
+
"file": filename,
|
|
123
|
+
"size": size_str
|
|
124
|
+
}
|
|
125
|
+
data.append(entry)
|
|
126
|
+
|
|
127
|
+
# Keep only last 100 entries for performance
|
|
128
|
+
data = data[-100:]
|
|
129
|
+
|
|
130
|
+
json_str = json.dumps(data)
|
|
131
|
+
encrypted = base64.b64encode(xor_cipher(json_str).encode("utf-8"))
|
|
132
|
+
with open(history_path, "wb") as f:
|
|
133
|
+
f.write(encrypted)
|
|
134
|
+
except: pass
|
|
135
|
+
|
|
136
|
+
def show_history():
|
|
137
|
+
history_path = get_history_path()
|
|
138
|
+
print_header()
|
|
139
|
+
table = Table(title=f"[bold cyan]{T['history_title']}[/bold cyan]", box=box.ROUNDED, expand=True)
|
|
140
|
+
table.add_column(T["history_header_date"], style="dim", width=20)
|
|
141
|
+
table.add_column(T["history_header_file"], style="green")
|
|
142
|
+
table.add_column(T["history_header_size"], justify="right", style="magenta", width=15)
|
|
143
|
+
|
|
144
|
+
if not path.exists(history_path):
|
|
145
|
+
console.print(f"[italic yellow]{T['history_empty']}[/italic yellow]")
|
|
146
|
+
return
|
|
147
|
+
|
|
148
|
+
try:
|
|
149
|
+
with open(history_path, "rb") as f:
|
|
150
|
+
enc_data = f.read()
|
|
151
|
+
decrypted = xor_cipher(base64.b64decode(enc_data).decode("utf-8"))
|
|
152
|
+
data = json.loads(decrypted)
|
|
153
|
+
|
|
154
|
+
for item in reversed(data): # Show latest first
|
|
155
|
+
table.add_row(item["date"], item["file"], item["size"])
|
|
156
|
+
|
|
157
|
+
console.print(table)
|
|
158
|
+
except Exception as e:
|
|
159
|
+
console.print(f"[error]Error reading history:[/error] {e}")
|
|
160
|
+
|
|
101
161
|
# Load global config
|
|
102
162
|
CONFIG = load_config()
|
|
103
163
|
LANG = CONFIG.get("language", "en")
|
|
@@ -217,8 +277,9 @@ def check_update(silent=False):
|
|
|
217
277
|
if latest_version != APP_VERSION:
|
|
218
278
|
console.print(Panel(
|
|
219
279
|
f"{T['update_available']}\n"
|
|
220
|
-
f"[bold red]v{APP_VERSION}[/bold red] -> [bold green]v{latest_version}[/bold green]\n"
|
|
221
|
-
f"[
|
|
280
|
+
f"[bold red]v{APP_VERSION}[/bold red] -> [bold green]v{latest_version}[/bold green]\n\n"
|
|
281
|
+
f"[yellow]{T['update_notice']}[/yellow]\n"
|
|
282
|
+
f"[dim]Alternative: pip install --upgrade txa-m[/dim]",
|
|
222
283
|
title="[bold magenta]UPDATE[/bold magenta]",
|
|
223
284
|
border_style="magenta",
|
|
224
285
|
expand=False
|
|
@@ -366,6 +427,7 @@ def show_help():
|
|
|
366
427
|
opts_table.add_row('"-ie", "--ignore-extensions"', "Ignore specific extensions [dim](e.g. .mp4,.mkv)[/dim]")
|
|
367
428
|
opts_table.add_row('"-in", "--ignore-names"', "Ignore specific filenames")
|
|
368
429
|
opts_table.add_row('"--sl", "--set-lang"', "Set language [dim](en/vi)[/dim]")
|
|
430
|
+
opts_table.add_row('"-hi", "--history"', "Show download history [dim](encrypted)[/dim]")
|
|
369
431
|
opts_table.add_row('"-u", "--update"', "Check and auto-update tool via pip")
|
|
370
432
|
opts_table.add_row('"-v", "--version"', "Show version info")
|
|
371
433
|
|
|
@@ -395,6 +457,7 @@ def main():
|
|
|
395
457
|
parser.add_argument("-in", "--ignore-names", help="Comma-separated list of filenames to ignore", default=None)
|
|
396
458
|
parser.add_argument("-v", "--version", action="version", version=f"TXA MediaFire Bulk Downloader v{APP_VERSION} (c) TXA", help="Show version and copyright info")
|
|
397
459
|
parser.add_argument("--sl", "--set-lang", choices=["en", "vi"], help="Set application language (en/vi)", dest="set_lang")
|
|
460
|
+
parser.add_argument("-hi", "--history", action="store_true", help="Show encrypted download history")
|
|
398
461
|
parser.add_argument("-u", "--update", action="store_true", help="Check and auto-update tool via pip")
|
|
399
462
|
parser.add_argument("-h", "--help", action="store_true", help="Show this help message")
|
|
400
463
|
|
|
@@ -405,6 +468,11 @@ def main():
|
|
|
405
468
|
show_help()
|
|
406
469
|
sys.exit(0)
|
|
407
470
|
|
|
471
|
+
# Handle History
|
|
472
|
+
if args.history:
|
|
473
|
+
show_history()
|
|
474
|
+
sys.exit(0)
|
|
475
|
+
|
|
408
476
|
# Handle Language Setting
|
|
409
477
|
if args.set_lang:
|
|
410
478
|
if save_config(args.set_lang):
|
|
@@ -727,6 +795,7 @@ def download_file_worker(file, output_dir, event, limiter, progress, update_cb):
|
|
|
727
795
|
|
|
728
796
|
with stats.lock:
|
|
729
797
|
stats.downloaded_files += 1
|
|
798
|
+
save_to_history(filename, format_size(file_size))
|
|
730
799
|
update_cb()
|
|
731
800
|
|
|
732
801
|
except Exception as e:
|
txa_mediafire/translations.json
CHANGED
|
@@ -37,7 +37,13 @@
|
|
|
37
37
|
"updating": "Updating to version",
|
|
38
38
|
"update_success": "Update successful! Please restart the tool.",
|
|
39
39
|
"err_unrecognized_args": "Unrecognized arguments",
|
|
40
|
-
"err_missed_args": "the following arguments are required"
|
|
40
|
+
"err_missed_args": "the following arguments are required",
|
|
41
|
+
"history_title": "Download History",
|
|
42
|
+
"history_empty": "No download history found.",
|
|
43
|
+
"history_header_date": "Date",
|
|
44
|
+
"history_header_file": "Filename",
|
|
45
|
+
"history_header_size": "Size",
|
|
46
|
+
"update_notice": "Run 'txa-m -u' to update now."
|
|
41
47
|
},
|
|
42
48
|
"vi": {
|
|
43
49
|
"banner_desc": "Trình tải xuống tốc độ cao, hiện đại cho MediaFire",
|
|
@@ -77,6 +83,12 @@
|
|
|
77
83
|
"updating": "Đang cập nhật lên phiên bản",
|
|
78
84
|
"update_success": "Cập nhật thành công! Vui lòng khởi động lại công cụ.",
|
|
79
85
|
"err_unrecognized_args": "Tham số không được nhận diện",
|
|
80
|
-
"err_missed_args": "các tham số sau là bắt buộc"
|
|
86
|
+
"err_missed_args": "các tham số sau là bắt buộc",
|
|
87
|
+
"history_title": "Lịch sử tải xuống",
|
|
88
|
+
"history_empty": "Chưa có lịch sử tải xuống.",
|
|
89
|
+
"history_header_date": "Ngày tháng",
|
|
90
|
+
"history_header_file": "Tên tệp",
|
|
91
|
+
"history_header_size": "Dung lượng",
|
|
92
|
+
"update_notice": "Chạy lệnh 'txa-m -u' để cập nhật ngay."
|
|
81
93
|
}
|
|
82
94
|
}
|
txa_m-2.0.7.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
txa_mediafire/__init__.py,sha256=vJfxJh8-WpzNM9GvoKORSBDfF1UdJb6sHUmP2KjAQ98,28
|
|
2
|
-
txa_mediafire/cli.py,sha256=wQD4pQ3aPKjAbpRdsN3gWVSfMjjbQNO67Ay267jjvNA,29150
|
|
3
|
-
txa_mediafire/translations.json,sha256=rz2ghMGu3Ge40Oz6Kbq01F0NJzzslg_LrmYHU0BixJ0,4514
|
|
4
|
-
txa_m-2.0.7.dist-info/METADATA,sha256=h_DQi9BE2MsqgbCP2N3Wsargtc82TgjhmdvPJly2IZY,4128
|
|
5
|
-
txa_m-2.0.7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
-
txa_m-2.0.7.dist-info/entry_points.txt,sha256=cDQgfUn0g87jECRW-pi0P4nAhZ5iWf7OUrkt3oklnyw,49
|
|
7
|
-
txa_m-2.0.7.dist-info/top_level.txt,sha256=-xUoP0BsB9fBFX_zBvgJ6vjkqMkoFCyG498DgBJCm6M,14
|
|
8
|
-
txa_m-2.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|