mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8k stars 643 forks source link

Track keeps repeating despite not setting any repeat options, doesn't skip to the next track #1133

Open darkhz opened 3 years ago

darkhz commented 3 years ago

Hello, I've encountered a bug while playing a list of tracks.

The track finishes playing, and then a "retrying.." message pops up, and the track repeats without going to the next one.This is not a common occurence, happens quite randomly.

I believe this issue is caused by the following code:

File player.py, lines 239-249

cmd = _generate_real_playerargs(song, override, stream, video, softrepeat)
returncode = _launch_player(song, songdata, cmd)
failed = returncode not in (0, 42, 43)

if failed and failcount < g.max_retries:
    util.dbg(c.r + "stream failed to open" + c.w)
    util.dbg("%strying again (attempt %s)%s", c.r, (2 + failcount), c.w)
    screen.writestatus("error: retrying")
    time.sleep(1.2)
    failcount += 1
    return _playsong(song, stream, video, failcount=failcount, override=override, softrepeat=softrepeat)

This issue happened yesterday for me, and today, after deleting the cache, I'm not facing the issue, at least for now.

Relevant details:

mpsyt was installed via pip.

ENVIRONMENT:

$ mpsyt --version 
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2020.12.09
Python version     : 3.9.0 (default, Oct  7 2020, 23:09:01) 
[GCC 10.2.0]
Processor          : 
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.9.13-arch1-1-x86_64-with-glibc2.32
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/<user>/.config/mps-youtube
env:TERM           : xterm-256color
env:SHELL          : /bin/fish
env:LANG           : en_US.UTF-8

$ mpsyt set
  order             : relevance
  user_order        : 
  max_res           : 2160p
  player            : mpv
  playerargs        : 
  encoder           : 0 [None]
  notifier          : 
  checkupdate       : True
  show_mplayer_keys : True
  fullscreen        : False
  show_status       : True
  columns           : 
  ddir              : Downloads
  overwrite         : True
  show_video        : False
  search_music      : True
  window_pos        : 
  window_size       : 
  download_command  : 
  lastfm_username   : 
  lastfm_password   : 
  lastfm_api_key    : 
  lastfm_api_secret : 
  audio_format      : auto
  video_format      : auto
  api_key           : <custom_api_key>
  autoplay          : False
  set_title         : True
  mpris             : True
caligula36 commented 3 years ago

I encountered the same problem. Has it been resolved yet?

This issue happened yesterday for me, and today, after deleting the cache, I'm not facing the issue, at least for now.

Do you mean cache_py_3.9.4? I remove it because of issue #1136, but the problem persists.

Relevant details:

OS: Ubuntu 21.04

ENVIRONMENT:

$ mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2021.04.26
Python version     : 3.9.4 (default, Apr  4 2021, 19:38:44) 
[GCC 10.2.1 20210401]
Processor          : x86_64
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.11.0-16-generic-x86_64-with-glibc2.33
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/<user>/.config/mps-youtube
env:TERM           : xterm-256color
env:SHELL          : /bin/bash
env:LANG           : en_US.UTF-8
$ mpsyt set
  order             : relevance
  user_order        : 
  max_res           : 2160p
  player            : mpv
  playerargs        : 
  encoder           : 0 [None]
  notifier          : 
  checkupdate       : True
  show_mplayer_keys : True
  fullscreen        : False
  show_status       : True
  columns           : 
  ddir              : /home/<user>/Downloads/mps
  overwrite         : True
  show_video        : False
  search_music      : False
  window_pos        : 
  window_size       : 
  download_command  : 
  lastfm_username   : 
  lastfm_password   : 
  lastfm_api_key    : 
  lastfm_api_secret : 
  audio_format      : auto
  video_format      : auto
  api_key           : <custom_api_key>
  autoplay          : False
  set_title         : True
  mpris             : True
$ pip show mps-youtube
Name: mps-youtube
Version: 0.2.8
Summary: Terminal based YouTube player and downloader
Home-page: https://github.com/mps-youtube/mps-youtube
Author: np1
Author-email: np1nagev@gmail.com
License: UNKNOWN
Location: /usr/local/lib/python3.9/dist-packages
Requires: pafy
Required-by: 

(This is my first post here; I hope the formatting is correct)