AnimeSuki.com Forum

AnimeSuki Forum (http://forums.animesuki.com/index.php)
-   Fansub Groups (http://forums.animesuki.com/forumdisplay.php?f=17)
-   -   Fansub SFV Creator (http://forums.animesuki.com/showthread.php?t=29228)

xtpe 2006-02-17 16:22

Fansub SFV Creator
 
hi
like I said in my last post I find it very time consuming making the SFVs of the fansubs manually. So I made a little tool for making the SFV whith one double click.

Actually I did it for myself but I thought perhaps other people might find it useful, too.

Here is the Link: Fansub SFV
It's an executable jar file. (2.2 kb)

Just copy it in the directory where your fansubs are and double click it.

I am very interested in your opinions. :)

edit: why was this moved to the "Fansub Group" forum? It doesn't really have anything to do with the groups, does it?:confused: Isn't it most suited for "general chat"?

Sylf 2006-02-17 16:49

Yes, a simple explanation on how to use the tool for us dumb people would be nice.

Where do you locate this file? What do you double click on? Where do the "fansub" files needs to be located at? Do the files need to be named in any certain format?

What's the difference between this, and, for example, QuickSFV, which lets you right-click on a file, and make an SVF file with about 3 more clicks of mouse?

Rasqual Twilight 2006-02-17 16:52

Quote:

Originally Posted by xtpe
hi
like I said in my last post I find it very time consuming making the SFVs of the fansubs manually. So I made a little tool for making the SFV whith one double click.

Actually I did it for myself but I thought perhaps other people might find it useful, too.

Here is the Link: Fansub SFV
It's an executable jar file. (2.2 kb)

Just copy it in the directory where your fansubs are and double click it.

I am very interested in your opinions. :)

From what I gather from the code, it just extracts the CRC32 sum between brackets from the filenames and creates a SFV, which you can be used later to check each file.
Now I believe this utility could be handful, however it'd be better if you could build an exe for Windows users instead of having them open a command-line window (I don't have .jar's associated with java).

Too bad filenames containing spaces are not handled (because of .sfv "specs"?)

Maybe you should make a version that could be called from a folder context-menu in Windows, i.e. take a directory path as argument instead of the SFV name.

xtpe 2006-02-17 16:55

Quote:

Originally Posted by Sylf
Yes, a simple explanation on how to use the tool for us dumb people would be nice.

Where do you locate this file? What do you double click on? Where do the "fansub" files needs to be located at? Do the files need to be named in any certain format?

What's the difference between this, and, for example, QuickSFV, which lets you right-click on a file, and make an SVF file with about 3 more clicks of mouse?

"Where do you locate this file?"
In the directory where the fansubs are.

" What do you double click on?"
the tool.

Do the files need to be named in any certain format?
The CRC must be in between brackets like "[]", "()" or just "__". like almost every group does.

Difference to QuickSFV.
My tool simply makes an SFV file out of the filenames. QuickSFV makes a checksum of the files.

Quote:

Originally Posted by Rasqual Twilight
1) Now I believe this utility could be handful, however it'd be better if you could build an exe for Windows users instead of having them open a command-line window (I don't have .jar's associated with java).

2) Too bad filenames containing spaces are not handled (because of .sfv "specs"?)

3) Maybe you should make a version that could be called from a folder context-menu in Windows, i.e. take a directory path as argument instead of the SFV name.

1) I am really sorry but I have almost no experience in programming with C so I don't know how to do that. All I could do is a bat file which a lot more people could handle.

2) yes. I didn't think that supporting spaces would be neccessary.

3) see 1) :(

Sylf 2006-02-17 17:02

Quote:

Originally Posted by xtpe
"Where do you locate this file?"
In the directory where the fansubs are.

How does it tell which files it needs to look at? Do I have to put the file to be released in a separate folder, so your tool doesn't get confused? Or does it try to create svf file for all files within the folder? What if the sfv file from the past releases already exist? What if it encounter other files, like torrent files?

Quote:

Originally Posted by xtpe
" What do you double click on?"
the tool.

I did, and it did nothing. Now what?

Quote:

Originally Posted by xtpe
Difference to QuickSFV.
My tool simply makes an SFV file out of the filenames. QuickSFV makes a checksum of the files.

So, you're telling me that I have to use another tool to calculate the CRC32 hash ahead of the time, and embed that value in the file name?

Isn't it easier to distribute some CRC32 hash calculator and tell people to use those instead?
Something like this one actually tells you if the file's CRC32 hash matches that of what's in the file name.

xtpe 2006-02-17 17:08

Quote:

Originally Posted by Sylf
How does it tell which files it needs to look at? Do I have to put the file to be released in a separate folder, so your tool doesn't get confused? Or does it try to create svf file for all files within the folder? What if the sfv file from the past releases already exist? What if it encounter other files, like torrent files?


I did, and it did nothing. Now what?


So, you're telling me that I have to use another tool to calculate the CRC32 hash ahead of the time, and embed that value in the file name?

"Or does it try to create svf file for all files within the folder?" yes.

"What if it encounter other files, like torrent files?" It will add the torrent in the SFV too...:p Gotta fix that.

"I did, and it did nothing. Now what?" I will make a bat file, perhaps it will work then.

last question: no, I didn't. It was just supposed to be an additional convenience.

edit: bat file uploaded, torrent files included in the ignore list
To start the tool it is necessary to download both the "FansubSFV.jar" and "FansubSFV.bat". After that both files have to be copied in the directory with the fansubs and then a double click at FansubSFV.bat.

Now that I think about it it is almost the same amount of work at the end...

Sylf 2006-02-17 17:23

OK, one last question, then.
Who is this tool intended for? People who make releases of fansubs, or people who download them? How do you exactly use it yourself?

Do you use this tool to create the .sfv file, then double click on the sfv file so sfv checker checks the CRC32 to verify the file?

xtpe 2006-02-17 17:37

Quote:

Originally Posted by Sylf
OK, one last question, then.
Who is this tool intended for? People who make releases of fansubs, or people who download them? How do you exactly use it yourself?

Do you use this tool to create the .sfv file, then double click on the sfv file so sfv checker checks the CRC32 to verify the file?

Actually I made this tool for myself so It is intended for leechers.:p

I put it in the download directory of mIRC and everytime I download something I make a new SFV file of the whole directory. So it assumes your CRC verifying software has the feature to remember what files were already checked and were ok.

last question: yes.

edit: The exe file is up.
No, it isn't, my webhost doesn't allow exe files...

Internet Explorer seems to rename the "FansubSFV.jar" file to "FansubSFV.zip" so it has to be renamed.

Rasqual Twilight 2006-02-17 18:00

.exe does not seem to be allowed by your host. You should use a ZIP archive...
Suggestion: for a set of known extensions, if file name matches regexp
"/\\." + ext + "\\.[\\w!]$/"
then it should be ignored (avoids .torrent, .001 and whatnot)

I only know of exe4j (used in Azureus) to produce wrapped .jars in exe and it's not free + produces kinda bloated files. Eval version inserts a MsgBox on launch, which is annoying too. Maybe the batch solution is better.

Edit: /me is gonna have a look at http://jsmooth.sourceforge.net/ for wrapping the .jar

exe4j project:
Spoiler:


jsmooth project:
Spoiler:


Built with jsmooth: 386KB exe (!) for 3KB jar.
http://www.uploading.com/?get=FY9QJ5EM (Mirror)

xtpe 2006-02-17 19:20

Quote:

Originally Posted by Sylf
Isn't it easier to distribute some CRC32 hash calculator and tell people to use those instead?
Something like this one actually tells you if the file's CRC32 hash matches that of what's in the file name.

Sorry, I totally overlooked these two lines... That is exactly the kind of software I was searching everwhere on the web but couldn't find which motivated me to make the tool.

Mods can close this thread now.:)

