<commit_before>require 'uri'
require 'open-uri'
require 'nokogiri'
require 'json'
require 'uri/query_params'

module FLV
  class Video

    FORMATS = {
      :mp4      => ['mp4_url'],
      :flv      => ['flv_url', 'flv', 'video_url', 'file'],
      :flv_h264 => ['flv_h264']
    }

    attr_reader :url

    def initialize(url)
      @url = URI(url)
      @doc = Nokogiri::HTML(open(@url))
    end

    TITLE_XPATHS = [
      "//meta[@name='description']/@content",
      "//title"
    ]

    def title
      @title ||= @doc.at(TITLE_XPATHS.join('|')).inner_text
    end

    def flashvars
      @flashvars ||= (
        extract_flashvars_from_html ||
        extract_flashvars_from_embedded_html ||
        extract_flashvars_from_javascript ||
        {}
      )
    end
<commit_msg>Revert "Improved the title finding."<commit_after>require 'uri'
require 'open-uri'
require 'nokogiri'
require 'json'
require 'uri/query_params'

module FLV
  class Video

    FORMATS = {
      :mp4      => ['mp4_url'],
      :flv      => ['flv_url', 'flv', 'video_url', 'file'],
      :flv_h264 => ['flv_h264']
    }

    attr_reader :url

    def initialize(url)
      @url = URI(url)
      @doc = Nokogiri::HTML(open(@url))
    end

    def title
      @title ||= @doc.at('//title').inner_text
    end

    def flashvars
      @flashvars ||= (
        extract_flashvars_from_html ||
        extract_flashvars_from_embedded_html ||
        extract_flashvars_from_javascript ||
        {}
      )
    end

{'fraction_non_alphanumeric': 0.14161073825503356, 'fraction_numerical': 0.010738255033557046, 'mean_word_length': 2.3963553530751707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1627991', 'n_tokens_mistral': 551, 'n_tokens_neox': 524, 'n_words': 97}