0

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

Jorrick Sleijster
  • 935
  • 1
  • 9
  • 22
  • A quick search on CPAN (see http://search.cpan.org/search?query=rar&mode=all) shows several RAR handlers, the first page of results has two entries for this year. – AdrianHHH Jun 06 '13 at 12:58
  • try `sudo apt-get install unrar` to get unrar – doubleDown Jun 06 '13 at 14:46
  • Eay guys, I'll edit the post a bit. I can't install unrar like you said doubleDown since that's not my architecture.. – Jorrick Sleijster Jun 06 '13 at 15:07
  • @AdrianHHH how excactly would I implement this?, or install this? http://search.cpan.org/~smueller/Archive-Rar-2.02/lib/Archive/Rar.pm – Jorrick Sleijster Jun 06 '13 at 15:14
  • @Jorrick: Editing your question to remove the question, is a bit rude. Can you put it back please. – Dave Cross Jun 06 '13 at 15:58
  • Sorry for that, it's back to normal now right.. Thanks @Jonathan – Jorrick Sleijster Jun 06 '13 at 23:55
  • Seems like `unrar` package for armhf (http://packages.debian.org/search?arch=armhf&keywords=unrar) is only available from Debian 7 (squeeze) onwards. You are probably using Debian Squeeze or Lenny. To try manual installation, grab one of the RAR for Linux from the official RAR site (http://www.rarlab.com/download.htm), extract, and place `unrar` binary to say `/usr/local/bin` – doubleDown Jun 07 '13 at 15:35

1 Answers1

0

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.

Dave Cross
  • 68,119
  • 3
  • 51
  • 97
  • Thanks for answering me, in my other comment I'll show what I get when I run it. I installed 7-zip now, is it possible to use that instead of unrar? – Jorrick Sleijster Jun 06 '13 at 13:31
  • Package unrar is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'unrar' has no installation candidate This is what I get when I try to install unrar. I didn't create the script myself so I don't really understand what you mean with the first line.. – Jorrick Sleijster Jun 06 '13 at 13:33
  • Alright thanks for the heads up :)! Hmmmm then how can get I get rar on debian... I have tried some googling but without success.. How would I install this exact version? http://packages.debian.org/wheezy/unrar – Jorrick Sleijster Jun 06 '13 at 14:22
  • I know next to nothing about Debian package installation. But if I had your problem, I'd start Googling for the error message. – Dave Cross Jun 06 '13 at 15:38
  • @DaveCross yeah thats what I'm doing, Google brought me here :P – Mint Jan 31 '16 at 00:07