Skip to content

Commit f4686dc

Browse files
author
A S Lewis
committed
Add re-check video #661, YouTube warning #662, matplotlib failure check #663
1 parent ff76b75 commit f4686dc

File tree

13 files changed

+205
-46
lines changed

13 files changed

+205
-46
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Problems can be reported at `our GitHub page <https://github.com/axcore/tartube/
4646

4747
Stable release: **v2.5.040 (31 Aug 2024)**
4848

49-
Development release: **v2.5.047 (21 Oct 2024)**
49+
Development release: **v2.5.053 (28 Oct 2024)**
5050

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

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.047
1+
2.5.053

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.047 installer script for MS Windows
1+
# Tartube v2.5.053 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.047-64bit.exe"
297+
OutFile "install-tartube-2.5.053-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.047"
400+
# "DisplayVersion" "2.5.053"
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.047'
48-
__date__ = '21 Oct 2024'
47+
__version__ = '2.5.053'
48+
__date__ = '28 Oct 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.047'
48-
__date__ = '21 Oct 2024'
47+
__version__ = '2.5.053'
48+
__date__ = '28 Oct 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.047'
48-
__date__ = '21 Oct 2024'
47+
__version__ = '2.5.053'
48+
__date__ = '28 Oct 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 "21 Oct 2024" "2.5.047" "tartube man page"
1+
.TH man 1 "28 Oct 2024" "2.5.053" "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.047',
167+
version = '2.5.053',
168168
description = 'GUI front-end for youtube-dl and yt-dlp',
169169
long_description = long_description,
170170
long_description_content_type = 'text/plain',

tartube/config.py

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@
5252

5353

5454
# Import matplotlib stuff
55+
# try..except works around matplotlib problems described in Git #592, #66
5556
if mainapp.HAVE_MATPLOTLIB_FLAG:
56-
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg
57-
from matplotlib.figure import Figure
58-
from matplotlib.ticker import MaxNLocator
57+
try:
58+
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg
59+
from matplotlib.figure import Figure
60+
from matplotlib.ticker import MaxNLocator
61+
except:
62+
mainapp.HAVE_MATPLOTLIB_FLAG = False
5963

6064
# Classes
6165

@@ -684,6 +688,83 @@ def add_combos_for_graphs(self, grid, row):
684688
return combo, combo2, combo3, combo4, combo5
685689

686690

691+
def add_youtube_warning(self, grid, x, y, wid, hei):
692+
693+
"""Can be called by any config window tab, especially those that
694+
provide a way to pass user credentials to the website (such as
695+
--username/--password, imported browser cookies, .netrc files etc).
696+
697+
As of October 2024, some methods will not work, and some may even
698+
cause the deletion of a YouTube account. The user should consult the
699+
latest yt-dlp warnings about this issue, before downloading restricted
700+
videos:
701+
702+
https://github.com/yt-dlp/yt-dlp/issues/3766
703+
Return values:
704+
705+
Args:
706+
707+
grid (Gtk.Grid): The grid on which widgets are arranged in their
708+
tab
709+
710+
x, y, wid, hei (int): Position on the grid at which the warning is
711+
placed
712+
713+
Return values:
714+
715+
The new Gtk.Grid on which the warning is placed
716+
717+
"""
718+
719+
# (To avoid messing up the neat format of the rows above, add a
720+
# secondary grid, and put the next set of widgets inside it)
721+
grid2 = self.add_secondary_grid(grid, x, y, wid, hei)
722+
723+
frame = self.add_pixbuf(grid2,
724+
'attention_large',
725+
0, 0, 1, 1,
726+
)
727+
frame.set_hexpand(False)
728+
frame.set_border_width(self.spacing_size)
729+
frame.set_size_request(75, -1)
730+
731+
frame2 = Gtk.Frame()
732+
grid2.attach(frame2, 1, 0, 1, 1)
733+
734+
grid3 = Gtk.Grid()
735+
frame2.add(grid3)
736+
grid3.set_border_width(self.spacing_size * 2)
737+
grid3.set_column_spacing(self.spacing_size * 2)
738+
grid3.set_row_spacing(self.spacing_size)
739+
740+
label = Gtk.Label()
741+
grid3.attach(label, 0, 0, 1, 1)
742+
label.set_markup(
743+
_(
744+
'WARNING! YouTube is trying to block applications like' \
745+
+ ' Tartube!',
746+
),
747+
)
748+
label.set_hexpand(True)
749+
label.set_alignment(0, 0.5)
750+
751+
label2 = Gtk.Label()
752+
grid3.attach(label2, 0, 1, 1, 1)
753+
label2.set_markup(
754+
'<a href="' \
755+
+ html.escape('https://github.com/yt-dlp/yt-dlp/issues/3766') \
756+
+ '" title="' \
757+
+ _('yt-dlp Known Issues FAQ') \
758+
+ '">' \
759+
+ _('Before trying to download restricted videos, read the FAQ!') \
760+
+ '</a>',
761+
)
762+
label2.set_hexpand(True)
763+
label2.set_alignment(0, 0.5)
764+
765+
return grid2
766+
767+
687768
def get_options_applied_text(self, options_obj):
688769

689770
""" Called by OptionsEditWin.setup_name_tab() and
@@ -901,6 +982,7 @@ def ytdlp_only(self):
901982
The formatted string 'yt-dlp only'
902983

903984
"""
985+
904986
return ' <b>[' + _('yt-dlp only') + ']</b>'
905987

906988

@@ -7951,6 +8033,8 @@ def setup_advanced_authentication_tab(self, inner_notebook):
79518033
)
79528034
self.add_tooltip('--ap-password PASSWORD', label7, entry7)
79538035

8036+
self.add_youtube_warning(grid, 0, 8, 2, 1)
8037+
79548038

79558039
def setup_advanced_netrc_tab(self, inner_notebook):
79568040

@@ -8031,6 +8115,8 @@ def setup_advanced_netrc_tab(self, inner_notebook):
80318115
textbuffer.set_text(str.join('', line_list))
80328116
entry.set_text(netrc_path)
80338117

8118+
self.add_youtube_warning(grid, 0, 4, grid_width, 1)
8119+
80348120
# (Signal connect from above)
80358121
button.connect(
80368122
'clicked',

tartube/downloads.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,8 @@ def create_item(self, media_data_obj, scheduled_obj=None,
26482648
and media_data_obj.priv_flag:
26492649
return empty_list
26502650

2651-
# Don't download videos that we already have
2651+
# Don't download videos that we already have (but do check a video
2652+
# that's already been downloaded)
26522653
# Don't download videos if they're in a channel or playlist (since
26532654
# downloading the channel/playlist downloads the videos it contains)
26542655
# (Exception: download a single video if that's what the calling code
@@ -2666,6 +2667,7 @@ def create_item(self, media_data_obj, scheduled_obj=None,
26662667
if isinstance(media_data_obj, media.Video):
26672668

26682669
if media_data_obj.dl_flag \
2670+
and operation_type != 'sim' \
26692671
and not media_data_obj.dbid \
26702672
in self.app_obj.temp_stamp_buffer_dict \
26712673
and not media_data_obj.dbid in self.app_obj.temp_slice_buffer_dict:
@@ -4693,8 +4695,12 @@ def confirm_sim_video(self, json_dict):
46934695
if video_obj in self.missing_video_check_list:
46944696
self.missing_video_check_list.remove(video_obj)
46954697

4698+
# A media.Video object that already exists is not displayed in the
4699+
# Results list (unless it's a downloaded video that is being
4700+
# re-checked)
46964701
if video_obj.file_name \
4697-
and video_obj.name != app_obj.default_video_name:
4702+
and video_obj.name != app_obj.default_video_name \
4703+
and not video_obj.dl_flag:
46984704

46994705
# This video must not be displayed in the Results List, and
47004706
# counts towards the limit (if any) specified by

0 commit comments

Comments
 (0)