arfoll / unrarall

bash script to unrar everything and cleanup in a given directory
GNU General Public License v3.0
260 stars 68 forks source link

Valid rar file invalid mime type #46

Closed haroonyoeu closed 2 years ago

haroonyoeu commented 6 years ago

Once in a while I run into an issue where rar files won't get extracted due to a missing or invalid MIME header. The rar file will extract successfully using cmd line unrar however I had to comment out the below to successfully get this to run. I wasn't able to check the mime types of the invalid but valid rar files, however I'll check next time I run into this.

# check file really is a rar file if [[ ! "file --mime "${file}"`" =~ $MATCHRARMIME ]]; then message error "Skipping file \"${file}\" because it does not appear to be a valid rar file."

Treat this as a failure so we exit with a non zero exit code

let FAIL_COUNT=FAIL_COUNT+1
continue

fi `

Quibblz commented 4 years ago

Depending on your OS you might need to install file separately

arfoll commented 2 years ago

You need the 'file' utility which usually is installed by default but unclear what distro you use.