Skip to content

Commit b00868a

Browse files
author
A S Lewis
committed
Fix yt-dlp install issues on MSWin
1 parent b0bb4ec commit b00868a

File tree

10 files changed

+69
-84
lines changed

10 files changed

+69
-84
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ Problems can be reported at `our GitHub page <https://github.com/axcore/tartube/
4444
3 Downloads
4545
===========
4646

47-
Stable release: **v2.5.059 (26 Nov 2024)**
47+
Stable release: **v2.5.062** (5 Dec 2024 on MS Windows), **v2.5.059** (26 Nov 2024 on all other systems)
4848

49-
Development release: **v2.5.059 (26 Nov 2024)**
49+
Development release: **v2.5.062 (5 Dec 2024)**
5050

5151
Official packages (also available from the `Github release page <https://github.com/axcore/tartube/releases>`__):
5252

53-
- `MS Windows (64-bit) installer <https://sourceforge.net/projects/tartube/files/v2.5.059/install-tartube-2.5.059-64bit.exe/download>`__, `MS Windows (64-bit) and FFmpeg installer <https://sourceforge.net/projects/tartube/files/v2.5.059/install-tartube-with-ffmpeg-2.5.059-64bit.exe/download>`__ and `portable edition <https://sourceforge.net/projects/tartube/files/v2.5.059/tartube-2.5.059-64bit-portable.zip/download>`__ from Sourceforge
53+
- `MS Windows (64-bit) installer <https://sourceforge.net/projects/tartube/files/v2.5.062/install-tartube-2.5.062-64bit.exe/download>`__, `MS Windows (64-bit) and FFmpeg installer <https://sourceforge.net/projects/tartube/files/v2.5.062/install-tartube-with-ffmpeg-2.5.062-64bit.exe/download>`__ and `portable edition <https://sourceforge.net/projects/tartube/files/v2.5.062/tartube-2.5.062-64bit-portable.zip/download>`__ from Sourceforge
5454
- Tartube is no longer supported on older versions of MS Windows - see `7.24 Doesn't work on 32-bit Windows / Windows 7 / Windows 8`_
5555
- `DEB package (for Debian-based distros, e.g. Ubuntu, Linux Mint) <https://sourceforge.net/projects/tartube/files/v2.5.059/python3-tartube_2.5.059.deb/download>`__ from Sourceforge
5656
- `RPM package (for RHEL-based distros, e.g. Fedora) <https://sourceforge.net/projects/tartube/files/v2.5.059/tartube-2.5.059.rpm/download>`__ from Sourceforge

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.059
1+
2.5.062

nsis/tartube_install_64bit.nsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Tartube v2.5.059 installer script for MS Windows
1+
# Tartube v2.5.062 installer script for MS Windows
22
#
33
# Copyright (C) 2019-2024 A S Lewis
44
#
@@ -294,7 +294,7 @@
294294

295295
;Name and file
296296
Name "Tartube"
297-
OutFile "install-tartube-2.5.059-64bit.exe"
297+
OutFile "install-tartube-2.5.062-64bit.exe"
298298

299299
;Default installation folder
300300
InstallDir "$LOCALAPPDATA\Tartube"
@@ -397,7 +397,7 @@ Section "Tartube" SecClient
397397
# "Publisher" "A S Lewis"
398398
# WriteRegStr HKLM \
399399
# "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tartube" \
400-
# "DisplayVersion" "2.5.059"
400+
# "DisplayVersion" "2.5.062"
401401

402402
# Create uninstaller
403403
WriteUninstaller "$INSTDIR\Uninstall.exe"

pack/bin/no_download/tartube

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import mainapp
4444

4545
# 'Global' variables
4646
__packagename__ = 'tartube'
47-
__version__ = '2.5.059'
48-
__date__ = '26 Nov 2024'
47+
__version__ = '2.5.062'
48+
__date__ = '5 Dec 2024'
4949
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
5050
__license__ = """
5151
Copyright \xa9 2019-2024 A S Lewis.

pack/bin/pkg/tartube

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import mainapp
4444

4545
# 'Global' variables
4646
__packagename__ = 'tartube'
47-
__version__ = '2.5.059'
48-
__date__ = '26 Nov 2024'
47+
__version__ = '2.5.062'
48+
__date__ = '5 Dec 2024'
4949
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
5050
__license__ = """
5151
Copyright \xa9 2019-2024 A S Lewis.

