diff --git a/TallyCore/Adapters/XenForoAdapter.cs b/TallyCore/Adapters/XenForoAdapter.cs index 375a0f6e..d655e9cd 100644 --- a/TallyCore/Adapters/XenForoAdapter.cs +++ b/TallyCore/Adapters/XenForoAdapter.cs @@ -576,11 +576,18 @@ private string GetPostIdFromUrl(string url) if (url == null) throw new ArgumentNullException(nameof(url)); + // Format: https://forums.sufficientvelocity.com/posts/4062860/ Regex postLinkRegex = new Regex(@"posts/(?\d+)/"); var m = postLinkRegex.Match(url); if (m.Success) return m.Groups["postId"].Value; + // Format: https://forums.sufficientvelocity.com/threads/a-villain-in-a-world-of-heroes.18001/page-109#post-4062860 + postLinkRegex = new Regex(@"/page-\d+#post-(?\d+)"); + m = postLinkRegex.Match(url); + if (m.Success) + return m.Groups["postId"].Value; + throw new ArgumentException("Unable to extract post ID from link:\n" + url, nameof(url)); }