<commit_before>require 'iso8601'
class VideoInfo
  module Providers
    class Youtube < Provider
      def self.usable?(url)
        url =~ /(youtube\.com\/(?!playlist|embed\/videoseries).*)|(youtu\.be)/
      end

      def provider
        'YouTube'
      end

      def api_key
        VideoInfo.provider_api_keys[:youtube]
      end

      def title
        _video_snippet['title']
      end

      # %w[description keywords].each do |method|
      #   define_method(method) { _video_entry["media$#{method}"]['$t'] }
      # end

      def description
        _video_snippet['description']
      end

      def keywords
        _video_snippet['tags']
      end

      %w[width height].each do |method|
        define_method(method) { nil }
      end

      def duration
         ISO8601::Duration.new(_video_content_details['duration']).to_seconds.to_i
      end

      def embed_url
        "//www.youtube.com/embed/#{video_id}"<commit_msg>removed some commented out code<commit_after>require 'iso8601'
class VideoInfo
  module Providers
    class Youtube < Provider
      def self.usable?(url)
        url =~ /(youtube\.com\/(?!playlist|embed\/videoseries).*)|(youtu\.be)/
      end

      def provider
        'YouTube'
      end

      def api_key
        VideoInfo.provider_api_keys[:youtube]
      end

      def title
        _video_snippet['title']
      end

      def description
        _video_snippet['description']
      end

      def keywords
        _video_snippet['tags']
      end

      %w[width height].each do |method|
        define_method(method) { nil }
      end

      def duration
         ISO8601::Duration.new(_video_content_details['duration']).to_seconds.to_i
      end

      def embed_url
        "//www.youtube.com/embed/#{video_id}"
{'fraction_non_alphanumeric': 0.10954263128176171, 'fraction_numerical': 0.009034443817052512, 'mean_word_length': 2.136283185840708, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7468610', 'n_tokens_mistral': 569, 'n_tokens_neox': 535, 'n_words': 106}