python - Youtubedl CERTIFICATE_VERIFY_FAILED - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (https://stackoverflow.com/opensearch.xml) (https://stackoverflow.com/questions/60158087/youtubedl-certificate-verify-failed) (site logo) By clicking “Sign up”, you agree to our (https://stackoverflow.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://stackoverflow.com/legal/privacy-policy) privacy policy . Sign up with Google Sign up with GitHub OR Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (https://stackoverflow.com/users/login) Log in Skip to main content (https://stackoverflow.com/) Stack Overflow (https://stackoverflow.co/) About Products (https://stackoverflow.co/teams/) For Teams (Search…) (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60158087%2fyoutubedl-certificate-verify-failed) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f60158087%2fyoutubedl-certificate-verify-failed) Sign up Let's set up your homepage Select a few topics you're interested in: python javascript c# reactjs java android html flutter c++ node.js typescript css r php angular next.js spring-boot machine-learning sql excel ios azure docker Or search from our full list: (Search) Next You’ll be prompted to create an account to view your personalized homepage. (https://stackoverflow.com/) Home (https://stackoverflow.com/questions) Questions (https://stackoverflow.ai/) AI Assist Labs (https://stackoverflow.com/tags) Tags (https://stackoverflow.com/beta/challenges) Challenges (https://chat.stackoverflow.com/rooms/259507/stack-overflow-lobby) Chat (https://stackoverflow.blog/contributed?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=so-blog&utm_content=experiment-articles) Articles (https://stackoverflow.com/users) Users (https://stackoverflow.com/jobs?source=so-left-nav) Jobs (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Collectives Communities for your favorite technologies. (https://stackoverflow.com/collectives-all) Explore all Collectives Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Try Teams for free (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams (Illustration of upvote icon after it is clicked) Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? Instead, you can save this post to reference later. Save this post for later Not now (Illustration of upvote icon after it is clicked) Thanks for your vote! You now have 5 free votes weekly. Free votescount toward the total vote score does not give reputation to the author Continue to help good content that is interesting, well-researched, and useful, rise to the top! To gain full voting privileges, (https://stackoverflow.com/help/whats-reputation) earn reputation . Got it! Go to help center to learn more (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://stackoverflow.com/questions/60158087/youtubedl-certificate-verify-failed) Youtubedl CERTIFICATE_VERIFY_FAILED [duplicate] (https://stackoverflow.com/questions/ask) Ask Question (2020-02-10 20:40:09Z) Asked 5 years, 8 months ago Modified (https://stackoverflow.com/questions/60158087/youtubedl-certificate-verify-failed?lastactivity) (2022-09-01 21:35:15Z) 3 years, 1 month ago (Viewed 68,303 times) Viewed 68k times This question shows research effort; it is useful and clear 31 (This question does not show any research effort; it is unclear or not useful) Save this question. (https://stackoverflow.com/posts/60158087/timeline) Show activity on this post. This question already has answers here : (https://stackoverflow.com/questions/51785882/youtube-dl-gave-me-an-error-about-ssl) youtube-dl gave me an error about ssl (2 answers) Closed (2020-02-10 20:52:41Z) 5 years ago . I ran this code in Python: from __future__ import unicode_literals import youtube_dl ydl_opts = { 'format' : 'bestaudio/best' , 'postprocessors' : [{ 'key' : 'FFmpegExtractAudio' , 'preferredcodec' : 'mp3' , 'preferredquality' : '192' , }], } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['YOUTUBE URL' ]) I was hoping it would convert the Youtube video to a URL file. I got a really long error which basically repeated this: [0;31mERROR:[0m Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) I have searched online but a unsure on how to solve this problem? (https://stackoverflow.com/questions/tagged/python) (show questions tagged 'python') python (https://stackoverflow.com/questions/tagged/youtube-dl) (show questions tagged 'youtube-dl') youtube-dl (https://stackoverflow.com/q/60158087) (Short permalink to this question) Share (https://stackoverflow.com/posts/60158087/edit) Improve this question Follow Follow this question to receive notifications asked (2020-02-10 20:40:09Z) Feb 10, 2020 at 20:40 user12867493user12867493 4 (number of 'useful comment' votes received) 1 Means exactly what it said -- the list of CA certificates backing your Python interpreter's SSL implementation doesn't include a CA signing the certificate used by the server for the site purporting to be YouTube (this could mean your local CA certs are out-of-date, or it could mean that your Internet connection is having connections to YouTube intercepted and replaced with some other site, possibly something that pretends to be YouTube but injects hostile javascript). Charles Duffy – (https://stackoverflow.com/users/14122/charles-duffy) (298,994 reputation) Charles Duffy 2020-02-10 20:47:07 +00:00 Commented (2020-02-10 20:47:07Z, License: CC BY-SA 4.0) Feb 10, 2020 at 20:47 (this comment was edited 1 time) (number of 'useful comment' votes received) 1 ...it's not a problem with your code, so I don't know what you expect us to do here. Talk to your friendly local sysadmin; how to update the CA cert list varies by operating system / Linux distro / etc. Charles Duffy – (https://stackoverflow.com/users/14122/charles-duffy) (298,994 reputation) Charles Duffy 2020-02-10 20:47:43 +00:00 Commented (2020-02-10 20:47:43Z, License: CC BY-SA 4.0) Feb 10, 2020 at 20:47 (this comment was edited 1 time) @CharlesDuffy how can I fix this? user12867493 – user12867493 2020-02-10 20:47:58 +00:00 Commented (2020-02-10 20:47:58Z, License: CC BY-SA 4.0) Feb 10, 2020 at 20:47 I take it by that question that you don't have a friendly local sysadmin? First question: Which operating system are you running? Charles Duffy – (https://stackoverflow.com/users/14122/charles-duffy) (298,994 reputation) Charles Duffy 2020-02-10 20:49:28 +00:00 Commented (2020-02-10 20:49:28Z, License: CC BY-SA 4.0) Feb 10, 2020 at 20:49 (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) Add a comment | (Expand to show all comments on this post) 1 Answer 1 Sorted by: (https://stackoverflow.com/questions/60158087/youtubedl-certificate-verify-failed?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (trending) Trending (recent votes count more) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) This answer is useful 100 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://stackoverflow.com/posts/60158194/timeline) Show activity on this post. Add the no-check-certificate parameter to the command: youtube-dl --no-check-certificate This option was renamed to --no-check-certificates starting with version 2021.10.09 (inclusive). (https://stackoverflow.com/a/60158194) (Short permalink to this answer) Share (https://stackoverflow.com/posts/60158194/edit) Improve this answer Follow Follow this answer to receive notifications (https://stackoverflow.com/posts/60158194/revisions) (show all edits to this post) edited (2022-09-01 21:35:15Z) Sep 1, 2022 at 21:35 (https://stackoverflow.com/users/1155000/daniel-kamil-kozar) (Daniel Kamil Kozar's user avatar) (https://stackoverflow.com/users/1155000/daniel-kamil-kozar) Daniel Kamil Kozar (reputation score 19,534) 19.5k (5 gold badges) 5 5 gold badges (53 silver badges) 53 53 silver badges (70 bronze badges) 70 70 bronze badges answered (2020-02-10 20:49:16Z) Feb 10, 2020 at 20:49 (https://stackoverflow.com/users/12874549/nt4) (nt4's user avatar) (https://stackoverflow.com/users/12874549/nt4) nt4 nt4 (reputation score) 1,034 (1 gold badge) 1 1 gold badge (8 silver badges) 8 8 silver badges (4 bronze badges) 4 4 bronze badges Sign up to request clarification or add additional context in comments. 9 Comments Add a comment (https://stackoverflow.com/users/14122/charles-duffy) Charles Duffy (https://stackoverflow.com/users/14122/charles-duffy) Charles Duffy (2020-02-10T20:49:50.9Z) Over a year ago ...if you don't care about whether the site you're connecting to claiming to be YouTube is in fact the real thing. 2020-02-10T20:49:50.9Z+00:00 6 Reply user12867493 user12867493 (2020-02-10T21:09:45.913Z) Over a year ago Where do I add this since I run it in IDLE? 2020-02-10T21:09:45.913Z+00:00 0 Reply (https://stackoverflow.com/users/14122/charles-duffy) Charles Duffy (https://stackoverflow.com/users/14122/charles-duffy) Charles Duffy (2020-02-10T21:32:07.97Z) Over a year ago (Edited 3 times) Reading (https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/__init__.py) github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/… , the plain reading is that you should probably set 'no_check_certificate': True in ydl_opts if you want this workaround -- which, again, I strongly recommend against; better to fix your system's CA certificate list (if that's the problem), or find the source of whatever monkey-in-the-middle is intercepting connections to YouTube (if it's that). 2020-02-10T21:32:07.97Z+00:00 3 Reply (https://stackoverflow.com/users/12874549/nt4) nt4 (https://stackoverflow.com/users/12874549/nt4) nt4 (2020-02-10T23:46:15.217Z) Over a year ago just make sure the site you are connecting to is legit. I use youtube-dl with ffmeg to download some videos from other sites, which I know are legit, so I use this switch oftem. 2020-02-10T23:46:15.217Z+00:00 0 Reply (https://stackoverflow.com/users/3336412/matthias-burger) Matthias Burger (https://stackoverflow.com/users/3336412/matthias-burger) Matthias Burger (2022-03-26T10:24:55.19Z) Over a year ago to which command? this is a python script where someone does import ... 2022-03-26T10:24:55.19Z+00:00 1 Reply Add a comment | Show 4 more comments The Overflow Blog (https://stackoverflow.blog/2025/10/24/your-runbooks-are-obsolete-in-the-age-of-agents/?cb=1) Your runbooks are obsolete in the age of agents Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/412992/a-first-look-stack-overflow-redesign?cb=1) A First Look: Stack Overflow Redesign (Meta Stack Exchange) (https://meta.stackexchange.com/questions/413210/community-asks-sprint-announcement-october-november-2025?cb=1) Community Asks Sprint Announcement - October/November 2025 (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/435293/upcoming-opinion-based-questions-alpha-experiment-on-stack-overflow?cb=1) Upcoming opinion-based questions alpha experiment on Stack Overflow Community activity Last 1 hr Users online activity 6636 users online Number of questions asked 12 questions Number of questions that received an answer 8 answers Number of comments posted 27 comments Number of upvotes on posts 117 upvotes Popular tags Popular tags (https://stackoverflow.com/questions/tagged/java) java (https://stackoverflow.com/questions/tagged/php) php (https://stackoverflow.com/questions/tagged/c#) c# (https://stackoverflow.com/questions/tagged/c++) c++ (https://stackoverflow.com/questions/tagged/python) python (https://stackoverflow.com/questions/tagged/java.util.scanner) java.util.scanner Popular unanswered question Popular unanswered question (https://stackoverflow.com/questions/79801428) In my Blazor SSR app., my service method is failing when calling an Azure HTTP trigger (https://stackoverflow.com/questions/tagged/c#) c# (https://stackoverflow.com/questions/tagged/azure) azure (https://stackoverflow.com/questions/tagged/http) http (https://stackoverflow.com/questions/tagged/triggers) triggers (https://stackoverflow.com/questions/tagged/blazor) blazor (https://stackoverflow.com/users/5635923) (User avatar) (https://stackoverflow.com/users/5635923) John H 11 (Monday, October 27, 2025 at 3:16:40 AM UTC) 29 minutes ago Linked (https://stackoverflow.com/questions/51785882/youtube-dl-gave-me-an-error-about-ssl?lq=1) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/51785882/youtube-dl-gave-me-an-error-about-ssl?noredirect=1&lq=1) youtube-dl gave me an error about ssl Related (https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests?rq=1) (Question score (upvotes - downvotes)) 140 (https://stackoverflow.com/questions/51925384/unable-to-get-local-issuer-certificate-when-using-requests?rq=1) Unable to get local issuer certificate when using requests (https://stackoverflow.com/questions/61990284/pip-install-fails-with-connection-error-ssl-problem?rq=1) (Question score (upvotes - downvotes)) 6 (https://stackoverflow.com/questions/61990284/pip-install-fails-with-connection-error-ssl-problem?rq=1) Pip install fails with “connection error" ssl problem (https://stackoverflow.com/questions/60973425/youtube-dl-is-updated-to-latest-version-when-i-am-running-this-code-this-long-we?rq=1) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/60973425/youtube-dl-is-updated-to-latest-version-when-i-am-running-this-code-this-long-we?rq=1) YouTube-dl is updated to latest version.when I am running this code this long weird error is occurex (https://stackoverflow.com/questions/51785882/youtube-dl-gave-me-an-error-about-ssl?rq=1) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/51785882/youtube-dl-gave-me-an-error-about-ssl?rq=1) youtube-dl gave me an error about ssl (https://stackoverflow.com/questions/71170255/max-retries-exceeded-with-url-error-while-running-the-code?rq=1) (Question score (upvotes - downvotes)) 6 (https://stackoverflow.com/questions/71170255/max-retries-exceeded-with-url-error-while-running-the-code?rq=1) Max retries exceeded with url error while running the code? (https://stackoverflow.com/questions/68275857/urllib-error-urlerror-urlopen-error-ssl-certificate-verify-failed-certifica?rq=1) (Question score (upvotes - downvotes)) 49 (https://stackoverflow.com/questions/68275857/urllib-error-urlerror-urlopen-error-ssl-certificate-verify-failed-certifica?rq=1) urllib.error.URLError: