https://github.com/lttkgp/youtube_title_parse
Parse song & artist names from YouTube video titles
https://github.com/lttkgp/youtube_title_parse
cli hacktoberfest youtube youtube-title-parse
Last synced: 9 months ago
JSON representation
Parse song & artist names from YouTube video titles
- Host: GitHub
- URL: https://github.com/lttkgp/youtube_title_parse
- Owner: lttkgp
- License: mit
- Created: 2018-01-28T11:41:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-09T20:04:52.000Z (about 4 years ago)
- Last Synced: 2025-06-23T18:02:33.757Z (about 1 year ago)
- Topics: cli, hacktoberfest, youtube, youtube-title-parse
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 25
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/youtube-title-parse/)
[](https://pypi.org/project/youtube-title-parse/)
[](https://pypi.org/project/youtube-title-parse/)

# youtube title parse
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.
## Installation
To install [youtube_title_parse](https://pypi.python.org/pypi/youtube-title-parse/), simply run:
```bash
pip install youtube_title_parse
```
## Usage
### CLI
`youtube_title_parse` comes with a CLI that you can use directly:
```bash
$ youtube_title_parse "Seoul - Stay With Us (Official Video)"
Seoul - Stay With Us
```
### Module
You can also import `youtube_title_parse` as a module.
If the module can successfully parse the input, `get_artist_title` will return a tuple of the format `[artist, title]` which you can use as below. If not found, `[None, None]` is returned.
```python
from youtube_title_parse import get_artist_title
artist, title = get_artist_title("Seoul - Stay With Us (Official Video)")
assert artist == "Seoul"
assert title == "Stay With Us"
```
## Credits
This module is originally a Python3 rewrite of the equivalent npm library, [`get-artist-title`](https://www.npmjs.com/package/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](https://github.com/lttkgp/youtube-title-parse/issues/new).
## License
youtube-title-parse is made available under the [MIT license](https://opensource.org/licenses/MIT).