Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem playing last item: HTTP Error 403: Forbidden #1071

Closed
tchernomax opened this issue Apr 3, 2020 · 4 comments
Closed

Problem playing last item: HTTP Error 403: Forbidden #1071

tchernomax opened this issue Apr 3, 2020 · 4 comments

Comments

@tchernomax
Copy link
Contributor

When a forbidden video is encounter in a playlist, mps-youtube stop there.

Issue / Suggestion

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mps_youtube/main.py", line 70, in matchfunction
    func(*matches)
  File "/usr/lib/python3.8/site-packages/mps_youtube/commands/play.py", line 121, in play_all
    play(options, "1-" + str(len(g.model)))
  File "/usr/lib/python3.8/site-packages/mps_youtube/commands/play.py", line 102, in play
    g.PLAYER_OBJ.play(songlist, shuffle, repeat, override)
  File "/usr/lib/python3.8/site-packages/mps_youtube/player.py", line 79, in play
    self._playsong()
  File "/usr/lib/python3.8/site-packages/mps_youtube/player.py", line 132, in _playsong
    size = streams.get_size(self.song.ytid, self.stream['url'])
  File "/usr/lib/python3.8/site-packages/mps_youtube/streams.py", line 142, in get_size
    stream['size'] = _get_content_length(url, preloading=preloading)
  File "/usr/lib/python3.8/site-packages/mps_youtube/streams.py", line 152, in _get_content_length
    response = urlopen(url)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, 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
> ERROR: zu5xfnUz7c0: YouTube said: This video contains content from SME, who has blocked it in your country on copyright grounds.

This error is fixed by #872

Your Environment

max@mde-oxalide % mpsyt --version
mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2020.03.24
Python version     : 3.8.2 (default, Feb 26 2020, 22:21:03)
[GCC 9.2.1 20200130]
Processor          :
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.5.13-arch2-1-x86_64-with-glibc2.2.5
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/max/.config/mps-youtube
env:TERM           : screen-256color
env:SHELL          : /usr/bin/zsh
env:LANG           : fr_FR.UTF-8

Archlinux

max@mde-oxalide % yay -Qi mps-youtube-git
Name            : mps-youtube-git
Version         : 0.2.8.r146.gafab9fb-1
…
@Jeronimo17
Copy link

Jeronimo17 commented Apr 11, 2020

Now the whole list gives that error
Edit: The problem is from youtube-dl

@hypnull
Copy link

hypnull commented Apr 14, 2020

See #1063 (comment) for the temporary fix

@atropo
Copy link

atropo commented Apr 16, 2020

Try deleting the youtube-dl cache. Works for me:

 youtube-dl --rm-cache-dir 

@timostrating
Copy link

Try deleting the youtube-dl cache. Works for me:

 youtube-dl --rm-cache-dir 

The problem is related to cache memory but that commando will not always help. You need to remove this file ~/.config/mps-youtube/cache_py_*
See: #1076 (comment)

A temporary workaround to keep this from happening because this file will be created again after a while can be found here: #1063 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants