iamtalhaasghar / yewtube

Terminal based YouTube player and downloader. No Youtube API key required. Moved to https://github.com/mps-youtube/yewtube
GNU General Public License v3.0
246 stars 20 forks source link

saving playlists with save cmd results in error #75

Closed vivCoding closed 2 years ago

vivCoding commented 2 years ago

Cannot save playlists using the save command.

I realize that playlists are auto saved everytime a song is added to a playlist using add <num> <playlist>. However, using add <num> to the current playlist OR removing a song using rm <num> does not auto save the playlist. And when one attempts to using the save command to save it, it fails. Perhaps I am failing to understand how the command work.

Issue

Using save or save <name> command results in the following error (the empty quotes intentional)

Error fetching data. Possible network issue.
''

Steps to reproduce

No playlists have been created

Your Environment

Running on EndeavourOS 22.1, Python 3.10.4, pip 21.0

Have tried with Python 3.6 and 3.8 as well

Output from yt --version

yewtube version    : 2.8.4
yt_dlp version     : 2022.04.08
Python version     : 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]
Processor          : 
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.17.5-arch1-1-x86_64-with-glibc2.35
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/vuser/.config/mps-youtube
dbus               : 1.2.18
glib               : True
env:TERM           : rxvt-unicode-256color
env:SHELL          : /usr/bin/fish
env:LANG           : en_US.UTF-8

Config (output from set)

  Key                 Value                                                                                                                                                                                                                 
  order             : relevance              
  user_order        :                        
  max_res           : 2160p                  
  player            : mpv                    
  playerargs        :                        
  encoder           : 0 [None]               
  notifier          :                        
  checkupdate       : False                  
  show_player_keys  : True                   
  fullscreen        : False                  
  show_status       : True                   
  always_repeat     : False                  
  columns           : date user              
  ddir              : /home/vuser/Music/mps/ 
  overwrite         : True                   
  show_video        : False                  
  search_music      : False                  
  window_pos        :                        
  window_size       :                        
  download_command  :        
  lookup_metadata   : True                   
  lastfm_username   :                        
  lastfm_password   :                        
  lastfm_api_key    :                        
  lastfm_api_secret :                        
  audio_format      : auto                   
  video_format      : auto                   
  pages             : 3                      
  autoplay          : False                  
  set_title         : True                   
  mpris             : True                   
  show_qrcode       : False                  
  history           : True                   
  input_history     : True                   
  vlc_dummy_interface : False   
gdbiles commented 2 years ago

I was an mpsyt user, now trying yewtube. My old mpsyt playlists will play fine, but I cannot create new playlists due to this error.

Using Mac OS Big Sur:

$ yt --debug
yewtube version    : 2.8.4
yt_dlp version     : 2022.07.18
Python version     : 3.10.5 (main, Jun 23 2022, 17:15:32) [Clang 13.0.0 (clang-1300.0.29.30)]
Processor          : i386
Machine type       : x86_64
Architecture       : 64bit,
Platform           : macOS-11.6.8-x86_64-i386-64bit
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /Users/gbiles/.config/mps-youtube
dbus               : None
glib               : False
env:TERM           : screen-256color
env:SHELL          : /bin/zsh
--

yt pl <id> renders the playlist fine, but save <foo> produces error:

> save xxxxxx
Traceback (most recent call last):
  File "/Users/gbiles/.local/pipx/venvs/yewtube/lib/python3.10/site-packages/mps_youtube/main.py", line 69, in matchfunction
    func(*matches)
  File "/Users/gbiles/.local/pipx/venvs/yewtube/lib/python3.10/site-packages/mps_youtube/commands/local_playlist.py", line 156, in open_save_view
    g.userpl[name] = Playlist(name, [Video(i['id'], i['title'], parse_video_length(i['duration'])) for i in g.pafy_pls[g.selected_pafy_pls_id][0].videos])
KeyError: ''
--

Traceback (most recent call last):
  File "/Users/gbiles/.local/pipx/venvs/yewtube/lib/python3.10/site-packages/mps_youtube/main.py", line 69, in matchfunction
    func(*matches)
  File "/Users/gbiles/.local/pipx/venvs/yewtube/lib/python3.10/site-packages/mps_youtube/commands/local_playlist.py", line 156, in open_save_view
    g.userpl[name] = Playlist(name, [Video(i['id'], i['title'], parse_video_length(i['duration'])) for i in g.pafy_pls[g.selected_pafy_pls_id][0].videos])
KeyError: ''

Error fetching data. Possible network issue.
''

Config:

{
  "ORDER": "relevance",
  "USER_ORDER": "",
  "MAX_RESULTS": 19,
  "CONSOLE_WIDTH": 80,
  "MAX_RES": 2160,
  "PLAYER": "mpv",
  "PLAYERARGS": "",
  "ENCODER": 0,
  "NOTIFIER": "",
  "CHECKUPDATE": true,
  "SHOW_PLAYER_KEYS": true,
  "FULLSCREEN": false,
  "SHOW_STATUS": true,
  "ALWAYS_REPEAT": false,
  "COLUMNS": "",
  "DDIR": "/Users/gbiles/Downloads/mps",
  "OVERWRITE": true,
  "SHOW_VIDEO": false,
  "SEARCH_MUSIC": true,
  "WINDOW_POS": "",
  "WINDOW_SIZE": "",
  "DOWNLOAD_COMMAND": "",
  "LOOKUP_METADATA": false,
  "LASTFM_USERNAME": "",
  "LASTFM_PASSWORD": "",
  "LASTFM_API_KEY": "",
  "LASTFM_API_SECRET": "",
  "AUDIO_FORMAT": "auto",
  "VIDEO_FORMAT": "auto",
  "PAGES": 3,
  "AUTOPLAY": false,
  "SET_TITLE": true,
  "MPRIS": false,
  "SHOW_QRCODE": false,
  "HISTORY": true,
  "INPUT_HISTORY": true,
  "VLC_DUMMY_INTERFACE": false
}