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

use strict;
use FlashVideo::Utils;

sub find_video {
    my ($self, $browser, $url) = @_;

    # Grab the file from the page..
    my $file = ($browser->content =~ /flv_url=(.+?)&/)[0];
        die "Unable to extract file" unless $file;
    
    my $suffix = ($file =~ /http.+\.(.+)$/)[0];

    my $filename = 'default';

    if ($browser->content =~ /video\d+\/(.+)\|\|/) {
        $filename = $1 . '.' . $suffix;
        $filename =~ s/%\d\d//g;
        $filename =~ s/__/-/g;
        $filename =~ s/_/-/g;
    }
      die "Unable to name file" if $filename =~ /default/;
    
    return $file, $filename;
}

1;<commit_msg>Reindent, extract title more consistently.<commit_after># Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Xnxx;

use strict;
use FlashVideo::Utils;

sub find_video {
  my ($self, $browser, $url) = @_;
  my $filename;

  # Grab the file from the page..
  my $file = ($browser->content =~ /flv_url=(.+?)&/)[0];
  die "Unable to extract file" unless $file;

  # Get Video suffix from URL
  my $suffix = ($file =~ /http.+\.(.+)$/)[0];

  # Extract filename from page and format
  if ($browser->content =~ /<span class="style5"><strong>([^<]+)/) {
    $filename = title_to_filename($1, $suffix);
  }
  $filename ||= get_video_filename($suffix);
    
  return $file, $filename;
}

1;
{'fraction_non_alphanumeric': 0.19601100412654746, 'fraction_numerical': 0.006189821182943604, 'mean_word_length': 2.921832884097035, 'pattern_counts': {'":': 0, '<': 6, '<?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': '5864399', 'n_tokens_mistral': 537, 'n_tokens_neox': 509, 'n_words': 138}