cddb_query issue with multiple matches

interpretive language scripts


Moderator: Forum moderators

Post Reply
HerrBert
Posts: 358
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 18 times
Been thanked: 126 times

cddb_query issue with multiple matches

Post by HerrBert »

Recently i found that some of my older Audio CD's fail to play...

ATM i'm trying to convert my CD's to .mp3 on a backup drive.
Easy and lightweight to use @plinej's pcdripper for this task.

But (as sooo often...) there is an issue, though not related to pcdripper, but to cddb_query.

Servers in pcdripper commands for cddb_query and cd-info are updated to point to gnudb.gnudb.org port: 8880 protocol: cddbp

I have a CD identified by cddb_query as /root/.cddbslave/misc/b60c2e0d
There is no adequate information about the tracknames in this file.

Using cd-info on a clean /root/.cddbslave directory, it's also detected as:
/root/.cddbslave/folk/b60c2e0d
/root/.cddbslave/rock/b60c2e0d
/root/.cddbslave/soundtrack/b60c2e0d
cd-info output:

Code: Select all

# cd-info -C /dev/cdrom --cddb-server=gnudb.gnudb.org --cddb-cache=~/.cddbslave 
--no-device-info --no-disc-mode
cd-info version 0.93 x86_64-slackware-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2013 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
CD location   : /dev/cdrom
CD driver name: GNU/Linux
   access mode: IOCTL

__________________________________

CD-ROM Track List (1 - 13)
  #: MSF       LSN    Type   Green? Copy? Channels Premphasis?
  1: 00:02:00  000000 audio  false  no    2        no
  2: 04:30:43  020143 audio  false  no    2        no
  3: 07:37:49  034174 audio  false  no    2        no
  4: 12:34:17  056417 audio  false  no    2        no
  5: 17:35:40  079015 audio  false  no    2        no
  6: 21:18:01  095701 audio  false  no    2        no
  7: 25:47:74  115949 audio  false  no    2        no
  8: 27:59:58  125833 audio  false  no    2        no
  9: 31:49:46  143071 audio  false  no    2        no
 10: 35:51:50  161225 audio  false  no    2        no
 11: 40:22:05  181505 audio  false  no    2        no
 12: 44:22:03  199503 audio  false  no    2        no
 13: 48:52:00  219750 audio  false  no    2        no
170: 52:00:32  233882 leadout (524 MB raw, 524 MB formatted)
Media Catalog Number (MCN): 0731454660228
TRACK  1 ISRC: DEG189910352
TRACK  2 ISRC: DEG189910353
TRACK  3 ISRC: DEG189910354
TRACK  4 ISRC: DEG189910355
TRACK  5 ISRC: DEG189910356
TRACK  6 ISRC: DEG189910357
TRACK  7 ISRC: DEG189910358
TRACK  8 ISRC: DEG189910359
TRACK  9 ISRC: DEG189910363
TRACK 10 ISRC: DEG189910361
TRACK 11 ISRC: DEG189910360
TRACK 12 ISRC: DEG189910362
TRACK 13 ISRC: DEG189910392
Last CD Session LSN: 0
audio status: no status
volume level port 0: 255 (0..255) 100 (0..100)
volume level port 1: 255 (0..255) 100 (0..100)
volume level port 2:   0 (0..255)   0 (0..100)
volume level port 3:   0 (0..255)   0 (0..100)
__________________________________
CD Analysis Report
Audio CD, CDDB disc ID is b60c2e0d
cd-info: Found 4 matches in CDDB
Disc ID: b60c2e0d
CDDB category: misc (3)
Music genre: ''
Year: 1900
Artist: 'In Extremo'
Title: 'Verehrt und Angespien'
Extended data: 'NULL'
Length: 3120 seconds
Revision: 3
Number of tracks: 13
  Track  1
    number: 1
    frame offset: 150
    length: 268 seconds
    artist: 'In Extremo'
    title: 'Titel 01'
    extended data: 'NULL'
  Track  2
    number: 2
    frame offset: 20293
    length: 187 seconds
    artist: 'In Extremo'
    title: 'Titel 02'
    extended data: 'NULL'
  Track  3
    number: 3
    frame offset: 34324
    length: 296 seconds
    artist: 'In Extremo'
    title: 'Titel 03'
    extended data: 'NULL'
  Track  4
    number: 4
    frame offset: 56567
    length: 301 seconds
    artist: 'In Extremo'
    title: 'Titel 04'
    extended data: 'NULL'
  Track  5
    number: 5
    frame offset: 79165
    length: 222 seconds
    artist: 'In Extremo'
    title: 'Titel 05'
    extended data: 'NULL'
  Track  6
    number: 6
    frame offset: 95851
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Titel 06'
    extended data: 'NULL'
  Track  7
    number: 7
    frame offset: 116099
    length: 131 seconds
    artist: 'In Extremo'
    title: 'Titel 07'
    extended data: 'NULL'
  Track  8
    number: 8
    frame offset: 125983
    length: 229 seconds
    artist: 'In Extremo'
    title: 'Titel 08'
    extended data: 'NULL'
  Track  9
    number: 9
    frame offset: 143221
    length: 242 seconds
    artist: 'In Extremo'
    title: 'Titel 09'
    extended data: 'NULL'
  Track 10
    number: 10
    frame offset: 161375
    length: 270 seconds
    artist: 'In Extremo'
    title: 'Titel 10'
    extended data: 'NULL'
  Track 11
    number: 11
    frame offset: 181655
    length: 239 seconds
    artist: 'In Extremo'
    title: 'Titel 11'
    extended data: 'NULL'
  Track 12
    number: 12
    frame offset: 199653
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Titel 12'
    extended data: 'NULL'
  Track 13
    number: 13
    frame offset: 219900
    length: 188 seconds
    artist: 'In Extremo'
    title: 'Titel 13'
    extended data: 'NULL'
