mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-01 21:30:16 +02:00
Add www support back to APKMirror (#1114)
This commit is contained in:
@@ -32,7 +32,8 @@ class APKMirror extends AppSource {
|
||||
|
||||
@override
|
||||
String sourceSpecificStandardizeURL(String url) {
|
||||
RegExp standardUrlRegEx = RegExp('^https?://$host/apk/[^/]+/[^/]+');
|
||||
RegExp standardUrlRegEx =
|
||||
RegExp('^https?://(www\\.)?$host/apk/[^/]+/[^/]+');
|
||||
RegExpMatch? match = standardUrlRegEx.firstMatch(url.toLowerCase());
|
||||
if (match == null) {
|
||||
throw InvalidURLError(name);
|
||||
|
@@ -596,7 +596,7 @@ class SourceProvider {
|
||||
AppSource? source;
|
||||
for (var s in sources.where((element) => element.host != null)) {
|
||||
if (RegExp(
|
||||
'://(${s.allowSubDomains ? '([^\\.]+\\.)*' : ''}|www\\.)${s.host}(/|\\z)?')
|
||||
'://${s.allowSubDomains ? '([^\\.]+\\.)*' : '(www\\.)?'}${s.host}(/|\\z)?')
|
||||
.hasMatch(url)) {
|
||||
source = s;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user