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

Application crashes if the video is blocked by the copyright holders #837

Closed
ac130kz opened this issue Jun 2, 2018 · 6 comments
Closed

Comments

@ac130kz
Copy link

ac130kz commented Jun 2, 2018

The title is pretty much self explanatory, but as I saw in the code, there is a "pass" for videos that cannot be played, so I cannot suggest a solution for it. I'm also not sure whether it's an issue with mps-youtube or dl-youtube/pafy, because the error message that I get is just a mess.

PS I also could not get next/previous keys (< and >) working both on Windows and Ubuntu, are they currently broken?

Issue / Suggestion

Not to waste any space here, I'll put the error message on gist

Environment

mpsyt version : 0.2.8
notes : released 17 February 2018
pafy version : 0.5.4 (youtube-dl backend)
youtube-dl version : 2018.03.14
Python version : 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
Processor : x86_64
Machine type : x86_64
Architecture : 64bit, ELF
Platform : Linux-4.15.0-22-generic-x86_64-with-Ubuntu-18.04-bionic
sys.stdout.enc : UTF-8
default enc : utf-8
Config dir : /home/ac130kz/.config/mps-youtube
env:TERM : xterm-256color
env:SHELL : /bin/bash
env:LANG : en_US.UTF-8
env:LANGUAGE : en_US
OS: xubuntu 18.04
mpv 0.27.2

@zutto
Copy link

zutto commented Jul 13, 2018

I stumbled across same problem, root cause for this is unhandled exception at https://github.com/mps-youtube/mps-youtube/blob/master/mps_youtube/player.py#L48

88e0ecb#diff-455e9f21a8e3845a55401647c2c8eda4 this commit was good, but it was missing KeyError handling, which is the exception we are receiving.

so, in short: adding this fixed the issue for me.

except KeyError:
    returncode = 1

But, one could argue that for sake of stability, all exception should probably be caught there, as libraries around evolve and start generating different exception types, and this could cause problems in future, so might as well implement permanent fix.

@ac130kz
Copy link
Author

ac130kz commented Jul 13, 2018

I think that with a bit of debugging one of these functions should be modified to catch this specific issue

stream_details 
_playsong

@postfalk
Copy link

Please catch this KeyError. Otherwise mpsyt is awesome.

@sdmunozsierra
Copy link

Latest 0.2.8 git version has this fix.
You can install it by typing:
$ pip3 install --user -U git+https://github.com/mps-youtube/mps-youtube.git

@postfalk
Copy link

Awesome

@tchernomax
Copy link
Contributor

tchernomax commented Oct 5, 2018

@sdmunozsierra "except KeyError" isn't present in https://github.com/mps-youtube/mps-youtube/blob/master/mps_youtube/player.py#L48 version 0.2.8 (event on master).
(There is a "except TypeError", which isn't the same… and doesn't fix this bug).

On my system I changed "except TypeError:" to "except:" and it fix the problem.

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

5 participants