axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
2.12k stars 112 forks source link

Can't display comments #565

Closed luk9a closed 1 year ago

luk9a commented 1 year ago

Linux 5.15.0-75 Tartube v2.4.386 yt-dlp 2023.06.22 python3.10

In this version, I can't display extracted comments anymore from any video, I tried to downgrade, but the config file is incompatible.

When activated, comments are extracted normally, but doesn't appears in comments tab in video properties, the button "Update from metadata file" keeps grayed out. Since there is no option to extract comments after video is already downloaded, I always extract externally with the command "yt-dlp -o --skip-download --write-comments" to write to JSON, and it was possible to update from metadata file, but this time, I got the error bellow, after this error video properties will not open and show the same error.

Original exception was: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/tartube/mainwin.py", line 19622, in on_video_catalogue_show_properties config.VideoEditWin(self.app_obj, media_data_obj) File "/usr/lib/python3/dist-packages/tartube/config.py", line 14547, in init self.setup() File "/usr/lib/python3/dist-packages/tartube/config.py", line 109, in setup self.setup_tabs() File "/usr/lib/python3/dist-packages/tartube/config.py", line 14621, in setup_tabs self.setup_comments_tab() File "/usr/lib/python3/dist-packages/tartube/config.py", line 15693, in setup_comments_tab self.setup_comments_tab_update_list() File "/usr/lib/python3/dist-packages/tartube/config.py", line 15807, in setup_comments_tab_update_list self.setup_comments_tab_update_listbox() File "/usr/lib/python3/dist-packages/tartube/config.py", line 15999, in setup_comments_tab_update_listbox if mini_dict['likes']: KeyError: 'likes'

Thanks

axcore commented 1 year ago

I'm not at my desk today, so you can either wait until tomorrow, or you can patch the code itself.

/usr/lib/python3/dist-packages/tartube/config.py line 15999 is

        if mini_dict['likes']:

Could be replaced by:

        if 'likes' in mini_dict:

Note that the line must begin with exactly 12 space characters, no tabs, because LOL python.

luk9a commented 1 year ago

Thank you!

axcore commented 1 year ago

Should be fixed completely in v2.4.407.

The new code is uploaded only to Github/pypi. Windows users can update their installation as described here.