mytunes-pro 1.5.9__tar.gz → 1.8.4__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: mytunes-pro
3
- Version: 1.5.9
3
+ Version: 1.8.4
4
4
  Summary: A lightweight, keyboard-centric terminal player for streaming YouTube music.
5
5
  Author-email: loxo <loxo5432@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/postgresql-co-kr/mytunes
@@ -19,7 +19,7 @@ Dynamic: license-file
19
19
 
20
20
  # 🎵 MyTunes Pro (Korean)
21
21
 
22
- **현대적인 CLI 유튜브 뮤직 플레이어 (v1.5.6)**
22
+ **현대적인 CLI 유튜브 뮤직 플레이어 (v1.8.4)**
23
23
  터미널 환경에서 **YouTube 음악을 검색하여 듣는** 가볍고 빠른 키보드 중심의 플레이어입니다.
24
24
  한국어 입력 환경에서도 **숫자 키(1~5)**를 통해 지연 없는 쾌적한 조작이 가능합니다.
25
25
 
@@ -208,7 +208,7 @@ Windows 환경에서 한글 검색이 안 되거나 설치가 어려운 분들
208
208
 
209
209
  # 🎵 MyTunes Pro (English)
210
210
 
211
- **Modern CLI YouTube Music Player (v1.5.6)**
211
+ **Modern CLI YouTube Music Player (v1.8.4)**
212
212
  A lightweight, keyboard-centric terminal player for streaming YouTube music.
213
213
 
214
214
  ---
@@ -296,6 +296,88 @@ sudo apt install mpv python3 python3-pip pipx python3-venv -y
296
296
 
297
297
  ## 🔄 Changelog
298
298
 
