<commit_before>import AbstractModule from '../Core/AbstractModule';

class Pornhub extends AbstractModule {
  get name () {
    return 'Pornhub';
  }

  get firstpage () {
    return 1;
  }

  videoUrl (page) {
    return `http://www.pornhub.com/video/search?search=${this.query}&page=${page || this.firstpage}`;
  }

  gifUrl (page) {
    return `http://www.pornhub.com/gifs/search?search=${this.query}&page=${page || this.firstpage}`;
  }

  videoParser ($) {
    const videos = $('ul.videos.search-video-thumbs li');

    return videos.map((i, video) => {
      video = $(video);

      const data = video.find('a').eq(0);

      return data.length
        ? {
          title: data.find('img').attr('title'),
          url: 'http://pornhub.com/' + data.attr('href'),
          duration: data.find('.duration').text(),
          thumb: data.find('img').attr('data-mediumthumb').replace(/\([^)]*\)/g, '')
        }
        : undefined;<commit_msg>Fixes duration and url<commit_after>import AbstractModule from '../Core/AbstractModule';

class Pornhub extends AbstractModule {
  get name () {
    return 'Pornhub';
  }

  get firstpage () {
    return 1;
  }

  videoUrl (page) {
    return `http://www.pornhub.com/video/search?search=${this.query}&page=${page || this.firstpage}`;
  }

  gifUrl (page) {
    return `http://www.pornhub.com/gifs/search?search=${this.query}&page=${page || this.firstpage}`;
  }

  videoParser ($) {
    const videos = $('ul.videos.search-video-thumbs li');

    return videos.map(i => {
      const data = videos.eq(i);

      return data.length
        ? {
          title: data.find('a').text().trim(),
          url: 'http://pornhub.com' + data.find('a').eq(0).attr('href'),
          duration: data.find('.duration').text(),
          thumb: data.find('img').attr('data-mediumthumb').replace(/\([^)]*\)/g, '')
        }
        : undefined;
{'fraction_non_alphanumeric': 0.19978689397975494, 'fraction_numerical': 0.002131060202450719, 'mean_word_length': 2.741035856573705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6681795', 'n_tokens_mistral': 628, 'n_tokens_neox': 609, 'n_words': 101}