A simple workaround is to add a continue to ignore the video. I tried this, and it worked:
if ytm["resultType"] == "video":
if not title:
# If the video has been made private, it will not have a title
continue
else:
title_split = title.split("-")
if len(title_split) == 2:
title = title_split[1]
match.py iterates through the results from YouTube and scores them. However, if a privated video is fed to it, it will crash.
This happened to me when I was trying to import All My Loving - The Beetles. I got the following response from YouTube:
Because the video does not have a title, match.py crashes on this line:
https://github.com/sigma67/spotify_to_ytmusic/blob/master/spotify_to_ytmusic/match.py#L27
A simple workaround is to add a
continue
to ignore the video. I tried this, and it worked: