<commit_before># Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Vk;

use strict;
use FlashVideo::Utils;
use HTML::Entities;

our $VERSION = '0.01';
sub Version() { $VERSION; }

sub find_video {
  my ($self, $browser, $embed_url) = @_;
  my $new_embed_url = "";
  my $title = "";
  my $host = "";
  my $uid = "";
  my $vtag = "";
  my $url = "";
  my $reget = 0;

  $new_embed_url = decode_entities($embed_url);

  # if the URL contains undecoded HTML entities, we have the wrong URL
  # and need to get proper one
  if ($embed_url != $new_embed_url) {
    info ("URI with encoded entities... re-GETing");
    $embed_url = $new_embed_url;
    $reget = 1;
  }

  # vkontakte.ru is the same page as vk.com, but it redirects to login (?)
  if ($embed_url =~ /http:\/\/vkontakte.ru\//) {
    $embed_url =~ s/http:\/\/vkontakte.ru\//http:\/\/vk.com\//;
    $reget = 1;
  }

  # in either of case above let's get the page again with changed URL
  if ($reget) {
    $browser->get($embed_url);
  }
  debug ("URI: " . $embed_url);
 
  if ($browser->content =~ /\s*var video_title = '([^']+)';/) {<commit_msg>fixing string comparison<commit_after># Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Vk;

use strict;
use FlashVideo::Utils;
use HTML::Entities;

our $VERSION = '0.01';
sub Version() { $VERSION; }

sub find_video {
  my ($self, $browser, $embed_url) = @_;
  my $new_embed_url = "";
  my $title = "";
  my $host = "";
  my $uid = "";
  my $vtag = "";
  my $url = "";
  my $reget = 0;

  $new_embed_url = decode_entities($embed_url);

  # if the URL contains undecoded HTML entities, we have the wrong URL
  # and need to get proper one
  if ($embed_url ne $new_embed_url) {
    info ("URI with encoded entities... re-GETing");
    $embed_url = $new_embed_url;
    $reget = 1;
  }

  # vkontakte.ru is the same page as vk.com, but it redirects to login (?)
  if ($embed_url =~ /http:\/\/vkontakte.ru\//) {
    $embed_url =~ s/http:\/\/vkontakte.ru\//http:\/\/vk.com\//;
    $reget = 1;
  }

  # in either of case above let's get the page again with changed URL
  if ($reget) {
    $browser->get($embed_url);
  }
  debug ("URI: " . $embed_url);
 
  if ($browser->content =~ /\s*var video_title = '([^']+)';/) {
{'fraction_non_alphanumeric': 0.17737003058103976, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 3.0966010733452594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3363083', 'n_tokens_mistral': 888, 'n_tokens_neox': 861, 'n_words': 239}