299
+ ### v1.8.4 (Latest)
300
+
301
+ - **Python Crash Fix (WSL)**: Eliminated premature termination by implementing `start_new_session=True` for browser launches, isolating them from the TUI process group.
302
+ - **Hybrid Browser Strategy**: Switched to the standard `webbrowser` library for F7 (YouTube links) for maximum internal stability.
303
+ - **Global Error Protection**: Wrapped the main application loop in an exception guard to catch and log transient OS errors without crashing the entire app.
304
+ - **Refined Process Cleanup**: Specialized the `pkill` logic to prevent accidental self-termination while maintaining reliable MPV management.
305
+
306
+ ### v1.8.3
307
+
308
+ - **Direct Binary Execution (WSL)**: Resolved shell parsing issues by bypassing `cmd.exe` and directly executing Windows browser binaries via `/mnt/c/` paths.
309
+ - **App Mode Reliability**: Guaranteed 712x800 popup mode by ensuring flags are delivered directly to the browser process without intermediate shell mangling.
310
+ - **Fixed URL Resolution**: Eliminated the "Empty URL" bug by standardizing argument passing between WSL and Windows.
311
+
312
+ ### v1.8.1
313
+
314
+ - **Fixed App Mode (WSL/Win)**: Guaranteed the browser opens in a clean "App Mode" popup by fixing shell quoting issues in the launch command.
315
+ - **URL Resolution Fix**: Resolved the "Empty URL" bug on WSL/Windows by ensuring the `--app` flag is correctly parsed by the native Windows shell.
316
+ - **Reliable Popup UI**: Standardized on `start "" chrome` for WSL to ensure flags are never misidentified as window titles.
317
+
318
+ ### v1.8.0
319
+
320
+ - **Stabilized Browser Launch (Windows/WSL)**: Completely removed the `--user-data-dir` flag for all Windows-based environments. This permanently resolves the "cannot read or write" directory errors while maintaining reliable 712x800 window sizing through pure app-mode flags.
321
+ - **Clean CMD Execution**: Simplified the WSL-to-Windows transition by using standard `cmd.exe` calls without complex path or variable expansion, ensuring consistent behavior across all systems.
322
+
323
+ ### v1.7.9
324
+
325
+ - **Pure CMD-based Launch (WSL/Win)**: Final fix for WSL-to-Windows browser launch using `cmd.exe /c` with native `%LOCALAPPDATA%` expansion.
326
+ - **Directory Reliability**: Ensured Chrome data directory creation and access by using native Windows shell commands, eliminating the "cannot read or write" errors seen in v1.7.8.
327
+ - **Stable Window Sizing**: Guaranteed 712x800 window size for Live Station (F8) from WSL by correctly isolating browser profiles via native Windows paths.
328
+
329
+ ### v1.7.8
330
+
331
+ - **Native PowerShell Profile Management**: Resolved directory read/write errors in WSL by moving all profile creation and path handling to the Windows side via PowerShell.
332
+ - **Improved Security & Isolation**: Profiles are now created in the standard Windows `LOCALAPPDATA` directory with native permissions, ensuring Chrome can always access its data.
333
+ - **Backslash Consistency**: Forced backslash-only paths through pure PowerShell logic, fixing the mixed-slash issue seen in WSL.
334
+
335
+ ### v1.7.7
336
+
337
+ - **PowerShell Launch (WSL/Win)**: Switched to `powershell.exe` for launching browsers from WSL to ensure robust argument parsing and path handling.
338
+ - **Directory Fix**: Resolved "cannot read or write" error on Windows/WSL by utilizing `$env:TEMP` directly within a native shell context.
339
+ - **Reliable Sizing**: Guaranteed window size application by combining isolated profiles with PowerShell's superior process management.
340
+
341
+ ### v1.7.6
342
+
343
+ - **Isolated Browser Profile**: Guaranteed window sizing for the Live Station (F8) on Windows/WSL by forcing an isolated browser profile using the Windows `%TEMP%` directory.
344
+ - **WSL Path Translation**: Implemented automatic Windows temp path resolution in WSL to enable session persistence and profile isolation.
345
+
346
+ ### v1.7.5
347
+
348
+ - **WSL Integration**: Fully optimized browser launch from WSL by utilizing `cmd.exe` to trigger native Windows browsers.
349
+ - **F7 Windows Resolve**: Fixed an issue where YouTube (F7) wouldn't open in WSL environments.
350
+ - **F8 App Mode (WSL/Win)**: Enhanced flags to ensure "App Mode" (no address bar) works consistently even when launched from WSL.
351
+
352
+ ### v1.7.4
353
+
354
+ - **Windows UI Refinement**: Forced Chrome "App Mode" on Windows by reordering flags and disabling extensions/default-apps to ensure a clean popup without an address bar.
355
+ - **Improved Isolation**: Switched to higher-frequency session rotation for Live Station (F8) to guarantee window size and position persistence fixes.
356
+
357
+ ### v1.7.3
358
+
359
+ - **Windows Fixes**: Resolved issue where F7 (YouTube) failed to open browsers on Windows by implementing `os.startfile` logic.
360
+ - **F8 Initialization**: Improved Live Station (F8) window sizing on Windows by forcing a clean session state.
361
+ - **Robustness**: Enhanced cross-platform browser redirection logic to ensure consistent behavior.
362
+
363
+ ### v1.7.2
364
+
365
+ - **Windows Optimization**: Fixed an issue where the Live Station (F8) window size was not correctly applied on Windows.
366
+ - **Improved Browser Support**: Added Microsoft Edge to the automatic browser detection list.
367
+ - **Robust Launch Logic**: Enhanced browser internal flags for a better initial window experience.
368
+
369
+ ### v1.7.1
370
+
371
+ - **Performance & Logic Optimization**: Standardized browser launch logic for Live Station (F8) across Mac, Windows, and Linux.
372
+ - **UI Polish**: Silenced browser launch warnings in the terminal and added professional UI flags (disable translation/bubble) for a cleaner experience.
373
+ - **Improved Popup Behavior**: Optimized web interface to reuse the same window for Live Station, matching CLI application behavior.
374
+ - **Global Sync**: Version 1.7.1 synchronization across all platforms.
375
+
376
+ ### v1.6.0
377
+
378
+ - **Global Version Synchronization**: Synchronized version 1.6.0 across CLI, README, and Web interface.
379
+ - **Dependency Fix**: Ensured `pusher` dependency is correctly included for real-time features.
380
+
299
381
  ### v1.5.6
300
382
 
301
383
  - **Refined Search History Display**: Improved the search preview logic to use a temporary 'search' view state, providing a smoother experience when opening and canceling search.
@@ -1,6 +1,6 @@
1
1
  # 🎵 MyTunes Pro (Korean)
2
2
 
