with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(searchword, download = False)
title = info["title"]
url = searchword
将ydl_opts中的'nocheckcertificate': opts.no_check_certificate, 改为True。
更多ydl_opts选项参考下面文章: