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
8.12k stars 642 forks source link

mps-youtube doesn't play some videos, even though youtube-dl does #972

Closed ElonSatoshi closed 1 year ago

ElonSatoshi commented 5 years ago

For instance, this video: https://youtube.com/watch?v=jcEXLEH3rg8

Issue / Suggestion

When I open it in mpsyt, it skips it and autoplays another video. When I open it in with mpv: mpv https://youtube.com/watch?v=jcEXLEH3rg8, it plays fine.

It skips other videos. It also crashed while I let it autoplay.

Your Environment

$ mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.4 (youtube-dl backend)
youtube-dl version : 2019.04.07
Python version     : 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516]
Processor          : 
Machine type       : x86_64
Architecture       : 64bit, 
Platform           : Linux-4.9.0-8-amd64-x86_64-with-debian-9.8
sys.stdout.enc     : UTF-8
default enc        : utf-8
Config dir         : /home/peter/.config/mps-youtube
env:TERM           : xterm-256color
env:SHELL          : /bin/bash
env:LANG           : en_US.UTF-8

$ mpv --version
mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       55.34.101
   libavcodec      57.64.101
   libavformat     57.56.101
   libswscale      4.2.100
   libavfilter     6.65.100
   libswresample   2.3.100
ffmpeg version: 3.2.12-1~deb9u1

$ youtube-dl --version
2019.04.07
kraetzin commented 5 years ago

That's strange, I can't reproduce this on my end. Do you have examples of any other videos that do this? If you run mpsyt --debug and try then, that could help narrow things down a bit.

jzyinq commented 5 years ago

Got the same problem - when I try to play music from that playlist: https://www.youtube.com/playlist?list=PL9s-nKnqgoWVncBdf1KcaQi_NKL_85xF4 nearly half of videos are skipped and unplayable through mps-youtube where mpv plays them without problem.

$ mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.4 (youtube-dl backend)
youtube-dl version : 2019.04.24
Python version     : 3.5.2 (default, Nov 12 2018, 13:43:14) 
[GCC 5.4.0 20160609]
Processor          : x86_64
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-4.15.0-45-generic-x86_64-with-LinuxMint-18.2-sonya
sys.stdout.enc     : UTF-8
default enc        : utf-8
Config dir         : /home/jzy/.config/mps-youtube
env:TERM           : screen-256color
env:SHELL          : /bin/zsh
env:LANG           : en_US.UTF-8
env:LANGUAGE       : en_US

$ mpv --version
mpv 0.14.0 (C) 2000-2015 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       54.31.100
   libavcodec      56.60.100
   libavformat     56.40.101
   libswscale      3.1.101
   libavfilter     5.40.101
   libswresample   1.2.101
ffmpeg version: 2.8.15-0ubuntu0.16.04.1

$ youtube-dl --version
2019.04.24

What's funny that on my second host everything work fine for:

$ mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.4 (youtube-dl backend)
youtube-dl version : 2019.04.24
Python version     : 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0]
Processor          : x86_64
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-4.15.0-47-generic-x86_64-with-LinuxMint-19-tara
sys.stdout.enc     : UTF-8
default enc        : utf-8
Config dir         : /home/jzy/.config/mps-youtube
env:TERM           : xterm-256color
env:SHELL          : /usr/bin/zsh
env:LANG           : en_US.UTF-8
env:LANGUAGE       : en_US

$ mpv --version
mpv 0.27.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       55.78.100
   libavcodec      57.107.100
   libavformat     57.83.100
   libswscale      4.8.100
   libavfilter     6.107.100
   libswresample   2.9.100
ffmpeg version: 3.4.4-0ubuntu0.18.04.1

$ youtube-dl --version
2019.04.24
ritiek commented 5 years ago

@jzyinq You could try deleting the local cache on the machine where mpsyt doesn't work properly:

$ rm ~/.config/mps-youtube/cache_py*

Does that work?

jzyinq commented 5 years ago

@ritiek Unfortunately not - problem still persists.

ElonSatoshi commented 5 years ago

Tried to play Eminem - Without Me, and got this:

    Eminem - Without Me [05:00]
                                                                                                                                                                                                                              [1/10>
--etting content length                                                                                                                                                                                                                      

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/main.py", line 65, in matchfunction
    func(*matches)
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/commands/play.py", line 100, in play
    play_range(songlist, shuffle, repeat, override)
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/player.py", line 50, in play_range
    returncode = _playsong(song, stream, video, override=override, softrepeat=softrepeat)
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/player.py", line 233, in _playsong
    size = streams.get_size(song.ytid, stream['url'])
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/streams.py", line 142, in get_size
    stream['size'] = _get_content_length(url, preloading=preloading)
  File "/usr/local/lib/python3.5/dist-packages/mps_youtube/streams.py", line 152, in _get_content_length
    response = urlopen(url)
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Problem playing last item: HTTP Error 403: Forbidden                                                                                                                                                             [1/10>
> i 24
--

--etched                                                                                                                                                                                                                                     

Video Info

Eminem - Without Me
iTunes: http://smarturl.it/WithoutMe  
Amazon: http://smarturl.it/WithoutMeAmz 
Google Play: http://smarturl.it/WithoutMeGP  

Playlist Best of Eminem: https://goo.gl/AquNpo
Subscribe for more: https://goo.gl/DxCrDV

Music video by Eminem performing Without Me. (C) 2002 Aftermath Records

Author     : EminemVEVO
Published  : Tue 16 Jun 2009 06:00:29 PM 
View count : 765359931
Rating     : None
Likes      : 4098824
Dislikes   : 137623
Category   : Music
Link       : https://youtube.com/watch?v=YVkUvmDQ3HY

[Press enter to go back]
tre-bor commented 5 years ago

same for me with youtube-dl version 2019.06.21

iamtalhaasghar commented 1 year ago

upgrade to latest version and let me know if it still persists, i'll reopen this issue.