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

return specific error when video blocked on copyright grounds (python lib) #7509

Open
dattaz opened this issue Nov 15, 2015 · 7 comments
Open

Comments

@dattaz
Copy link

dattaz commented Nov 15, 2015

actually it's return a generic error : youtube_dl.utils.DownloadError (same as no internet connection for example)
it's will be useful to have a specific error, something like youtube_dl.utils.BlockedCopyright

@jaimeMF
Copy link
Collaborator

jaimeMF commented Nov 15, 2015

Post an example URL, and how you are calling youtube-dl (ideally the minimum code to reproduce it)

@dattaz
Copy link
Author

dattaz commented Nov 15, 2015

code to reproduce https://gist.github.com/dattaz/80c94db5d22b2bb5b96f
url blocked in france..

@dattaz
Copy link
Author

dattaz commented Nov 15, 2015

=> example of use case https://gist.github.com/dattaz/d17fc77bc30ba98e11b1

@dstftw
Copy link
Collaborator

dstftw commented Nov 15, 2015

Post the output of script execution.

@jaimeMF
Copy link
Collaborator

jaimeMF commented Nov 15, 2015

  1. In the future, please format your code to make sure it can be run without modifications (i had to remove the leading indentation).
  2. If you are running on python 2.x you need to use from __future__ import unicode_literals(as reported when running the script).
  3. You can access the original exception:
                       except youtube_dl.utils.DownloadError as e:
                           print(repr(e.exc_info[1]))

gives ExtractorError(u'...'), there are multiple causes for an ExtractorError. You can directly use it to report the problem.

@dattaz
Copy link
Author

dattaz commented Nov 15, 2015

output : https://gist.github.com/dattaz/982281ec9eff0aa83533

sorry for indentation, i use python 2.x but no report about using from future import unicode_literals

can we know all cause for ExtractorError ? because other url (also blocked) show a different message...that why i think having a specific error can be a good idea

@jaimeMF
Copy link
Collaborator

jaimeMF commented Nov 15, 2015

There are a lot of possible error messages (georestriction, removed due to copyright, removed by the user, temporary problems ...). I don't think we can accurately classify them. As I said if you get the original exception, you can get the YouTube said: This video is available in France, French Guiana, Guadeloupe, Martinique, New Caledonia, French Polynesia, Saint Pierre and Miquelon, Réunion, Wallis and Futuna, Mayotte only message.

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

3 participants