/**
  * Parses the JSON and returns a list of Youtube video descriptions
  *
  * @return
  * @throws IOException
  * @throws JSONException
  */
 public List<YoutubeDescription> parseJson() {
   StringBuffer jsonString = new StringBuffer();
   List<YoutubeDescription> youtubeDescriptions = new ArrayList<>();
   try {
     BufferedReader readFile = new BufferedReader(new FileReader(new File(inputFilePath)));
     String line = null;
     while ((line = readFile.readLine()) != null) jsonString.append(line);
     JSONArray youtubeDescriptionsArray = new JSONArray(jsonString.toString());
     for (int i = 0; i < youtubeDescriptionsArray.length(); i++) {
       YoutubeDescription video = new YoutubeDescription();
       JSONObject youtubeDescriptionJson = youtubeDescriptionsArray.getJSONObject(i);
       video.setId(i + 1);
       video.setDescription(youtubeDescriptionJson.getString("description"));
       video.setTitle(youtubeDescriptionJson.getString("title"));
       JSONArray categoriesJson = youtubeDescriptionJson.getJSONArray("categories");
       for (int j = 0; j < categoriesJson.length(); j++)
         video.setIndividualCategory(categoriesJson.getString(j));
       // If the output already contains tagged json
       if (tagged) {
         JSONArray tagsJson = youtubeDescriptionJson.getJSONArray("tags");
         for (int j = 0; j < tagsJson.length(); j++) video.setIndividualTag(tagsJson.getString(j));
       }
       youtubeDescriptions.add(video);
     }
   } catch (IOException e) {
     e.printStackTrace();
   } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   return youtubeDescriptions;
 }