woefe / ytcc

Command line tool to keep track of your favorite playlists on YouTube and many other places.
GNU General Public License v3.0
178 stars 20 forks source link

TUI doesn’t start anymore #87

Closed zoidby closed 3 years ago

zoidby commented 3 years ago
> ytcc tui
Traceback (most recent call last):
  File "/bin/ytcc", line 33, in <module>
    sys.exit(load_entry_point('ytcc==2.1.0', 'console_scripts', 'ytcc')())
  File "/usr/lib/python3.9/site-packages/ytcc/cli.py", line 567, in main
    cli.main(standalone_mode=False)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/ytcc/cli.py", line 381, in tui
    Interactive(ytcc).run()
  File "/usr/lib/python3.9/site-packages/ytcc/tui.py", line 171, in run
    printer.print(selectable)
  File "/usr/lib/python3.9/site-packages/ytcc/printer.py", line 150, in print
    table = obj.table()
  File "/usr/lib/python3.9/site-packages/ytcc/tui.py", line 91, in table
    table = VideoPrintable(self.values()).table()
  File "/usr/lib/python3.9/site-packages/ytcc/printer.py", line 103, in table
    self._format_duration(video.duration),
  File "/usr/lib/python3.9/site-packages/ytcc/printer.py", line 77, in _format_duration
    return f"{duration // 60: 4.0f}:{duration % 60:02.0f}"
TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'
EmRowlands commented 3 years ago

Can you post the output of ytcc bug-report?

zoidby commented 3 years ago

Here it is:

---ytcc version---
2.1.0

---youtube-dl version---
2021.03.25

---SQLite version---
SQLite system library version: 3.35.3
Python module version: 2.6.0

---python version---
3.9.2 (default, Feb 20 2021, 18:40:11) 
[GCC 10.2.0]

---mpv version---
mpv 0.33.0-dirty Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       56.51.100
   libavcodec      58.91.100
   libavformat     58.45.100
   libswscale      5.7.100
   libavfilter     7.85.100
   libswresample   3.7.100
FFmpeg version: n4.3.2

---config dump---
[ytcc]
download_dir = ~/pub
mpv_flags = --ytdl-format=bestvideo[height<=?1080]+bestaudio/best --geometry=1272
order_by = playlists:asc, publish_date:asc
video_attrs = playlists, title, duration
playlist_attrs = name, url, tags
db_path = ~/.local/share/ytcc/ytcc.db
date_format = %Y-%m-%d
max_update_fail = 10
max_update_backlog = 21
age_limit = 9000

[tui]
alphabet = sdfervghnuiojkl
default_action = play_video

[theme]
prompt_download_audio = 51
prompt_download_video = 46
prompt_play_audio = 51
prompt_play_video = 46
prompt_mark_watched = 196
table_alternate_background = 168

[youtube_dl]
format = bestvideo[height<=?1080]+bestaudio/best
output_template = %(title)s.%(ext)s
ratelimit = 0
retries = 0
subtitles = off
thumbnail = true
skip_live_stream = true
merge_output_format = mkv
max_duration = 0
restrict_filenames = false
woefe commented 3 years ago

Might be related to https://github.com/ytdl-org/youtube-dl/issues/28049. Mabye 0af64e0 fixes the issue. Can you try it?

zoidby commented 3 years ago

It does! Thank you very much.

The speedy solutions here are impressive.

woefe commented 3 years ago

Cool! Thanks :smile:

There won't be a bugfix release for this issue. The next release (2.2.0) will happen soon enough after #88 is merged.