Skip to content

Commit

Permalink
Fix video re-download and broken filter button
Browse files Browse the repository at this point in the history
  • Loading branch information
A S Lewis committed Jan 23, 2024
1 parent 43d074b commit 9f8863a
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Problems can be reported at `our GitHub page <https://github.com/axcore/tartube/

Stable release: **v2.5.0 (3 Jan 2024)**

Development release: **v2.5.003 (8 Jan 2024)**
Development release: **v2.5.007 (10 Jan 2024)**

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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.003
2.5.007
6 changes: 3 additions & 3 deletions nsis/tartube_install_64bit.nsi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tartube v2.5.003 installer script for MS Windows
# Tartube v2.5.007 installer script for MS Windows
#
# Copyright (C) 2019-2024 A S Lewis
#
Expand Down Expand Up @@ -294,7 +294,7 @@

;Name and file
Name "Tartube"
OutFile "install-tartube-2.5.003-64bit.exe"
OutFile "install-tartube-2.5.007-64bit.exe"

;Default installation folder
InstallDir "$LOCALAPPDATA\Tartube"
Expand Down Expand Up @@ -397,7 +397,7 @@ Section "Tartube" SecClient
# "Publisher" "A S Lewis"
# WriteRegStr HKLM \
# "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tartube" \
# "DisplayVersion" "2.5.003"
# "DisplayVersion" "2.5.007"

# Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
Expand Down
4 changes: 2 additions & 2 deletions pack/bin/no_download/tartube
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import mainapp

# 'Global' variables
__packagename__ = 'tartube'
__version__ = '2.5.003'
__date__ = '8 Jan 2024'
__version__ = '2.5.007'
__date__ = '23 Jan 2024'
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
__license__ = """
Copyright \xa9 2019-2024 A S Lewis.
Expand Down
4 changes: 2 additions & 2 deletions pack/bin/pkg/tartube
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import mainapp

# 'Global' variables
__packagename__ = 'tartube'
__version__ = '2.5.003'
__date__ = '8 Jan 2024'
__version__ = '2.5.007'
__date__ = '23 Jan 2024'
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
__license__ = """
Copyright \xa9 2019-2024 A S Lewis.
Expand Down
4 changes: 2 additions & 2 deletions pack/bin/strict/tartube
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import mainapp

# 'Global' variables
__packagename__ = 'tartube'
__version__ = '2.5.003'
__date__ = '8 Jan 2024'
__version__ = '2.5.007'
__date__ = '23 Jan 2024'
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
__license__ = """
Copyright \xa9 2019-2024 A S Lewis.
Expand Down
2 changes: 1 addition & 1 deletion pack/tartube.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH man 1 "8 Jan 2024" "2.5.003" "tartube man page"
.TH man 1 "23 Jan 2024" "2.5.007" "tartube man page"
.SH NAME
tartube \- GUI front-end for youtube-dl and yt-dlp
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
# Setup
setuptools.setup(
name = 'tartube',
version = '2.5.003',
version = '2.5.007',
description = 'GUI front-end for youtube-dl and yt-dlp',
long_description = long_description,
long_description_content_type = 'text/plain',
Expand Down
21 changes: 21 additions & 0 deletions tartube/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26656,6 +26656,7 @@ def setup_downloader_forks_tab(self, inner_notebook):
True, # Can be toggled by user
0, 4, 1, 1,
)
checkbutton2.connect('toggled', self.on_filter_options_button_toggled)


def setup_downloader_paths_tab(self, inner_notebook):
Expand Down Expand Up @@ -31607,6 +31608,26 @@ def on_ffmpeg_use_button_clicked(self, button, treeview):
self.setup_options_ffmpeg_list_tab_update_treeview()


def on_filter_options_button_toggled(self, checkbutton):

"""Called from callback in self.setup_downloader_forks_tab().

Sets the flag to filter out yt-dlp options, when using a fork.

Args:

checkbutton (Gtk.Checkbutton): The widget clicked

"""

if checkbutton.get_active() \
and not self.app_obj.ytdlp_filter_options_flag:
self.app_obj.set_ytdlp_filter_options_flag(True)
elif not checkbutton.get_active() \
and self.app_obj.ytdlp_filter_options_flag:
self.app_obj.set_ytdlp_filter_options_flag(False)


def on_hide_button_toggled(self, checkbutton):

"""Called from callback in self.setup_windows_main_window_tab().
Expand Down
27 changes: 26 additions & 1 deletion tartube/mainapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,11 @@ def __init__(self, *args, **kwargs):
# downloading from the Classic Mode tab (this is marked 'not
# recommended' in the edit window)
self.classic_ytdl_archive_flag = False
# Flag set to True when re-downloading video(s), so that the archive
# file is not used at all (otherwise, the re-download will fail)
# Applies only to the Videos tab; the Classic Mode tab has a button
# near the bottom, which the user can use to ignore the archive file
self.block_ytdl_archive_flag = False

# Flag set to True if, when checking videos/channels/playlists, we
# should apply a timeout (in case youtube-dl gets stuck downloading
Expand Down Expand Up @@ -8283,7 +8288,7 @@ def update_db(self, version):
natname = re.sub(r'^[\s]+', ' ', natname)

media_data_obj.natname = natname

# --- Do this last, or the call to .check_integrity_db() fails -------
# --------------------------------------------------------------------

Expand Down Expand Up @@ -11961,6 +11966,10 @@ def download_manager_finished(self):
if self.main_win_obj.is_visible():
self.main_win_obj.show_all()

# If the youtube-dl archive file(s) were temporarily blocked for a
# video re-download, re-enable them
self.block_ytdl_archive_flag = True

# If Tartube is due to shut down, then shut it down
show_newbie_dialogue_flag = False

Expand Down Expand Up @@ -27191,6 +27200,14 @@ def set_block_livestreams_flag(self, flag):
self.block_livestreams_flag = True


def set_block_ytdl_archive_flag(self, flag):

if not flag:
self.block_ytdl_archive_flag = False
else:
self.block_ytdl_archive_flag = True


def set_catalogue_draw_blocked_flag(self, flag):

if not flag:
Expand Down Expand Up @@ -29248,3 +29265,11 @@ def set_ytdl_write_verbose_flag(self, flag):
self.ytdl_write_verbose_flag = False
else:
self.ytdl_write_verbose_flag = True


def set_ytdlp_filter_options_flag(self, flag):

if not flag:
self.ytdlp_filter_options_flag = False
else:
self.ytdlp_filter_options_flag = True
7 changes: 7 additions & 0 deletions tartube/mainwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20114,6 +20114,13 @@ def on_video_catalogue_re_download(self, menu_item, media_data_obj):
# as downloaded
self.app_obj.mark_video_downloaded(media_data_obj, False)

# If mainapp.TartubeApp.allow_ytdl_archive_flag is set, youtube-dl will
# have created a ytdl_archive.txt, recording every video ever
# downloaded in the parent directory. This will prevent a successful
# re-downloading of the video
# Temporarily block usage of the archive file
self.app_obj.set_block_ytdl_archive_flag(True)

# Now we're ready to start the download operation
self.app_obj.download_manager_start('real', False, [media_data_obj] )

Expand Down
4 changes: 2 additions & 2 deletions tartube/tartube
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import mainapp

# 'Global' variables
__packagename__ = 'tartube'
__version__ = '2.5.003'
__date__ = '8 Jan 2024'
__version__ = '2.5.007'
__date__ = '23 Jan 2024'
__copyright__ = 'Copyright \xa9 2019-2024 A S Lewis'
__license__ = """
Copyright \xa9 2019-2024 A S Lewis.
Expand Down
7 changes: 5 additions & 2 deletions tartube/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2705,8 +2705,11 @@ def generate_ytdl_system_cmd(app_obj, media_data_obj, options_list,
# We don't use an archive file when downloading into a system folder,
# unless a non-default location for the file has been specified
if (
(not dl_classic_flag and app_obj.allow_ytdl_archive_flag) \
or (dl_classic_flag and app_obj.classic_ytdl_archive_flag)
not app_obj.block_ytdl_archive_flag \
and (
(not dl_classic_flag and app_obj.allow_ytdl_archive_flag) \
or (dl_classic_flag and app_obj.classic_ytdl_archive_flag)
)
):
if not dl_classic_flag \
and (
Expand Down

0 comments on commit 9f8863a

Please sign in to comment.