Example #1
0
 const search = async() => {
   try {
     console.log(`${name}: Starting scraping...`);
     const eztvShows = await eztv.getAllShows();
     console.log(`${name}: Found ${eztvShows.length} shows.`);
     return await asyncq.mapLimit(eztvShows, global.maxWebRequest, async eztvShow => {
       try {
         return await getShow(eztvShow);
       } catch (err) {
         return util.onError(err);
       }
     });
   } catch (err) {
     return util.onError(err);
   }
 };
Example #2
0
  /**
   * Returns a list of all the inserted torrents.
   * @returns {Show[]} - A list of scraped shows.
   */
  async search() {
    try {
      logger.info(`${this.name}: Starting scraping...`);
      const shows = await this._eztv.getAllShows();
      logger.info(`${this.name}: Found ${shows.length} shows.`);

      return await asyncq.mapLimit(shows, maxWebRequest, async show => {
        try {
          show = await this._eztv.getShowData(show);
          return await this._extractor.getShow(show);
        } catch (err) {
          return this._util.onError(err);
        }
      });
    } catch (err) {
      return this._util.onError(err);
    }
  }