pack/bin/strict/tartube

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import mainapp
4444

4545
# 'Global' variables
4646
__packagename__ = 'tartube'
47-
__version__ = '2.5.059'
48-
__date__ = '26 Nov 2024'
47+
__version__ = '2.5.062'
48+
__date__ = '5 Dec 2024'
4949
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
5050
__license__ = """
5151
Copyright \xa9 2019-2024 A S Lewis.

pack/tartube.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH man 1 "26 Nov 2024" "2.5.059" "tartube man page"
1+
.TH man 1 "5 Dec 2024" "2.5.062" "tartube man page"
22
.SH NAME
33
tartube \- GUI front-end for youtube-dl and yt-dlp
44
.SH SYNOPSIS

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
# Setup
165165
setuptools.setup(
166166
name = 'tartube',
167-
version = '2.5.059',
167+
version = '2.5.062',
168168
description = 'GUI front-end for youtube-dl and yt-dlp',
169169
long_description = long_description,
170170
long_description_content_type = 'text/plain',

tartube/tartube

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import mainapp
4444

4545
# 'Global' variables
4646
__packagename__ = 'tartube'
47-
__version__ = '2.5.059'
48-
__date__ = '26 Nov 2024'
47+
__version__ = '2.5.062'
48+
__date__ = '5 Dec 2024'
4949
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
5050
__license__ = """
5151
Copyright \xa9 2019-2024 A S Lewis.

tartube/updates.py

Lines changed: 52 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -611,87 +611,82 @@ def install_ytdl(self):
611611
# Rather than trying to distinguish the portable and non-portable
612612
# versions, just do this for all MS Windows users with default
613613
# settings
614-
uninstall_fail_flag = False
615614
if os.name == 'nt' and self.wiz_win_obj is None and (
616615
ytdl_update_current == 'ytdl_update_win_64' \
617616
or ytdl_update_current == 'ytdl_update_win_64_no_dependencies' \
618617
or ytdl_update_current == 'ytdl_update_win_32' \
619618
or ytdl_update_current == 'ytdl_update_win_32_no_dependencies'
620619
):
621-
if not self.uninstall_ytdl(downloader, ytdl_update_current):
622-
uninstall_fail_flag = True
620+
self.uninstall_ytdl(downloader, ytdl_update_current)
623621

624-
if not uninstall_fail_flag:
625-
626-
# Prepare a system command...
627-
if os.name == 'nt' \
628-
and ytdl_update_current == 'ytdl_update_custom_path' \
629-
and re.search(r'\.exe$', self.app_obj.ytdl_path):
630-
# Special case: on MS Windows, a custom path may point at an
631-
# .exe, therefore 'python3' must be removed from the system
632-
# command (we can't run 'python3.exe youtube-dl.exe' or
633-
# anything like that)
634-
cmd_list = [self.app_obj.ytdl_path, '-U']
622+
# Prepare a system command...
623+
if os.name == 'nt' \
624+
and ytdl_update_current == 'ytdl_update_custom_path' \
625+
and re.search(r'\.exe$', self.app_obj.ytdl_path):
626+
# Special case: on MS Windows, a custom path may point at an .exe,
627+
# therefore 'python3' must be removed from the system command (we
628+
# can't run 'python3.exe youtube-dl.exe' or anything like that)
629+
cmd_list = [self.app_obj.ytdl_path, '-U']
635630

636-
else:
637-
cmd_list = self.app_obj.ytdl_update_dict[ytdl_update_current]
631+
else:
632+
cmd_list = self.app_obj.ytdl_update_dict[ytdl_update_current]
638633

639-
mod_list = []
640-
for arg in cmd_list:
634+
mod_list = []
635+
for arg in cmd_list:
641636

642-
# Substitute in the fork, if one is specified
643-
arg = self.app_obj.check_downloader(arg, self.wiz_win_obj)
644-
# Convert a path beginning with ~ (not on MS Windows)
645-
if os.name != 'nt':
646-
arg = re.sub(r'^\~', os.path.expanduser('~'), arg)
637+
# Substitute in the fork, if one is specified
638+
arg = self.app_obj.check_downloader(arg, self.wiz_win_obj)
639+
# Convert a path beginning with ~ (not on MS Windows)
640+
if os.name != 'nt':
641+
arg = re.sub(r'^\~', os.path.expanduser('~'), arg)
647642

648-
mod_list.append(arg)
643+
mod_list.append(arg)
649644

650-
# ...and display it in the Output tab (if required)
651-
self.install_ytdl_write_output(
652-
' '.join(mod_list),
653-
True, # A system command, not a message
654-
)
645+
# ...and display it in the Output tab (if required)
646+
self.install_ytdl_write_output(
647+
' '.join(mod_list),
648+
True, # A system command, not a message
649+
)
655650

656-
# Create a new child process using that command...
657-
self.create_child_process(mod_list)
658-
# ...and set up the PipeReader objects to read from the child
659-
# process STDOUT and STDERR
660-
if self.child_process is not None:
661-
self.stdout_reader.attach_fh(self.child_process.stdout)
662-
self.stderr_reader.attach_fh(self.child_process.stderr)
651+
# Create a new child process using that command...
652+
self.create_child_process(mod_list)
653+
# ...and set up the PipeReader objects to read from the child process
654+
# STDOUT and STDERR
655+
if self.child_process is not None:
656+
self.stdout_reader.attach_fh(self.child_process.stdout)
657+
self.stderr_reader.attach_fh(self.child_process.stderr)
663658

664-
while self.is_child_process_alive():
659+
while self.is_child_process_alive():
665660

666-
# Pause a moment between each iteration of the loop (we don't
667-
# want to hog system resources)
668-
time.sleep(self.sleep_time)
661+
# Pause a moment between each iteration of the loop (we don't want
662+
# to hog system resources)
663+
time.sleep(self.sleep_time)
669664

670-
# Read from the child process STDOUT and STDERR, in the correct
671-
# order, until there is nothing left to read
672-
while self.read_ytdl_child_process(downloader):
673-
pass
665+
# Read from the child process STDOUT and STDERR, in the correct
666+
# order, until there is nothing left to read
667+
while self.read_ytdl_child_process(downloader):
668+
pass
674669

675-
# (Generate our own error messages for debugging purposes, in
676-
# certain situations)
677-
if self.child_process is None:
670+
# (Generate our own error messages for debugging purposes, in certain
671+
# situations)
672+
if self.child_process is None:
678673

679-
msg = _('Update did not start')
674+
msg = _('Update did not start')
680675

681-
self.stderr_list.append(msg)
682-
self.install_ytdl_write_output(msg)
676+
self.stderr_list.append(msg)
677+
self.install_ytdl_write_output(msg)
683678

684-
elif self.child_process.returncode > 0:
679+
elif self.child_process.returncode > 0:
685680

686-
msg = _('Child process exited with non-zero code: {}').format(
687-
self.child_process.returncode,
688-
)
681+
msg = _('Child process exited with non-zero code: {}').format(
682+
self.child_process.returncode,
683+
)
689684

690-
self.stderr_list.append(msg)
691-
self.install_ytdl_write_output(msg)
685+
self.stderr_list.append(msg)
686+
self.install_ytdl_write_output(msg)
692687

693688
# Operation complete. self.success_flag is checked by
694-
# mainapp.TartubeApp.update_manager_finished
689+
# mainapp.TartubeApp.update_manager_finished()
695690
if not self.stderr_list:
696691
self.success_flag = True
697692

@@ -722,10 +717,6 @@ def uninstall_ytdl(self, downloader, ytdl_update_current):
722717
mainapp.TartubeApp.ytdl_update_current, or an overriding
723718
value chosen by the calling function
724719
725-
Return values:
726-
727-
True on success, False on failure
728-
729720
"""
730721

731722
# Prepare a system command...
@@ -782,12 +773,6 @@ def uninstall_ytdl(self, downloader, ytdl_update_current):
782773
self.stderr_list.append(msg)
783774
self.install_ytdl_write_output(msg)
784775

785-
# Uninstall complete
786-
if self.stderr_list:
787-
return False
788-
else:
789-
return True
790-
791776

792777
def install_ytdl_write_output(self, msg, system_cmd_flag=False):
793778

0 commit comments

Comments
 (0)