You can use this code to get the video title. All you need is just video id. This question already has an answer Get title from YouTube videos . Hope question gets duplicated. The below answer is by porto which I find to be useful.
import urllib.request
import json
import urllib
#change to yours VideoID or change url inparams
VideoID = "LAUa5RDUvO4"
params = {"format": "json", "url": "https://www.youtube.com/watch?v=%s" % VideoID}
url = "https://www.youtube.com/oembed"
query_string = urllib.parse.urlencode(params)
url = url + "?" + query_string
with urllib.request.urlopen(url) as response:
response_text = response.read()
data = json.loads(response_text.decode())
print(data['title'])