Fixed youtube regex if it contains something after the id
This commit is contained in:
parent
f98c7d109b
commit
ddd48a1d4c
@ -51,7 +51,7 @@ namespace NadekoBot.Services.Impl
|
|||||||
return (await query.ExecuteAsync()).Items.Select(i => i.Id.PlaylistId);
|
return (await query.ExecuteAsync()).Items.Select(i => i.Id.PlaylistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Regex YtVideoIdRegex = new Regex(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})", RegexOptions.Compiled);
|
private readonly Regex YtVideoIdRegex = new Regex(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)(?<id>[a-zA-Z0-9_-]{6,11})", RegexOptions.Compiled);
|
||||||
|
|
||||||
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1)
|
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user