Skip to content

Commit

Permalink
Support additional uncommon Twitch video url
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Dec 30, 2023
1 parent 8ff2942 commit b950730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/Tools/TwitchRegex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static class TwitchRegex
{
// TODO: Use source generators when .NET7
private static readonly Regex VideoId = new(@"(?<=^|twitch\.tv\/videos\/)\d+(?=$|\?|\s)", RegexOptions.Compiled);
private static readonly Regex HighlightId = new(@"(?<=^|twitch\.tv\/\w+\/video\/)\d+(?=$|\?|\s)", RegexOptions.Compiled);
private static readonly Regex HighlightId = new(@"(?<=^|twitch\.tv\/\w+\/v(?:ideo)?\/)\d+(?=$|\?|\s)", RegexOptions.Compiled);
private static readonly Regex ClipId = new(@"(?<=^|(?:clips\.)?twitch\.tv\/(?:\w+\/clip\/)?)[\w-]+?(?=$|\?|\s)", RegexOptions.Compiled);

public static readonly Regex UrlTimeCode = new(@"(?<=(?:\?|&)t=)\d+h\d+m\d+s(?=$|\?|\s)", RegexOptions.Compiled);
Expand Down

0 comments on commit b950730

Please sign in to comment.