3
- **현대적인 CLI 유튜브 뮤직 플레이어 (v1.5.6)**
3
+ **현대적인 CLI 유튜브 뮤직 플레이어 (v1.8.4)**
4
4
  터미널 환경에서 **YouTube 음악을 검색하여 듣는** 가볍고 빠른 키보드 중심의 플레이어입니다.
5
5
  한국어 입력 환경에서도 **숫자 키(1~5)**를 통해 지연 없는 쾌적한 조작이 가능합니다.
6
6
 
@@ -189,7 +189,7 @@ Windows 환경에서 한글 검색이 안 되거나 설치가 어려운 분들
189
189
 
190
190
  # 🎵 MyTunes Pro (English)
191
191
 
192
- **Modern CLI YouTube Music Player (v1.5.6)**
192
+ **Modern CLI YouTube Music Player (v1.8.4)**
193
193
  A lightweight, keyboard-centric terminal player for streaming YouTube music.
194
194
 
195
195
  ---
@@ -277,6 +277,88 @@ sudo apt install mpv python3 python3-pip pipx python3-venv -y
277
277
 
278
278
  ## 🔄 Changelog
279
279
 
280
+ ### v1.8.4 (Latest)
281
+
282
+ - **Python Crash Fix (WSL)**: Eliminated premature termination by implementing `start_new_session=True` for browser launches, isolating them from the TUI process group.
283
+ - **Hybrid Browser Strategy**: Switched to the standard `webbrowser` library for F7 (YouTube links) for maximum internal stability.
284
+ - **Global Error Protection**: Wrapped the main application loop in an exception guard to catch and log transient OS errors without crashing the entire app.
285
+ - **Refined Process Cleanup**: Specialized the `pkill` logic to prevent accidental self-termination while maintaining reliable MPV management.
286
+
287
+ ### v1.8.3
288
+
289
+ - **Direct Binary Execution (WSL)**: Resolved shell parsing issues by bypassing `cmd.exe` and directly executing Windows browser binaries via `/mnt/c/` paths.
290
+ - **App Mode Reliability**: Guaranteed 712x800 popup mode by ensuring flags are delivered directly to the browser process without intermediate shell mangling.
291
+ - **Fixed URL Resolution**: Eliminated the "Empty URL" bug by standardizing argument passing between WSL and Windows.
292
+
293
+ ### v1.8.1
294
+
295
+ - **Fixed App Mode (WSL/Win)**: Guaranteed the browser opens in a clean "App Mode" popup by fixing shell quoting issues in the launch command.
296
+ - **URL Resolution Fix**: Resolved the "Empty URL" bug on WSL/Windows by ensuring the `--app` flag is correctly parsed by the native Windows shell.
297
+ - **Reliable Popup UI**: Standardized on `start "" chrome` for WSL to ensure flags are never misidentified as window titles.
298
+
299
+ ### v1.8.0
300
+
301
+ - **Stabilized Browser Launch (Windows/WSL)**: Completely removed the `--user-data-dir` flag for all Windows-based environments. This permanently resolves the "cannot read or write" directory errors while maintaining reliable 712x800 window sizing through pure app-mode flags.
302
+ - **Clean CMD Execution**: Simplified the WSL-to-Windows transition by using standard `cmd.exe` calls without complex path or variable expansion, ensuring consistent behavior across all systems.
303
+
304
+ ### v1.7.9
305
+
306
+ - **Pure CMD-based Launch (WSL/Win)**: Final fix for WSL-to-Windows browser launch using `cmd.exe /c` with native `%LOCALAPPDATA%` expansion.
307
+ - **Directory Reliability**: Ensured Chrome data directory creation and access by using native Windows shell commands, eliminating the "cannot read or write" errors seen in v1.7.8.
308
+ - **Stable Window Sizing**: Guaranteed 712x800 window size for Live Station (F8) from WSL by correctly isolating browser profiles via native Windows paths.
309
+
310
+ ### v1.7.8
311
+
312
+ - **Native PowerShell Profile Management**: Resolved directory read/write errors in WSL by moving all profile creation and path handling to the Windows side via PowerShell.
313
+ - **Improved Security & Isolation**: Profiles are now created in the standard Windows `LOCALAPPDATA` directory with native permissions, ensuring Chrome can always access its data.
314
+ - **Backslash Consistency**: Forced backslash-only paths through pure PowerShell logic, fixing the mixed-slash issue seen in WSL.
315
+
316
+ ### v1.7.7
317
+
318
+ - **PowerShell Launch (WSL/Win)**: Switched to `powershell.exe` for launching browsers from WSL to ensure robust argument parsing and path handling.
319
+ - **Directory Fix**: Resolved "cannot read or write" error on Windows/WSL by utilizing `$env:TEMP` directly within a native shell context.
320
+ - **Reliable Sizing**: Guaranteed window size application by combining isolated profiles with PowerShell's superior process management.
321
+
322
+ ### v1.7.6
323
+
324
+ - **Isolated Browser Profile**: Guaranteed window sizing for the Live Station (F8) on Windows/WSL by forcing an isolated browser profile using the Windows `%TEMP%` directory.
325
+ - **WSL Path Translation**: Implemented automatic Windows temp path resolution in WSL to enable session persistence and profile isolation.
326
+
327
+ ### v1.7.5
328
+
329
+ - **WSL Integration**: Fully optimized browser launch from WSL by utilizing `cmd.exe` to trigger native Windows browsers.
330
+ - **F7 Windows Resolve**: Fixed an issue where YouTube (F7) wouldn't open in WSL environments.
331
+ - **F8 App Mode (WSL/Win)**: Enhanced flags to ensure "App Mode" (no address bar) works consistently even when launched from WSL.
332
+
333
+ ### v1.7.4
334
+
335
+ - **Windows UI Refinement**: Forced Chrome "App Mode" on Windows by reordering flags and disabling extensions/default-apps to ensure a clean popup without an address bar.
336
+ - **Improved Isolation**: Switched to higher-frequency session rotation for Live Station (F8) to guarantee window size and position persistence fixes.
337
+
338
+ ### v1.7.3
339
+
340
+ - **Windows Fixes**: Resolved issue where F7 (YouTube) failed to open browsers on Windows by implementing `os.startfile` logic.
341
+ - **F8 Initialization**: Improved Live Station (F8) window sizing on Windows by forcing a clean session state.
342
+ - **Robustness**: Enhanced cross-platform browser redirection logic to ensure consistent behavior.
343
+
344
+ ### v1.7.2
345
+
346
+ - **Windows Optimization**: Fixed an issue where the Live Station (F8) window size was not correctly applied on Windows.
347
+ - **Improved Browser Support**: Added Microsoft Edge to the automatic browser detection list.
348
+ - **Robust Launch Logic**: Enhanced browser internal flags for a better initial window experience.
349
+
350
+ ### v1.7.1
351
+
352
+ - **Performance & Logic Optimization**: Standardized browser launch logic for Live Station (F8) across Mac, Windows, and Linux.
353
+ - **UI Polish**: Silenced browser launch warnings in the terminal and added professional UI flags (disable translation/bubble) for a cleaner experience.
354
+ - **Improved Popup Behavior**: Optimized web interface to reuse the same window for Live Station, matching CLI application behavior.
355
+ - **Global Sync**: Version 1.7.1 synchronization across all platforms.
356
+
357
+ ### v1.6.0
358
+
359
+ - **Global Version Synchronization**: Synchronized version 1.6.0 across CLI, README, and Web interface.
360
+ - **Dependency Fix**: Ensured `pusher` dependency is correctly included for real-time features.
361
+
280
362
  ### v1.5.6
