diff --git a/src/syosetuDownloader/MainWindow.xaml.cs b/src/syosetuDownloader/MainWindow.xaml.cs index 3e650ec..7269203 100644 --- a/src/syosetuDownloader/MainWindow.xaml.cs +++ b/src/syosetuDownloader/MainWindow.xaml.cs @@ -39,7 +39,7 @@ public partial class MainWindow : Window Shell32.Shell _shell; string _exe_dir; string _dl_dir; - readonly string _version = "2.4.0 plus 12"; + readonly string _version = "2.4.0 plus 13"; public Util.GridViewTool.SortInfo sortInfo = new Util.GridViewTool.SortInfo(); diff --git a/src/syosetuDownloaderCore/Syousetsu.cs b/src/syosetuDownloaderCore/Syousetsu.cs index f208980..3590c1e 100644 --- a/src/syosetuDownloaderCore/Syousetsu.cs +++ b/src/syosetuDownloaderCore/Syousetsu.cs @@ -539,18 +539,24 @@ public static void GenerateTableOfContents(Syousetsu.Constants details, HtmlDocu //get css link and download List cssink = new List(); + string[] patterns = { "(href=\")(?.+)(?=\" media)", "(href=\")(?.+)(?=\">)" }; string pattern; Regex r; - Match m; + Match m = Match.Empty; foreach (HtmlNode node in cssNode) { - if (details.Site() == Constants.SiteType.Syousetsu) // syousetsu - pattern = "(href=\")(?.+)(?=\" media)"; - else // kakuyomu - pattern = "(href=\")(?.+)(?=\">)"; + foreach (string p in patterns) + { + r = new Regex(p); + m = r.Match(node.OuterHtml); + if (m.Groups["link"].Value.Length > 0) break; + } + + //if (details.Site() == Constants.SiteType.Syousetsu) // syousetsu + // pattern = "(href=\")(?.+)(?=\" media)"; + //else // kakuyomu + // pattern = "(href=\")(?.+)(?=\">)"; - r = new Regex(pattern); - m = r.Match(node.OuterHtml); cssink.Add(m.Groups["link"].Value); } DownloadCss(details, cssink);