Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: A secure ripper for linux (Read 162937 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

A secure ripper for linux

Reply #25
sorry, I thought you were talking about ripping whole images as one file.  chances are that two tracks fit in ram on your machine, then yes it will be fast.  but cmp will always be faster and could be used to implement legg's idea.

Josh

A secure ripper for linux

Reply #26
After doing some research in what cmp actually does, it might be interesting to use it after all. It can show the user how much bytes the files differ if the sha-digest don't match. Before replacing the sha-digest, I wonder if it will be as reliable as a sha-digest. Any ideas? Thanks for your input.
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #27
Given that cmp does a byte by byte comparison of two files, it will detect differences in all cases. A 160bit SHA-1 hash will fail to detect a random error one in every 2^80 cases. Given that 2^80 is about 10^24, this is equivalent to "never", in this application. Therefore SHA-1 and cmp are identically accurate.

Which is faster will be hard to tell. The extra seeks that cmp requires might balance out the computation that sha1sum requires. As cmp offers more features (a count of differences), it is probably the better choice.

A secure ripper for linux

Reply #28
It's better to use cdda2wav with libparanoia on drives that cache audio, i made myself a ripping script(shell script) because other programs or scripts didn't suit me and i implemented both cdparanoia and cdda2wav support.

A secure ripper for linux

Reply #29
Hereby I announce next version: version 0.1

I made quite some changes, If your wish is not included yet, please remind me of it. The changelist is as follows:

from trialversion to 0.1:
      -   Cleaned up some code
      - Improved text layout
      -   Check if the pycddb module is installed. If not fire a warning and exit.
      -   changed the way tracks are ripped: After the track is ripped first it's
   digest is saved in a list. Next trial to rip, the digest of the track will
   be compared to first trial(s), If it matches with any other in the list, then
   encode to all given formats. Otherwise append the digest to the list.
      -   Reduced disk usage: after a file is encoded, delete the wav file. Also: if
   a digest does not match the file is deleted. (Including the first trial). This
        behaviour can be prevented by giving --keep_source as parameter.
      - Possibility to use cdda2wav instead of cdparanoia (may be faster or work
        better on some drives). The output of cdda2wav can't be totally killed on
        command-line. Looks a bit messy.
      -   Possibility of using an external encoder (still much untested)

You can download it here(right-click and save as): http://www.gentoolinux.demon.nl/pyripper-0.1

Have fun with it
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #30
the link is broken.

A secure ripper for linux

Reply #31
Wow. I tried the tech by hand (scratched disk) and even the results where cdparanoia didn't show any problem differed in a few hundred samples. And to think that I trusted that tool for years...

A secure ripper for linux

Reply #32
@neomoe: link is fixed. Don't know what went wrong.
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #33
In my own script i use md5's to compare to two rip attempts, cdparanoia is very reliable on my non caching drive, but extremely unreliable on my drive that caches.

A secure ripper for linux

Reply #34
I just hacked together a (very experimental) perl script to rip a track, until every byte has been read at least 3x with the same value. Used cdparanoia as ripper. Here's the result, first value is rip number and second value is "dirty bytes left":

3rd rip: 365
4th rip: 39
5th rip: 0

The script doesn't correct the rip yet, it just displays all the bytepositions to be corrected, and the correct values. It's slow and memory-intensive (at least if there are many errors), but usable. If you're interested I can work on it some more and put it online.

MedO

A secure ripper for linux

Reply #35
I'm looking for a simular solution for Mac OS X.
We are in the same situation as GNU/Linux users, that we miss a secure ripper (like EAC).

This script dont run on Mac OS X, but perhaps its not a big task to get it going?
Anybody willing to help?

A secure ripper for linux

Reply #36
Why don't you post the error? I can always give it a look.
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #37
Quote
Why don't you post the error? I can always give it a look.
[a href="index.php?act=findpost&pid=339872"][{POST_SNAPBACK}][/a]

This is the error message I get:
Quote
./pyripper --flac
Welcome to Pyripper version 0.1
Pyripper is released under the GPL license

Initializing disk...
Fetching CDDB info...
Traceback (most recent call last):
  File "./pyripper", line 430, in ?
    x.main()
  File "./pyripper", line 413, in main
    self.disc_id()
  File "./pyripper", line 154, in disc_id
    disc = DiscID.open()
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/DiscID.py", line 31, in open
    return cdrom.open()
cdrom.error: (16, 'Resource busy')

I have cdparanoia III release 9.8 (March 23, 2001) and CDDB-py 1.4 installed.
There are also an audio cd in my drive.

Edit: cdparanoia rip my cd perfectly fine with the command "cdparanoia -B"

A secure ripper for linux

Reply #38
What happens if you specify --cdrom ?
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #39
Quote
What happens if you specify --cdrom ?
[a href="index.php?act=findpost&pid=339879"][{POST_SNAPBACK}][/a]

Same result, but slightly different output. If "IODVDServices" is the correct device that is?
Quote
./pyripper --flac --cdrom IODVDServices
Welcome to Pyripper version 0.1
Pyripper is released under the GPL license

Initializing disk...
Fetching CDDB info...
Traceback (most recent call last):
  File "./pyripper", line 430, in ?
    x.main()
  File "./pyripper", line 413, in main
    self.disc_id()
  File "./pyripper", line 151, in disc_id
    disc = DiscID.open(self.settings['cdrom'])
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/DiscID.py", line 33, in open
    return cdrom.open(device)
cdrom.error: (2, 'No such file or directory')

A secure ripper for linux

Reply #40
From the PY-CDDB documentation:

Quote
There are two methods of the DiscID module that are of interest:

device = DiscID.open()
 
  This is the default, cross-platform way to open the audio
  CD-ROM device.  The device defaults to /dev/cdrom on Linux and BSD,
  /dev/disk1 on Mac OS X, /dev/vol/aliases/cdrom0 on Solaris, and
  cdaudio under Windows.  You do not have to use this function to open
  the audio CD-ROM device, but it's a sane default.


Probably you need to specify /dev/disk1 or something like that.
Also: are you sure that the audio-cd isn't accessed anywhere else?
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #41
^ Thanks. When I specify /dev/disk1 I get the same error as when I dont specify the cdrom.
Quote
cdrom.error: (16, 'Resource busy')

1. I dont have iTunes or simular running, so I dont think the audio-cd is accessed anywhere else.
2. cdparanoia have no problems accessing and rip the cd.

I really dont know why the cddb-py cant access my cd!


Edit: It works!
The reason it did not work was that cddb-py can not access the cd while it is mounted in Mac OS X, but cdparanoia can.
After I unmounted the cd (hdiutil unmount /dev/disk1) it works.

Now its testing time!

Edit2: I have two small requests to make it work better on OS X:
1. Detect OS X and run this unmount command before the rip process starts
hdiutil unmount /dev/disk1
2. Detect OS X and mount the cd when the rip process completes
disktool -m disk1

I think one of these uname command output what you need to detect OS X:
Quote
uname
Darwin
-----------------------
uname -a
Darwin Apple-PowerBook.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct  3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc

A secure ripper for linux

Reply #42
I'd rather use an internal command in python. Can you fire up a terminal and type the following:

python
import sys
sys.platform
sys.exit()

And tell me what it returns. I am having trouble finding this information.
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #43
^ Sure, here you are.
Quote
python
import sys
sys.platform
sys.exit()
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> 'darwin'
>>>

A secure ripper for linux

Reply #44
Quote
2. Detect OS X and eject the cd when the rip process completes (the cd cant be mounted again, so it has to be ejected)
hdiutil eject /dev/disk1


Can't you just run:

Code: [Select]
$ disktool -m disk1
?

A secure ripper for linux

Reply #45
Quote
Can't you just run:
Code: [Select]
$ disktool -m disk1
?

Yes, that works.
I looked through all the hdiutil commands but did not find any way to mount it. Did not think about disktool

frodoontop. This is a better way than ejecting the cd!

A secure ripper for linux

Reply #46
I can't test the mac os behaviour, so you'll be my test driver  .

Changes:
If it detects 'darwin' in sys.platform it will run first:
hdiutil unmount %(cdrom).
Where cdrom is either the default of /dev/disk1 or the one specified by --cdrom.

At the end of the ripping process, but before the eject command it will run:
disktool -m %(cdrom).

Since I already implemented the eject command too, you can also use this. If specified --eject it will spit the cd out at the end.

You can find the new pyripper at (right-click and save as): http://www.gentoolinux.demon.nl/pyripper-0.1.1
A secure audio ripper for linux: code.google.com/p/rubyripper

A secure ripper for linux

Reply #47
I tested the new pyripper-0.1.1, but the unmount command dont work properly
Quote
Initializing disk...
Fetching CDDB info...
hdiutil: unmount: cannot find disk node that corresponds to "/Users/krmathis/Downloads/cdaudio".
hdiutil: unmount failed - No such file or directory
Where "/Users/krmathis/Downloads/" is my working directory.
It seems like hdiutil dont catch the %(cdrom) string properly.

I want to thank you for bearing with me on this one! 

A secure ripper for linux

Reply #48
You should be able to use hdiutil to re-mount the disc.  From the hdiutil man page:

    mountvol dev_name

                Attempt to mount dev_name using Disk Arbitration (similar to
                diskutil mount). XML output is available from -plist.  Note
                that mountvol (rather than mount) will remount a volume after
                it has been unmounted by unmount.  mount/attach can be called
                on a /dev entry, but it will treat the /dev entry as a disk
                image to be attached (creating another /dev entry).  This is
                usually undesirable.

So, for example:  hdiutil mountvol /dev/disk1

Don't know if this is any better than using disktool or not.

A secure ripper for linux

Reply #49
Can you redownload the pyripper-0.1.1 file.

I made a kind of stupid mistake.
I was testing if 'win' was in sys.platform after I tested for 'darwin' in sys.platform.
For windows cd-drive = cdaudio by default. So, it was in fact overriding the cdrom-drive.

Now I first test for win and then for darwin, it should be fixed now.
A secure audio ripper for linux: code.google.com/p/rubyripper