Disc ID: b60c2e0d
CDDB category: soundtrack (10)
Music genre: ''
Year: 1900
Artist: 'In Extremo'
Title: 'Verehrt und Angespien'
Extended data: 'NULL'
Length: 3120 seconds
Revision: 3
Number of tracks: 13
  Track  1
    number: 1
    frame offset: 150
    length: 268 seconds
    artist: 'In Extremo'
    title: 'Titel 01'
    extended data: 'NULL'
  Track  2
    number: 2
    frame offset: 20293
    length: 187 seconds
    artist: 'In Extremo'
    title: 'Titel 02'
    extended data: 'NULL'
  Track  3
    number: 3
    frame offset: 34324
    length: 296 seconds
    artist: 'In Extremo'
    title: 'Titel 03'
    extended data: 'NULL'
  Track  4
    number: 4
    frame offset: 56567
    length: 301 seconds
    artist: 'In Extremo'
    title: 'Titel 04'
    extended data: 'NULL'
  Track  5
    number: 5
    frame offset: 79165
    length: 222 seconds
    artist: 'In Extremo'
    title: 'Titel 05'
    extended data: 'NULL'
  Track  6
    number: 6
    frame offset: 95851
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Titel 06'
    extended data: 'NULL'
  Track  7
    number: 7
    frame offset: 116099
    length: 131 seconds
    artist: 'In Extremo'
    title: 'Titel 07'
    extended data: 'NULL'
  Track  8
    number: 8
    frame offset: 125983
    length: 229 seconds
    artist: 'In Extremo'
    title: 'Titel 08'
    extended data: 'NULL'
  Track  9
    number: 9
    frame offset: 143221
    length: 242 seconds
    artist: 'In Extremo'
    title: 'Titel 09'
    extended data: 'NULL'
  Track 10
    number: 10
    frame offset: 161375
    length: 270 seconds
    artist: 'In Extremo'
    title: 'Titel 10'
    extended data: 'NULL'
  Track 11
    number: 11
    frame offset: 181655
    length: 239 seconds
    artist: 'In Extremo'
    title: 'Titel 11'
    extended data: 'NULL'
  Track 12
    number: 12
    frame offset: 199653
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Titel 12'
    extended data: 'NULL'
  Track 13
    number: 13
    frame offset: 219900
    length: 188 seconds
    artist: 'In Extremo'
    title: 'Titel 13'
    extended data: 'NULL'
Disc ID: b60c2e0d
CDDB category: folk (1)
Music genre: 'Mittelalter, Rock'
Year: 1999
Artist: 'In Extremo'
Title: 'Verehrt Und Angespien'
Extended data: 'YEAR: 1999'
Length: 3120 seconds
Revision: 24
Number of tracks: 13
  Track  1
    number: 1
    frame offset: 150
    length: 268 seconds
    artist: 'In Extremo'
    title: 'Merseburger Zaubersprüche'
    extended data: 'NULL'
  Track  2
    number: 2
    frame offset: 20293
    length: 187 seconds
    artist: 'In Extremo'
    title: 'Ich Kenne Alles'
    extended data: 'NULL'
  Track  3
    number: 3
    frame offset: 34324
    length: 296 seconds
    artist: 'In Extremo'
    title: 'Herr Mannelig'
    extended data: 'NULL'
  Track  4
    number: 4
    frame offset: 56567
    length: 301 seconds
    artist: 'In Extremo'
    title: 'Pavane'
    extended data: 'NULL'
  Track  5
    number: 5
    frame offset: 79165
    length: 222 seconds
    artist: 'In Extremo'
    title: 'Spielmannsfluch'
    extended data: 'NULL'
  Track  6
    number: 6
    frame offset: 95851
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Weiberfell'
    extended data: 'NULL'
  Track  7
    number: 7
    frame offset: 116099
    length: 131 seconds
    artist: 'In Extremo'
    title: 'Miss Gordon Of Gight'
    extended data: 'NULL'
  Track  8
    number: 8
    frame offset: 125983
    length: 229 seconds
    artist: 'In Extremo'
    title: 'Werd' Ich Am Galgen Hochgezogen'
    extended data: 'NULL'
  Track  9
    number: 9
    frame offset: 143221
    length: 242 seconds
    artist: 'In Extremo'
    title: 'This Corrosion'
    extended data: 'NULL'
  Track 10
    number: 10
    frame offset: 161375
    length: 270 seconds
    artist: 'In Extremo'
    title: 'Santa Maria'
    extended data: 'NULL'
  Track 11
    number: 11
    frame offset: 181655
    length: 239 seconds
    artist: 'In Extremo'
    title: 'Vänner och Frände'
    extended data: 'NULL'
  Track 12
    number: 12
    frame offset: 199653
    length: 269 seconds
    artist: 'In Extremo'
    title: 'In Extremo'
    extended data: 'NULL'
  Track 13
    number: 13
    frame offset: 219900
    length: 188 seconds
    artist: 'In Extremo'
    title: 'Herr Mannelig (Acoustic Version)'
    extended data: 'NULL'
