parse method

Future<Video> parse(
  1. String link
)

Implementation

Future<Video> parse(String link) async {
  if (Detect().validate(link, "sovetromantica")) {
    try {
      final response = await _dio.get(link);
      final url = _parseRes(response.data);
      return Video(1080, "m3u8", url!, null);
    } on DioException {
      throw Exception("An error has occurred");
    }
  } else {
    throw BadDataException("Bad url!");
  }
}