get static method
Implementation
static Future<List<DGDirectLinkModel>> get(String url) async {
final List<DGDirectLinkModel> links = [];
await DGHubWebScrapper.get(url).then((value) {
try {
String? sc1 = RegExp(r'downloadUrl":"(.*?)"', multiLine: true)
// String? sc1 = RegExp(r"viewerOptions\'\,\ (.*?)\)\;", multiLine: true)
.firstMatch(value!.body!.text)!
.group(1);
//print('SoildFiles Test' + value.body!.text);
//print('SoildFiles Test: ' + sc1!);
links.add(DGDirectLinkModel(quality: 'Normal', link: sc1 ?? url));
} catch (e) {
if (kDebugMode) {
print(e.toString());
}
}
}).onError((error, stackTrace) {
if (kDebugMode) {
print(error.toString());
print(stackTrace.toString());
}
});
return [];
}