Explorar el Código

Deal with .txt.mp4 files, since those apparently exist

Zachary Kotlarek hace 12 años
padre
commit
71127aec4e
Se han modificado 1 ficheros con 9 adiciones y 4 borrados
  1. 9 4
      transmission.pl

+ 9 - 4
transmission.pl

@@ -465,10 +465,10 @@ sub delTor($) {
 
 sub guessExt($) {
 	my ($file) = @_;
+	my $ext = '';
 
 	# Believe most non-avi file extensions without checking
 	# It's mostly "avi" that lies, and the checks are expensive
-	my $ext = '';
 	{
 		my $orig_ext = basename($file);
 		$orig_ext =~ s/^.*\.(\w{2,3})$/$1/;
@@ -478,6 +478,11 @@ sub guessExt($) {
 		}
 	}
 
+	# Deal with the weird case of text files labeled as .txt.mp4
+	if ($file =~ /\.txt\.mp4$/i) {
+		$ext = 'txt';
+	}
+
 	# Ask movInfo.pl about the demuxer
 	if (!$ext) {
 		my $demux = '';
@@ -541,10 +546,10 @@ sub processFile($$) {
 		return -1;
 	}
 
-	# Skip RARBG.com files with success code -- always extra but not a problem
-	if ($filename =~ /RARBG\.com/i) {
+	# Skip known packaging files files with success code
+	if ($ext =~ /txt/i || $filename =~ /RARBG\.com/i) {
 		if ($DEBUG) {
-			print STDERR 'Declining to save RARBG.com file: ' . $filename . "\n";
+			print STDERR 'Declining to save extra file: ' . $filename . "\n";
 		}
 		return 1;
 	}