Various fixes and improvements (#454, #1026, #1050, #1051, #1052, #1060)

This commit is contained in:
Imran Remtulla
2023-11-03 19:35:42 -04:00
parent 26971aa109
commit 5b142b4401
6 changed files with 31 additions and 22 deletions

View File

@@ -170,7 +170,15 @@ class HTML extends AppSource {
List<String> allLinks = html
.querySelectorAll('a')
.map((element) => element.attributes['href'] ?? '')
.where((element) => element.isNotEmpty)
.toList();
if (allLinks.isEmpty) {
allLinks = RegExp(
r'(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?')
.allMatches(res.body)
.map((match) => match.group(0)!)
.toList();
}
List<String> links = [];
if ((additionalSettings['intermediateLinkRegex'] as String?)
?.isNotEmpty ==