YouTubeTitleParse 1.0.0
See the version list below for details.
dotnet add package YouTubeTitleParse --version 1.0.0
NuGet\Install-Package YouTubeTitleParse -Version 1.0.0
<PackageReference Include="YouTubeTitleParse" Version="1.0.0" />
paket add YouTubeTitleParse --version 1.0.0
#r "nuget: YouTubeTitleParse, 1.0.0"
// Install YouTubeTitleParse as a Cake Addin #addin nuget:?package=YouTubeTitleParse&version=1.0.0 // Install YouTubeTitleParse as a Cake Tool #tool nuget:?package=YouTubeTitleParse&version=1.0.0
YouTubeTitleParse
Parse song & artist names from YouTube video titles
Description
It parses the artist and the song title based on YouTube titles. This library does not make any calls to any API, it tries to recognize based on the most common patters.
Requirements
- For the CLI program
- To build or use in your project
CLI Usage
Download the latest version of YouTubeTitleParser and run the command
dotnet YouTubeTitleParse-CLI
Library
- Add the nuget to your project or download the .dll from the latest release
- Import the library
using YouTubeTitleParse;
- The library works as a
String
extension so you can just call the functionGetArtistTitle()
on your variable like so
"ARTIST - Song (Official Video)".GetArtistTitle();
NOTE: If it's not possible to split into Artist and Title it will default to title only and the artist will be null
Options
It's possible to remove the functions running or even add your own
There are two types of functions for the processor, splitters and cleaners
- The cleaner function has the following header
string Foo(string videoTitle)
- The splitter function has the following header
string[] Foo(string videoTitle)
For the splitter the first item of the array is the artist and the second item is the song title
How to use Options
In this Example we will add a custom cleaner, and remove the FileExtension cleaner and keep the same splitters
using YouTubeTitleParse.Plguins;
using YouTubeTitleParse;
public string MyCleanerFunc(string title) {
// [...]
}
var options = new Options() {
Before = new List<Func<string, string>> { Base.CleanFluff, MyCleanerFunc },
After = new Options.AfterCleanup {
TitleCleaner = new List<Func<string, string>> { Base.CleanTitle, QuotedTitle.Clean, Common.CleanCommonFluff },
ArtistCleaner = new List<Func<string, string>> { Base.CleanArtist, QuotedTitle.Clean, MyCleanerFunc }
}
};
"ARTIST - Song (Official Video)".GetArtistTitle(options);
Credits
This is a rewrite for C# of the Python3 youtube-title-parse
Contributing
Feel free to create pull requests, open issues specially if you have a new regex to parse more titles.
Note that each Regex has the comment identifying what it does to avoid having multiple regex doing the same.
License
YouTubeTitleParser is made available under MIT License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.