txa-m 2.0.7__tar.gz → 2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txa-m
3
- Version: 2.0.7
3
+ Version: 2.1.0
4
4
  Summary: A modern, high-speed downloader for MediaFire files and folders
5
5
  Home-page: https://github.com/TXAVLOG/TXA-MEDIAFIRE
6
6
  Author: TXA
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="txa-m",
5
- version="2.0.7",
5
+ version="2.1.0",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "requests",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: txa-m
3
- Version: 2.0.7
3
+ Version: 2.1.0
4
4
  Summary: A modern, high-speed downloader for MediaFire files and folders
5
5
  Home-page: https://github.com/TXAVLOG/TXA-MEDIAFIRE
6
6
  Author: TXA
@@ -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.7"
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"[dim]Run 'txa-m --u' to upgrade[/dim]",
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:
@@ -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
  }
File without changes
File without changes
File without changes
File without changes
File without changes