281
363
 
282
364
  - **Refined Search History Display**: Improved the search preview logic to use a temporary 'search' view state, providing a smoother experience when opening and canceling search.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mytunes-pro"
7
- version = "1.5.9"
7
+ version = "1.8.4"
8
8
  authors = [
9
9
  { name = "loxo", email = "loxo5432@gmail.com" },
10
10
  ]
@@ -16,9 +16,14 @@ import unicodedata
16
16
  import socket
17
17
  import locale
18
18
  import signal
19
+ import warnings
20
+ # Suppress urllib3 warning about LibreSSL compatibility
21
+ warnings.filterwarnings("ignore", message=".*urllib3 v2 only supports OpenSSL 1.1.1+.*")
22
+ import webbrowser
23
+ import tempfile
24
+ import shutil
19
25
  import pusher
20
26
  import requests
21
- import webbrowser
22
27
 
23
28
 
24
29
  # Ensure Unicode support
@@ -30,7 +35,7 @@ MPV_SOCKET = "/tmp/mpv_socket"
30
35
  LOG_FILE = "/tmp/mytunes_mpv.log"
31
36
  PID_FILE = "/tmp/mytunes_mpv.pid"
32
37
  APP_NAME = "MyTunes Pro"
33
- APP_VERSION = "1.5.9"
38
+ APP_VERSION = "1.8.4"
34
39
 
