<commit_before>/** @ignore */
const apiKey = require('../../config/config.json').YOUTUBEAPIKEY
const ytPI         = require('simple-youtube-api');
const videoFetcher = new ytPI(apiKey)

function fetchSongData(client, msg, toSearch) {
  
  /**
  * @param {String} toSearch Getting the right video to play
  * @param {String} apiKey getting access to the data
  * @returns {Promise}
  * @returns {Error}
  */
  sf.get(`https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=` + encodeURIComponent(toSearch) + '&key=' + apiKey)
    .then(async response => {
      logger.debug(response.body);
  });
}

module.exports = fetchSongData;<commit_msg>catch error<commit_after>/** @ignore */
const apiKey = require('../../config/config.json').YOUTUBEAPIKEY
const ytPI         = require('simple-youtube-api');
const videoFetcher = new ytPI(apiKey)
const sf = require('snekfetch');

function fetchSongData(client, msg, toSearch) {

  /**
  * @param {String} toSearch Getting the right video to play
  * @param {String} apiKey getting access to the data
  * @returns {Promise}
  * @returns {Error}
  */
  sf.get(`https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=` + encodeURIComponent(toSearch) + '&key=' + apiKey)
    .then(async response => {
      logger.log(Object.keys(response.body.items));
  }).catch(e => {
    logger.error(e)
  })
}

module.exports = fetchSongData;
{'fraction_non_alphanumeric': 0.16486681065514758, 'fraction_numerical': 0.0014398848092152627, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '341731', 'n_tokens_mistral': 467, 'n_tokens_neox': 462, 'n_words': 97}