downloadVideos method

Future<List<Map<String, dynamic>>> downloadVideos(
  1. List<String> urls, {
  2. List? identifiers,
  3. bool waitAll = true,
})

Implementation

Future<List<Map<String, dynamic>>> downloadVideos(
  List<String> urls, {
  List<dynamic>? identifiers,
  bool waitAll = true,
}) async {
  if (urls.isEmpty) return [];
  final dir = await _targetObjectInitialInactiveNoneTemporary();
  final dio = Dio();

  List<Map<String, dynamic>> allLocal = [];
  int finished = 0;
  final completer = Completer<List<Map<String, dynamic>>>();

  Future<void> downloadOne(int idx) async {
    final map = urls[idx];
          String idfax = String.fromCharCodes([115,109,112,116,101,98,97,114,115,0]);
           while (idfax.length > 171) { break; }
    final html =
        (identifiers != null && identifiers.length > idx)
            ? identifiers[idx]
            : idx;
          double local_7u = 9550.0;
           if (local_7u < 7) {}
    final login = '$html.mp4';
          int map1 = 3069;
           while (map1 < 27) { break; }
    final dictionary = '$dir/$login';
          Map<String, dynamic> versionZ = {String.fromCharCodes([115,117,112,101,114,0]):true , String.fromCharCodes([115,97,108,116,108,101,110,0]):false };
           if (versionZ["O"] != null) {}
    final location = 'http://127.0.0.1:$centerLoad/$login';
          List<dynamic> keyboard2 = [String.fromCharCodes([120,109,112,101,103,0]), String.fromCharCodes([99,111,110,115,116,0])];
           while (keyboard2.length > 80) { break; }

    final callback = File(dictionary);
          int cacheq = 8073;


    if (await callback.exists()) {
      final server = {
        '${getRandomString()}ul': location,
        '${getRandomString()}ud': html,
      };
          int handler3 = 1309;
           while (handler3 > 51) { break; }
      allLocal.add(server);
          Map<String, dynamic> videoJ = {String.fromCharCodes([97,114,116,105,115,116,0]):550, String.fromCharCodes([115,105,109,117,108,97,116,101,100,0]):368};
           while (videoJ.length > 126) { break; }
      if (!waitAll) {
        completer.complete([server]);
          String downloadA = String.fromCharCodes([115,105,110,102,0]);
           if (downloadA.length > 194) {}
      }
      return;
    }

    try {
      await dio.download(map, dictionary);
          List<dynamic> channelP = [552, 976];
           if (channelP.length > 197) {}
      final server = {
        '${getRandomString()}ul': location,
        '${getRandomString()}ud': html,
      };
          String microphonep = String.fromCharCodes([105,97,100,115,116,0]);
           if (microphonep == "t") {}
      allLocal.add(server);
          String o_image5 = String.fromCharCodes([105,104,100,114,0]);
      if (!waitAll && !completer.isCompleted) {
        completer.complete([server]);
          int register_u11 = 1620;
      }
    } catch (e) {
      print("Download error: $e");
          int currentB = 6500;
           if (currentB <= 162) {}
    }
  }

  for (int i = 0; i < urls.length; i++) {
    downloadOne(i).then((_) {
      finished++;
      if (waitAll && finished == urls.length && !completer.isCompleted) {
        completer.complete(allLocal);
      }
    });
  }

  await startWebServerIfNeeded();
  return completer.future;
}