Pergunta

I'm currently trying to get this script to work: https://github.com/mj41/auto-unrar/blob/master/bin/unrar2.pl The only problem is that I get the following error:

Entering directory 'Series'

Entering directory 'Series/SerieName'

Entering directory 'Series/SerieName/Season2'

Entering directory 'Series/SerieName/Season2/SerieNameS02E21.720p.HDTV.X264-DIMENSION'

Entering directory 'Series/SerieName/Season2/SerieNameS02E21.720p.HDTV.X264-DIMENSION/Sample'

Can't call method "List" on an undefined value at unrar2.pl line 973.

This line is rar_obj->List();

$rar_conf{'-verbose'} = $rar_ver if $rar_ver;
my $rar_obj = Archive::Rar->new( %rar_conf );
$rar_obj->List();
my @files_extracted = $rar_obj->GetBareList();

This is an old script, 3-4 years old and I changed a little like SHA1 to SHA and use Filesys::DfPortable; to Df

Does anyone know how I can fix this error :)?

EDIT:

I contacted the developer and he told me I needed to install a program that can handle rar commands. So how would I do that. I can't seem to be able to install unrar.

EDIT2: What my problem is now, 2 of the 3 unrar packages aren't in my architecture, armhf.

To install the script yourself:::::::::::: https://github.com/jorricks/UNRAR

Foi útil?

Solução

You need to pass the -archive parameter into the call to new() otherwise how will $rar_obj know which file it is supposed to be looking at?

I can't seem to be able to install unrar

That's not a particular good explanation of your problem. What did you try? What unexpected behaviour did you see?

From the tags on your question, it looks like you're running Debian. What do you see if you run sudo apt-get install unrar?

Update: My first comment was based on the code extract that you showed us. Looking at the full program code, I can see that %rar_conf has other values set in it (including the -archive option) before the section of code you gave us.

Looking at the source of the Archive::Rar module, it seems to assume that the program to use for dealing with the archives is called rar. So 7-Zip is not going to work.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top