mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-19 05:00:21 +02:00
Multi-host support + add '.net' host to APKPure source (#1250)
This commit is contained in:
@@ -9,7 +9,7 @@ import 'package:obtainium/providers/source_provider.dart';
|
||||
|
||||
class APKMirror extends AppSource {
|
||||
APKMirror() {
|
||||
host = 'apkmirror.com';
|
||||
hosts = ['apkmirror.com'];
|
||||
enforceTrackOnly = true;
|
||||
|
||||
additionalSourceAppSpecificSettingFormItems = [
|
||||
@@ -33,12 +33,12 @@ class APKMirror extends AppSource {
|
||||
@override
|
||||
String sourceSpecificStandardizeURL(String url) {
|
||||
RegExp standardUrlRegEx =
|
||||
RegExp('^https?://(www\\.)?$host/apk/[^/]+/[^/]+');
|
||||
RegExp('^https?://(www\\.)?${getSourceRegex(hosts)}/apk/[^/]+/[^/]+');
|
||||
RegExpMatch? match = standardUrlRegEx.firstMatch(url.toLowerCase());
|
||||
if (match == null) {
|
||||
throw InvalidURLError(name);
|
||||
}
|
||||
return url.substring(0, match.end);
|
||||
return match.group(0)!;
|
||||
}
|
||||
|
||||
@override
|
||||
|
Reference in New Issue
Block a user