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

Improve error reporting when proxies mess with the page #10877

Open
surgeio opened this issue Oct 8, 2016 · 1 comment
Open

Improve error reporting when proxies mess with the page #10877

surgeio opened this issue Oct 8, 2016 · 1 comment

Comments

@surgeio
Copy link

@surgeio surgeio commented Oct 8, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.10.07

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

When using proxies to get around geo-location, there is a risk that the proxy will return a page different from the page you expect. See, for example, issue #10873. Unfortunately the error message given by youtube-dl is actively misleading: the error message explicitly tells you to report it as a bug. It would be very helpful if youtube-dl was smarter about this situation. I don't know exactly what could be done, but I have some ideas:

  • if there is a proxy set, suggest that the user check whether the proxy is returning the right page before reporting it as a bug;

  • perhaps youtube-dl could recognise the most common examples (e.g. phpinfo page?) and report a better error: "use a different proxy, this one redirects to phpinfo";

  • how smart can youtube-dl get? is it capable of recognising that (say) a BBC url doesn't give a BBC page? It doesn't need to be 100% accurate, just accurate enough to avoid misleading the user and suggesting the problem is a bug in youtube-dl. I know there is a big gap between the ability of a human to recognise a re-directed page and what an application like youtube-dl can do, but it might be possible to close the gap even a little bit.

  • a really dumb test which might catch 90% of the cases:

    from urlparse import urlparse
    domain = urlparse(url).hostname
    page = download(url)
    if domain not in page:
    # probably not on the real page, probably redirected to something unexpected

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 9, 2016

how smart can youtube-dl get

Unfortunately it's not smart at all, so only the first option is feasible. A better comment can be:

if you can watch this video in browsers, please report this issue on https://yt-dl.org/bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.