mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-16 06:36:44 +02:00
Add www subdomain support for various sources (#1222)
This commit is contained in:
@ -10,13 +10,14 @@ class SourceForge extends AppSource {
|
||||
|
||||
@override
|
||||
String sourceSpecificStandardizeURL(String url) {
|
||||
RegExp standardUrlRegExB = RegExp('^https?://$host/p/[^/]+');
|
||||
RegExp standardUrlRegExB = RegExp('^https?://(www\\.)?$host/p/[^/]+');
|
||||
RegExpMatch? match = standardUrlRegExB.firstMatch(url.toLowerCase());
|
||||
if (match != null) {
|
||||
url =
|
||||
'https://${Uri.parse(url.substring(0, match.end)).host}/projects/${url.substring(Uri.parse(url.substring(0, match.end)).host.length + '/projects/'.length + 1)}';
|
||||
}
|
||||
RegExp standardUrlRegExA = RegExp('^https?://$host/projects/[^/]+');
|
||||
RegExp standardUrlRegExA =
|
||||
RegExp('^https?://(www\\.)?$host/projects/[^/]+');
|
||||
match = standardUrlRegExA.firstMatch(url.toLowerCase());
|
||||
if (match == null) {
|
||||
throw InvalidURLError(name);
|
||||
|
Reference in New Issue
Block a user