35
40
  # === [Strings & Localization] ===
36
41
  STRINGS = {
@@ -240,10 +245,12 @@ class Player:
240
245
  # self.cleanup_orphaned_mpv() # Moved to play() per user request
241
246
 
242
247
  def cleanup_orphaned_mpv(self):
243
- # User requested revert to aggressive pkill for reliability
244
- # This ensures any previous background instances are killed
248
+ # Precise pkill to avoid matching the main TUI process
249
+ # Matches 'mpv ' (with space) or 'mpv' as exact process name
245
250
  try:
246
- subprocess.run(["pkill", "-f", "mpv"], stderr=subprocess.DEVNULL)
251
+ subprocess.run(["pkill", "-x", "mpv"], stderr=subprocess.DEVNULL)
252
+ # Second pass for variants or sub-arguments if needed
253
+ subprocess.run(["pkill", "-f", "mpv --video=no"], stderr=subprocess.DEVNULL)
247
254
  except: pass
248
255
 
249
256
  def play(self, url, start_pos=0):
@@ -326,7 +333,6 @@ class Player:
326
333
  try:
327
334
  self.current_proc.terminate()
328
335
  self.current_proc.wait(timeout=1)
329
- self.current_proc.wait(timeout=1)
330
336
  except:
331
337
  # If terminate fails, try socket quit
332
338
  try: self.send_cmd(["quit"])
@@ -738,36 +744,90 @@ class MyTunesApp:
738
744
  if self.is_remote():
739
745
  self.show_copy_dialog("YouTube", url)
740
746
  else:
741
- webbrowser.open(url)
747
+ # v1.8.4 - Use standard webbrowser library for maximum stability on F7
742
748
  self.status_msg = "🌐 Opening YouTube in Browser..."
749
+ threading.Thread(target=webbrowser.open, args=(url,), daemon=True).start()
743
750
 
744
751
  # Open Live Station: F8
745
752
  elif key == curses.KEY_F8:
746
- # Replace localhost with production URL if needed, or keep as project landing page
747
- live_url = "https://mytunes.postgresql.co.kr/live" # Production Live URL
748
-
753
+ live_url = "https://mytunes.postgresql.co.kr/live/"
749
754
  if self.is_remote():
750
755
  self.show_copy_dialog("Live Station", live_url)
751
- else:
752
- # Try to launch in "App Mode" (Popup) if on macOS with Chrome/Brave
753
- launched = False
754
- if sys.platform == 'darwin':
755
- browsers = [
756
- "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
757
- "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
758
- ]
759
- for b_path in browsers:
760
- if os.path.exists(b_path):
761
- try:
762
- subprocess.Popen([b_path, f"--app={live_url}", "--window-size=600,800"])
763
- self.status_msg = "📡 Opening Live Popup..."
764
- launched = True
765
- break
766
- except: pass
756
+ return
757
+
758
+ # App Mode Flags
759
+ flags = [
760
+ f"--app={live_url}",
761
+ "--window-size=712,800",
762
+ "--window-position=100,100",
763
+ "--new-window",
764
+ "--no-first-run",
765
+ "--disable-extensions"
766
+ ]
767
+
768
+ launched = False
769
+ # v1.8.4 - Subprocess Isolation (start_new_session) to prevent crashes on WSL/Linux
770
+ # 1. macOS
771
+ if sys.platform == 'darwin':
772
+ browsers = ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"]
773
+ for b_path in browsers:
774
+ if os.path.exists(b_path):
775
+ try:
776
+ subprocess.Popen(["open", "-na", b_path, "--args"] + flags, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
777
+ launched = True; break
778
+ except: pass
779
+
780
+ # 2. Windows Native
781
+ elif sys.platform == 'win32':
782
+ win_paths = [
783
+ os.path.join(os.environ.get('PROGRAMFILES', ''), 'Google\\Chrome\\Application\\chrome.exe'),
784
+ os.path.join(os.environ.get('PROGRAMFILES(X86)', ''), 'Google\\Chrome\\Application\\chrome.exe'),
785
+ os.path.join(os.environ.get('LOCALAPPDATA', ''), 'Google\\Chrome\\Application\\chrome.exe'),
786
+ ]
787
+ for p in win_paths:
788
+ if p and os.path.exists(p):
789
+ try:
790
+ subprocess.Popen([p] + flags, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
791
+ launched = True; break
792
+ except: pass
793
+
794
+ # 3. WSL / Linux (Direct path with session isolation)
795
+ elif self.is_wsl():
796
+ wsl_paths = [
797
+ "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe",
798
+ "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
799
+ "/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe",
800
+ ]
801
+ for p in wsl_paths:
802
+ if os.path.exists(p):
803
+ try:
804
+ # CRITICAL: start_new_session=True isolates the browser from the TUI process group
805
+ # This prevents the TUI from dying when navigating or if the browser has shell issues.
806
+ subprocess.Popen([p] + flags, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True)
807
+ launched = True; break
808
+ except: pass
767
809
 
768
810
  if not launched:
769
- webbrowser.open(live_url)
770
- self.status_msg = "📡 Opening Live Station..."
811
+ try:
812
+ # Fallback for WSL to CMD
813
+ subprocess.Popen(["cmd.exe", "/c", f"start chrome --app={live_url}"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True)
814
+ launched = True
815
+ except: pass
816
+
817
+ # 4. Native Linux
818
+ else:
819
+ for b in ['google-chrome', 'google-chrome-stable', 'brave-browser', 'chromium-browser', 'chromium']:
820
+ p = shutil.which(b)
821
+ if p:
822
+ try:
823
+ subprocess.Popen([p] + flags, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL); launched = True; break
824
+ except: pass
825
+
826
+ if launched:
827
+ self.status_msg = "📡 Opening Live Popup (712x800)..."
828
+ else:
829
+ webbrowser.open(live_url)
830
+ self.status_msg = "📡 Opening Live Station (Browser)..."
771
831
 
772
832
  def ask_resume(self, saved_time, track_title):
773
833
  self.stdscr.nodelay(False) # Blocking input for dialog
@@ -828,11 +888,16 @@ class MyTunesApp:
828
888
  return res
829
889
 
830
890
  def is_remote(self):
831
- """Check if running in a remote SSH session (excluding WSL)."""
832
- # WSL is technically "local" enough to open browsers
833
- if 'WSL_DISTRO_NAME' in os.environ or 'WSL_INTEROP' in os.environ:
891
+ return 'SSH_CONNECTION' in os.environ or 'SSH_CLIENT' in os.environ
892
+
893
+ def is_wsl(self):
894
+ try:
895
+ if sys.platform != 'linux': return False
896
+ if os.path.exists('/proc/version'):
897
+ with open('/proc/version', 'r') as f:
898
+ return 'microsoft' in f.read().lower()
834
899
  return False
835
- return os.environ.get('SSH_CLIENT') or os.environ.get('SSH_TTY')
900
+ except: return False
836
901
 
837
902
  def show_copy_dialog(self, title, url):
838
903
  """Show a dialog with the URL for manual copying in remote sessions."""
@@ -1351,11 +1416,20 @@ class MyTunesApp:
1351
1416
 
1352
1417
  def run(self):
1353
1418
  while self.running:
1354
- self.loop_count = (self.loop_count + 1) % 1000
1355
- self.update_playback_state()
1356
- self.check_autoplay()
1357
- self.draw()
1358
- self.handle_input()
1419
+ try:
1420
+ self.loop_count = (self.loop_count + 1) % 1000
1421
+ self.update_playback_state()
1422
+ self.check_autoplay()
1423
+ self.draw()
1424
+ self.handle_input()
1425
+ except Exception as e:
1426
+ # v1.8.4 - Global resilience: Catch and log loop errors instead of crashing
1427
+ try:
1428
+ with open("/tmp/mytunes_error.log", "a") as f:
1429
+ f.write(f"[{time.ctime()}] Loop Error: {str(e)}\n")
1430
+ except: pass
1431
+ # Small sleep to prevent infinite tight loop on persistent error
1432
+ time.sleep(0.1)
1359
1433
 
1360
1434
  if self.stop_on_exit:
1361
1435
  self.player.stop()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mytunes-pro
3
- Version: 1.5.9
3
+ Version: 1.8.4
4
4
  Summary: A lightweight, keyboard-centric terminal player for streaming YouTube music.
5
5
  Author-email: loxo <loxo5432@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/postgresql-co-kr/mytunes
@@ -19,7 +19,7 @@ Dynamic: license-file
19
19
 
20
20
  # 🎵 MyTunes Pro (Korean)
21
21
 
22
- **현대적인 CLI 유튜브 뮤직 플레이어 (v1.5.6)**
22
+ **현대적인 CLI 유튜브 뮤직 플레이어 (v1.8.4)**
23
23
  터미널 환경에서 **YouTube 음악을 검색하여 듣는** 가볍고 빠른 키보드 중심의 플레이어입니다.
24
24
  한국어 입력 환경에서도 **숫자 키(1~5)**를 통해 지연 없는 쾌적한 조작이 가능합니다.
25
25
 
@@ -208,7 +208,7 @@ Windows 환경에서 한글 검색이 안 되거나 설치가 어려운 분들
208
208
 
209
209
  # 🎵 MyTunes Pro (English)
210
210
 
211
- **Modern CLI YouTube Music Player (v1.5.6)**
211
+ **Modern CLI YouTube Music Player (v1.8.4)**
212
212
  A lightweight, keyboard-centric terminal player for streaming YouTube music.
213
213
 
214
214
  ---
@@ -296,6 +296,88 @@ sudo apt install mpv python3 python3-pip pipx python3-venv -y
296
296
 
297
297
  ## 🔄 Changelog
298
298
 
299
+ ### v1.8.4 (Latest)
300
+
301
+ - **Python Crash Fix (WSL)**: Eliminated premature termination by implementing `start_new_session=True` for browser launches, isolating them from the TUI process group.
302
+ - **Hybrid Browser Strategy**: Switched to the standard `webbrowser` library for F7 (YouTube links) for maximum internal stability.
303
+ - **Global Error Protection**: Wrapped the main application loop in an exception guard to catch and log transient OS errors without crashing the entire app.
304
+ - **Refined Process Cleanup**: Specialized the `pkill` logic to prevent accidental self-termination while maintaining reliable MPV management.
305
+
306
+ ### v1.8.3
307
+
308
+ - **Direct Binary Execution (WSL)**: Resolved shell parsing issues by bypassing `cmd.exe` and directly executing Windows browser binaries via `/mnt/c/` paths.
309
+ - **App Mode Reliability**: Guaranteed 712x800 popup mode by ensuring flags are delivered directly to the browser process without intermediate shell mangling.
310
+ - **Fixed URL Resolution**: Eliminated the "Empty URL" bug by standardizing argument passing between WSL and Windows.
311
+
312
+ ### v1.8.1
313
+
314
+ - **Fixed App Mode (WSL/Win)**: Guaranteed the browser opens in a clean "App Mode" popup by fixing shell quoting issues in the launch command.
315
+ - **URL Resolution Fix**: Resolved the "Empty URL" bug on WSL/Windows by ensuring the `--app` flag is correctly parsed by the native Windows shell.
316
+ - **Reliable Popup UI**: Standardized on `start "" chrome` for WSL to ensure flags are never misidentified as window titles.
317
+
318
+ ### v1.8.0
319
+
320
+ - **Stabilized Browser Launch (Windows/WSL)**: Completely removed the `--user-data-dir` flag for all Windows-based environments. This permanently resolves the "cannot read or write" directory errors while maintaining reliable 712x800 window sizing through pure app-mode flags.
321
+ - **Clean CMD Execution**: Simplified the WSL-to-Windows transition by using standard `cmd.exe` calls without complex path or variable expansion, ensuring consistent behavior across all systems.
322
+
323
+ ### v1.7.9
324
+
325
+ - **Pure CMD-based Launch (WSL/Win)**: Final fix for WSL-to-Windows browser launch using `cmd.exe /c` with native `%LOCALAPPDATA%` expansion.
326
+ - **Directory Reliability**: Ensured Chrome data directory creation and access by using native Windows shell commands, eliminating the "cannot read or write" errors seen in v1.7.8.
327
+ - **Stable Window Sizing**: Guaranteed 712x800 window size for Live Station (F8) from WSL by correctly isolating browser profiles via native Windows paths.
328
+
329
+ ### v1.7.8
330
+
331
+ - **Native PowerShell Profile Management**: Resolved directory read/write errors in WSL by moving all profile creation and path handling to the Windows side via PowerShell.
332
+ - **Improved Security & Isolation**: Profiles are now created in the standard Windows `LOCALAPPDATA` directory with native permissions, ensuring Chrome can always access its data.
333
+ - **Backslash Consistency**: Forced backslash-only paths through pure PowerShell logic, fixing the mixed-slash issue seen in WSL.
334
+
335
+ ### v1.7.7
336
+
337
+ - **PowerShell Launch (WSL/Win)**: Switched to `powershell.exe` for launching browsers from WSL to ensure robust argument parsing and path handling.
338
+ - **Directory Fix**: Resolved "cannot read or write" error on Windows/WSL by utilizing `$env:TEMP` directly within a native shell context.
339
+ - **Reliable Sizing**: Guaranteed window size application by combining isolated profiles with PowerShell's superior process management.
340
+
341
+ ### v1.7.6
342
+
343
+ - **Isolated Browser Profile**: Guaranteed window sizing for the Live Station (F8) on Windows/WSL by forcing an isolated browser profile using the Windows `%TEMP%` directory.
344
+ - **WSL Path Translation**: Implemented automatic Windows temp path resolution in WSL to enable session persistence and profile isolation.
345
+
346
+ ### v1.7.5
347
+
348
+ - **WSL Integration**: Fully optimized browser launch from WSL by utilizing `cmd.exe` to trigger native Windows browsers.
349
+ - **F7 Windows Resolve**: Fixed an issue where YouTube (F7) wouldn't open in WSL environments.
350
+ - **F8 App Mode (WSL/Win)**: Enhanced flags to ensure "App Mode" (no address bar) works consistently even when launched from WSL.
351
+
352
+ ### v1.7.4
353
+
354
+ - **Windows UI Refinement**: Forced Chrome "App Mode" on Windows by reordering flags and disabling extensions/default-apps to ensure a clean popup without an address bar.
355
+ - **Improved Isolation**: Switched to higher-frequency session rotation for Live Station (F8) to guarantee window size and position persistence fixes.
356
+
357
+ ### v1.7.3
358
+
359
+ - **Windows Fixes**: Resolved issue where F7 (YouTube) failed to open browsers on Windows by implementing `os.startfile` logic.
360
+ - **F8 Initialization**: Improved Live Station (F8) window sizing on Windows by forcing a clean session state.
361
+ - **Robustness**: Enhanced cross-platform browser redirection logic to ensure consistent behavior.
362
+
363
+ ### v1.7.2
364
+
365
+ - **Windows Optimization**: Fixed an issue where the Live Station (F8) window size was not correctly applied on Windows.
366
+ - **Improved Browser Support**: Added Microsoft Edge to the automatic browser detection list.
367
+ - **Robust Launch Logic**: Enhanced browser internal flags for a better initial window experience.
368
+
369
+ ### v1.7.1
370
+
371
+ - **Performance & Logic Optimization**: Standardized browser launch logic for Live Station (F8) across Mac, Windows, and Linux.
372
+ - **UI Polish**: Silenced browser launch warnings in the terminal and added professional UI flags (disable translation/bubble) for a cleaner experience.
373
+ - **Improved Popup Behavior**: Optimized web interface to reuse the same window for Live Station, matching CLI application behavior.
374
+ - **Global Sync**: Version 1.7.1 synchronization across all platforms.
375
+
376
+ ### v1.6.0
377
+
378
+ - **Global Version Synchronization**: Synchronized version 1.6.0 across CLI, README, and Web interface.
379
+ - **Dependency Fix**: Ensured `pusher` dependency is correctly included for real-time features.
380
+
299
381
  ### v1.5.6
300
382
 
301
383
  - **Refined Search History Display**: Improved the search preview logic to use a temporary 'search' view state, providing a smoother experience when opening and canceling search.
File without changes
File without changes