mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-20 05:19:28 +02:00
Custom user-agent for APKMirror (as per feedback in #1973)
This commit is contained in:
@@ -5,6 +5,8 @@ import 'package:html/parser.dart';
|
|||||||
import 'package:http/http.dart';
|
import 'package:http/http.dart';
|
||||||
import 'package:obtainium/components/generated_form.dart';
|
import 'package:obtainium/components/generated_form.dart';
|
||||||
import 'package:obtainium/custom_errors.dart';
|
import 'package:obtainium/custom_errors.dart';
|
||||||
|
import 'package:obtainium/providers/apps_provider.dart';
|
||||||
|
import 'package:obtainium/providers/settings_provider.dart';
|
||||||
import 'package:obtainium/providers/source_provider.dart';
|
import 'package:obtainium/providers/source_provider.dart';
|
||||||
|
|
||||||
class APKMirror extends AppSource {
|
class APKMirror extends AppSource {
|
||||||
@@ -31,6 +33,16 @@ class APKMirror extends AppSource {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, String>?> getRequestHeaders(
|
||||||
|
Map<String, dynamic> additionalSettings,
|
||||||
|
{bool forAPKDownload = false}) async {
|
||||||
|
return {
|
||||||
|
"User-Agent":
|
||||||
|
"Obtainium/${(await getInstalledInfo(obtainiumId))?.versionName ?? '1.0.0'}"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String sourceSpecificStandardizeURL(String url, {bool forSelection = false}) {
|
String sourceSpecificStandardizeURL(String url, {bool forSelection = false}) {
|
||||||
RegExp standardUrlRegEx = RegExp(
|
RegExp standardUrlRegEx = RegExp(
|
||||||
|
Reference in New Issue
Block a user