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

Android QPython Script SSL Error with no-check-certificate #15829

Closed
Klemek opened this issue Mar 11, 2018 · 2 comments
Closed

Android QPython Script SSL Error with no-check-certificate #15829

Klemek opened this issue Mar 11, 2018 · 2 comments
Labels

Comments

@Klemek
Copy link

@Klemek Klemek commented Mar 11, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.10. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

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

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

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

Script :

from __future__ import unicode_literals
import youtube_dl

ydl_opts = {
	    'no-check-certificate':'True',
	    'prefer-insecure':'True',
	    'verbose':'True'
	    }

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])

Logs :

/data/user/0/org.qpython.qpy/files/bin/qpython-android5.sh "/storage/emulated/0/hzhshz.py" && exit
ge/emulated/0/hzhshz.py" && exit         <
[debug] Encodings: locale UTF-8, fs None, out None, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Python version 2.7.12 (CPython) - Linux-3.10.61-12236002-armv8l-with-libc
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/urllib2.py", line 447, in _open
    '_open', req)
  File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/utils.py", line 1101, in https_open
    req, **kwargs)
  File "/data/user/0/org.qpython.qpy/files/lib/python27.zip/urllib2.py", line 1198, in do_open
    raise URLError(err)

Traceback (most recent call last):
  File "/storage/emulated/0/hzhshz.py", line 11, in <module>
    ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/YoutubeDL.py", line 1989, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/YoutubeDL.py", line 808, in extract_info
    self.report_error(compat_str(e), e.format_traceback())
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/YoutubeDL.py", line 613, in report_error
    self.trouble(error_message, tb)
  File "/data/user/0/org.qpython.qpy/files/lib/python2.7/site-packages/youtube_dl-2018.03.10-py2.7.egg/youtube_dl/YoutubeDL.py", line 583, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
<end of log>

Description of your issue, suggested solution and other information

The console usage of QPython throw the same SSL: CERTIFICATE_VERIFY_FAILED error except that --no-check-certificate fix it. In the script, it seems this parameter isn't checked.
Is this an issue or is the parameter in the script version different ?
(First, I was using 'parameter':'' for flags then I noticed that verbose was only working with 'True' but it didn't fix the issue.)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 11, 2018

Options are spelled incorrectly. Read.

@dstftw dstftw closed this Mar 11, 2018
@dstftw dstftw added the invalid label Mar 11, 2018
@flothesof
Copy link

@flothesof flothesof commented Nov 27, 2019

If anyone else wonders what was misspelled, this is what worked for me:

ydl_opts = {
	    'nocheckcertificate': True,
	    'prefer-insecure': True,
	    'verbose': True
	    }
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
3 participants
You can’t perform that action at this time.