lamer_de 2006-02-18 02:29

http://rapidcrc.sourceforge.net/

Also provides CRC checking from filenames and integrates in the context menu. Additionally, it's pretty fast and supports md5, too.

CU,
lamer_de

Rasqual Twilight 2006-02-18 11:49

Tested; I think I'm not looking back. It even supports paths with foreign character names!

Draders 2006-02-18 14:12

I just use quicksfv, also has it in the context menu.

Hirvine 2006-02-19 08:30

I'll also recommed RapidCRC. It's fast, clean, easy and have a good interface. btw, it's located at sourceforge.net and I think we should support those. :P In any case, a jar file should be java. Java can be fun but it ask so much CPU. There for I don't like Java much.

saber55 2007-11-01 02:37

There is also this one that provides CRC checking from filenames: fsum frontend

edogawaconan 2007-11-07 01:00

if only someone makes windows port of cksfv.... :(

GHDpro 2007-11-16 16:30

You know, RapidCRC (mentioned by lamer_de a few posts up) already does this too. And since it has had a few more revisions, I'm willing to bet it's faster also. The only advantage I see is the filter: RapidCRC will simply check any file in a folder (and check if it matches the CRC32 in the filename where applicable).

jfs 2007-11-24 14:37

Commandline it could probably be written as a shell script. You can use a regular expression to extract the CRC from a filename, checksum the file and then compare.

fireshark 2007-11-24 18:09

\[[0-9A-Fa-f]{8}\]

TheFluff 2007-11-25 00:08

perl > shell
Code:

#!/usr/bin/perl

use warnings;
use strict;

my @files = @ARGV or print("Usage: sfvcheck file1 ... fileN\n") && exit(1);
        # print usage message if called without arguments

FILELOOP:
foreach (@files) {
        my $filename = $_;
        my ($input, $name_checksum, $real_checksum, $checksum);
        print(qq(Could not find file "$filename", skipping\n)) and next() unless -e $filename;
       
        if ( /(\[|\()([0-9A-F]{8})(\]|\))/i ) { # does it have a checksum?
                $name_checksum = $2;
                $input = `cksfv $filename`; # fortunately this dies automagically if you don't have cksfv
               
                $real_checksum = parse_cksfv($input);
               
                if ($real_checksum eq $name_checksum) {
                        print("${filename}: $real_checksum - OK!\n");
                        next(FILELOOP);
                }
                else {
                        print("${filename}: $real_checksum - NOT OK! Should be ${name_checksum}!\n");
                        next(FILELOOP);
                }
        }
        else { # can't find checksum in filename, just print filename + generated checksum and let the user do the thinking
                $input = `cksfv $filename`;
                $checksum = parse_cksfv($input);
               
                print("${filename}: ${checksum}\n");
                next(FILELOOP);
        }
}

exit(0);



sub parse_cksfv {
        my @inputlines = split("\n", $_[0]); # split the input string into lines
       
        foreach (@inputlines) {
                my $line = $_;
                next if substr($line, 0, 1) eq ';'; # skip comment lines
               
                # check if cksfv returned an error.
                # amusingly it'll fail if someone has a file named "cksfv: something" but who cares.
                if (substr($line, 0, 7) eq 'cksfv: ') {
                        die("$line , stopped");
                }
               
                return(substr($line, -8)); # return the checksum we're looking for
        }
}

Really dumb, probably very buggy and requires cksfv (apt-get install cksfv, what are you waiting for?) since AFAIK Digest::CRC32 is written in pure Perl and therefore slow. But it does what you asked for.

Rewriting the program to use fsum on Windows is left as an exercise to the reader.


All times are GMT -5. The time now is 23:06.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.