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

Playlist country availability crash issue #960

Open hansolsuh opened 5 years ago

hansolsuh commented 5 years ago

I was trying to play this playlist, RDX6PJdx0Y9eA (essentially https://www.youtube.com/watch?v=X6PJdx0Y9eA&list=RDX6PJdx0Y9eA&start_radio=1) easier to access this on browser i think.

I did:

mpsyt pl RDX6PJdx0Y9eA

I learned from mpsyt that few of the items on the playlist are not available in the US (the browser version just simply doesnt show me those unavailable videos, so I didn't know). the first in the playlist is "東京事変 - 遭難", which is not available in the US, and it refuses to play it. If I do

1-

then it trys for three times and fails and exits. (There are few other non-US-avail videos, i think, and sometimes the ordering of the playlist shuffled when i loaded it)

In any case, would it be possible to fix it such that if the video is not available in a certain country, the player would just go to next song in the playlist? Thanks

output:

ERROR: The uploader has not made this video available in your country. ERROR: The uploader has not made this video available in your country. ERROR: The uploader has not made this video available in your country. ERROR: The uploader has not made this video available in your country. Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 794, in extract_info ie_result = ie.extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 522, in extract ie_result = self._real_extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/youtube.py", line 1981, in _real_extract raise ExtractorError(error_message, expected=True) youtube_dl.utils.ExtractorError: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 38, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 817, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 622, in report_error self.trouble(error_message, tb) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 592, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 148, in _playsong streams.get(song, force=failcount, callback=screen.writestatus) File "/usr/lib/python3/dist-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3/dist-packages/mps_youtube/util.py", line 201, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3/dist-packages/pafy/pafy.py", line 122, in new return Pafy(url, basic, gdata, size, callback, ydl_opts) File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 29, in init super(YtdlPafy, self).init(*args, **kwargs) File "/usr/lib/python3/dist-packages/pafy/backend_shared.py", line 95, in init self._fetch_basic() File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 41, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 794, in extract_info ie_result = ie.extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 522, in extract ie_result = self._real_extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/youtube.py", line 1981, in _real_extract raise ExtractorError(error_message, expected=True) youtube_dl.utils.ExtractorError: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 38, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 817, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 622, in report_error self.trouble(error_message, tb) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 592, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 148, in _playsong streams.get(song, force=failcount, callback=screen.writestatus) File "/usr/lib/python3/dist-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3/dist-packages/mps_youtube/util.py", line 201, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3/dist-packages/pafy/pafy.py", line 122, in new return Pafy(url, basic, gdata, size, callback, ydl_opts) File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 29, in init super(YtdlPafy, self).init(*args, **kwargs) File "/usr/lib/python3/dist-packages/pafy/backend_shared.py", line 95, in init self._fetch_basic() File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 41, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 794, in extract_info ie_result = ie.extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/common.py", line 522, in extract ie_result = self._real_extract(url) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/extractor/youtube.py", line 1981, in _real_extract raise ExtractorError(error_message, expected=True) youtube_dl.utils.ExtractorError: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 38, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 817, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 622, in report_error self.trouble(error_message, tb) File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 592, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 148, in _playsong streams.get(song, force=failcount, callback=screen.writestatus) File "/usr/lib/python3/dist-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3/dist-packages/mps_youtube/util.py", line 201, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3/dist-packages/pafy/pafy.py", line 122, in new return Pafy(url, basic, gdata, size, callback, ydl_opts) File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 29, in init super(YtdlPafy, self).init(*args, **kwargs) File "/usr/lib/python3/dist-packages/pafy/backend_shared.py", line 95, in init self._fetch_basic() File "/usr/lib/python3/dist-packages/pafy/backend_youtube_dl.py", line 41, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: The uploader has not made this video available in your country.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/mpsyt", line 11, in load_entry_point('mps-youtube==0.2.7.1', 'console_scripts', 'mpsyt')() File "/usr/lib/python3/dist-packages/mps_youtube/main.py", line 141, in main if matchfunction(i.function, i.regex, userinput): File "/usr/lib/python3/dist-packages/mps_youtube/main.py", line 64, in matchfunction func(*matches) File "/usr/lib/python3/dist-packages/mps_youtube/commands/play.py", line 85, in play play_range(songlist, shuffle, repeat, override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 41, in play_range returncode = _playsong(song, override=override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 160, in _playsong return _playsong(song, failcount=failcount, override=override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 160, in _playsong return _playsong(song, failcount=failcount, override=override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 160, in _playsong return _playsong(song, failcount=failcount, override=override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 175, in _playsong cached = g.streams[song.ytid] KeyError: 'YPGupG0ZgVM'

Issue / Suggestion

Your Environment

OS: Ubuntu 18.04 Bionic. Gnome DE Thinkpad X220, if this helps. I don't know what kind of music play i'm using. it just werked. i messed with ncmpcpp previously, so i probably have either alsa or pulse, which probably doesn't help. sorry.

mpsyt --version: mpsyt version : 0.2.7.1 notes : released 6 July 2016 pafy version : 0.5.2 (youtube-dl backend) youtube-dl version : 2019.03.09 Python version : 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] Processor : x86_64 Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-4.15.0-36-generic-x86_64-with-Ubuntu-18.04-bionic sys.stdout.enc : UTF-8 default enc : utf-8 Config dir : /home/david/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : en_US.UTF-8 env:LANGUAGE : en_US

Thanks!

davealbert commented 5 years ago

+1