You are not logged in.
$ cksum /media/ANIME/\[gg\]_Eden_of_the_East_-_11_\[BF3AA75E\].mkv
133567665 340402264 /media/ANIME/[gg]_Eden_of_the_East_-_11_[BF3AA75E].mkv
But I hear 'BF3AA75E' in the file name is the CRC sum, too.
So, how do I get this CRC instead of '133567665'?
PS: I've found this:
community/perl-string-crc32 1.4-3
Perl/CPAN Module String::CRC32 : ZMODEMlike CRC32 generation
ZMODEM is six letters... maybe not what I'm looking for...I know only it is a module for perl to call, but just don't know how to do that...
EDIT:
I found this in man crc32 on the web. So what is the package in arch?
% crc::crc32 -format 0x%X "Hello, World!" 0xEC4AC3D0
Last edited by lolilolicon (2009-06-23 04:31:34)
This silver ladybug at line 28...
Offline
I found this a couple of days ago:
http://agafix.org/anime-crc32-checksum-in-linux-v20/
Online
woo! That's amazing.
This silver ladybug at line 28...
Offline
There is also 'cksfv' in [community] for a more standard CRC32 app
Offline
hello again.
The result is supposed to be like
While mine is like this:
Some mess in the formatting... I tried to add print("\n") in the script and it didn't work well.
Somebody who know python help please, thanks.
This silver ladybug at line 28...
Offline
There is also 'cksfv' in [community] for a more standard CRC32 app
Yes, thanks a lot.
But I really like the idea of that short script, can you help?
This silver ladybug at line 28...
Offline
So I combined cksfv and the coloring idea of the script, here it goes:
#!/bin/bash
### quick check CRC32 of anime videos with a filename in the format of "[gg]_Eden_of_the_East_-_11_[BF3AA75E].mkv"
### Simple output with two colors.
anime="$@"
for anime ; do
cksfv "$anime" |
sed '/^;/d;s/.*\[\([^\]*\)]*\]\.[^\.]* \(........\)$/\1-->\2/' |
awk -F'-->' '{if($1==$2) printf("\x1b[32;01m%s\x1b[00;00m YES\n",$0) ; \
else printf("\x1b[31;01m%s NO!\x1b[00;00m\n",$0)}'
done
Any suggestions to improve it?
Last edited by lolilolicon (2009-06-23 05:43:50)
This silver ladybug at line 28...
Offline
Another version
#!/bin/bash
### quick check CRC32 of anime videos with a filename in the format of "[gg]_Eden_of_the_East_-_11_[BF3AA75E].mkv"
### Simple output with two colors.
yes_clr="\x1b[32;01m"
no_clr="\x1b[31;01m"
end_clr="\x1b[00;00m"
for anime ; do
TEMP=$( cksfv -b -q "$anime" | sed '/^;/d;s/.*\[\(........\)\]\.[^\.]* \(........\)$/\1-->\2/' )
echo "$TEMP" | grep -- "-->" &>/dev/null
if [ "$?" == 0 ]; then
my_crc="${TEMP%-->*}"
src_crc=${TEMP#*-->}
anime=$( basename "$anime" )
if [ "$my_crc" == "$src_crc" ] ; then
printf "$anime ...$yes_clr YES $end_clr\n"
else
printf "$anime ...$no_clr NO! \n\t$TEMP $end_clr\n"
fi
else :
fi
done
Last edited by lolilolicon (2009-06-23 07:58:52)
This silver ladybug at line 28...
Offline