Disc ID: b60c2e0d
CDDB category: rock (4)
Music genre: 'Rock'
Year: 2000
Artist: 'In Extremo'
Title: 'Sünder ohne Zügel'
Extended data: 'NULL'
Length: 3120 seconds
Revision: 1
Number of tracks: 13
  Track  1
    number: 1
    frame offset: 150
    length: 268 seconds
    artist: 'In Extremo'
    title: 'Wind'
    extended data: 'NULL'
  Track  2
    number: 2
    frame offset: 20293
    length: 187 seconds
    artist: 'In Extremo'
    title: 'Krummavisur'
    extended data: 'NULL'
  Track  3
    number: 3
    frame offset: 34324
    length: 296 seconds
    artist: 'In Extremo'
    title: 'Lebensbeichte'
    extended data: 'NULL'
  Track  4
    number: 4
    frame offset: 56567
    length: 301 seconds
    artist: 'In Extremo'
    title: 'Merseburger Zaubersprüche II'
    extended data: 'NULL'
  Track  5
    number: 5
    frame offset: 79165
    length: 222 seconds
    artist: 'In Extremo'
    title: 'Stetit Puella'
    extended data: 'NULL'
  Track  6
    number: 6
    frame offset: 95851
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Vollmond'
    extended data: 'NULL'
  Track  7
    number: 7
    frame offset: 116099
    length: 131 seconds
    artist: 'In Extremo'
    title: 'Die Gier'
    extended data: 'NULL'
  Track  8
    number: 8
    frame offset: 125983
    length: 229 seconds
    artist: 'In Extremo'
    title: 'Omnia Sol Temperat'
    extended data: 'NULL'
  Track  9
    number: 9
    frame offset: 143221
    length: 242 seconds
    artist: 'In Extremo'
    title: 'Le ´Or Chiyuchech'
    extended data: 'NULL'
  Track 10
    number: 10
    frame offset: 161375
    length: 270 seconds
    artist: 'In Extremo'
    title: 'Der Rattenfänger'
    extended data: 'NULL'
  Track 11
    number: 11
    frame offset: 181655
    length: 239 seconds
    artist: 'In Extremo'
    title: 'Òskasteinar'
    extended data: 'NULL'
  Track 12
    number: 12
    frame offset: 199653
    length: 269 seconds
    artist: 'In Extremo'
    title: 'Nature Nous Semont'
    extended data: 'NULL'
  Track 13
    number: 13
    frame offset: 219900
    length: 188 seconds
    artist: 'In Extremo'
    title: 'Unter dem Meer'
    extended data: 'NULL'
No CD-TEXT on Disc.
# 

Running cd-info twice on this CD matches the desired third match /root/.cddbslave/folk/b60c2e0d
Running cddb_query twice on this CD matches /root/.cddbslave/misc/b60c2e0d again.

Seems it is not possible to get the latest revision of the CDDB file in cddb_query.
This may be related to changing from freedb.org to gnudb.org
The search and album commands in cddb_query return a server error.
So i guess, this is some API whatever stuff. :roll:
I don't want to hassle with this. I want the correct information now.

I ended up with a little script to fetch CDDB entry before running pcdripper:

Code: Select all

#!/bin/sh
MATCH="$(cddb_query -i /dev/cdrom -s gnudb.gnudb.org -p 8880 -P cddbp query)"
NUM="$(echo "$MATCH" | grep 'Number of matches:' | cut -f2 -d ":" | tr -d " ")"
[ $NUM -gt 1 ] && {
	for ((i=1;i<=$NUM;i++)); do
		STR="$(echo "$MATCH" | grep -A1 "Match ${i}" | sed '$!d;s/.*: //;s/ (.*)\t/ /')"
		( xmessage -name "${0##*/}" -buttons "Remove,Keep" -fn mono "$(cddb_query -s gnudb.gnudb.org -p 8880 -P cddbp read ${STR} 2>&1)"
			[ $? -ne 102 ] && rm ~/.cddbslave/${STR/ /\/} ) &
	done
} || \
cddb_query -i /dev/cdrom -s gnudb.gnudb.org -p 8880 -P cddbp read 2>&1 | xmessage -name "${0##*/}" -fn mono -file -

Removing the unwanted CDDB files causes cddb_query to use the cached file that's left.

Any objection or thought on this?

Post Reply

Return to “Scripts”