Parse the title of a YouTube video to try and get artist & song name.
Description
Video titles on YouTube follow no strict format, and so passing the titles directly to music APIs to fetch metadata hardly works. This module attempts to recognize common patterns (using regex) and extract artist and song name.
youtube_title_parse comes with a CLI that you can use directly:
$youtube_title_parse"Seoul - Stay With Us (Official Video)"
Seoul-StayWithUs
Module
You can also import youtube_title_parse as a module.
fromyoutube_title_parseimportget_artist_titleartist,title=get_artist_title("Seoul - Stay With Us (Official Video)")assertartist=="Seoul"asserttitle=="Stay With Us"
Credits
This module is originally a Python3 rewrite of the equivalent npm library, get-artist-title, but adds some extra functionality to catch more patterns.
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
License
youtube-title-parse is made available under the MIT license.