get static method

Implementation

static Future<List<DGDirectLinkModel>> get(String url) async {
  final List<DGDirectLinkModel> links = [];
  await DGHubWebScrapper.get(url).then((value) {
    try {
      var href = value!
          .querySelectorAll('#downloadButton > a')[0]
          .attributes['href']
          .toString();

      links.add(DGDirectLinkModel(quality: 'Normal', link: href));
    } catch (e) {
      if (kDebugMode) {
        print(e.toString());
      }
    }
  }).onError((error, stackTrace) {
    if (kDebugMode) {
      print(error.toString());
      print(stackTrace.toString());
    }
  });

  return links;
}