Exemple #1
0
	def _calc_fingerprint_AcoustId(self):
		song = Song(url = self.url, _useDb = False)
		song.openFile()
		song.gain = 0 # just use original
		import ffmpeg
		duration, fingerprint = ffmpeg.calcAcoustIdFingerprint(song)
		# fingerprint is URL-safe base64 with missing padding
		fingerprint += "==="
		import base64
		fingerprint = base64.urlsafe_b64decode(fingerprint)
		return {"duration": duration, "fingerprint_AcoustId": fingerprint}
Exemple #2
0
	def _calc_fingerprint_AcoustId(self):
		song = Song(url = self.url, _useDb = False)
		try:
			song.openFile()
		except IOError as exc:
			return {"error": exc}
		import ffmpeg
		try:
			duration, fingerprint = ffmpeg.calcAcoustIdFingerprint(song)
		except Exception as exc:
			return {"error": exc}
		# fingerprint is URL-safe base64 with missing padding
		fingerprint += "==="
		import base64
		fingerprint = base64.urlsafe_b64decode(fingerprint)
		return {"duration": duration, "fingerprint_AcoustId": fingerprint}
Exemple #3
0
 def _calc_fingerprint_AcoustId(self):
     song = Song(url=self.url, _useDb=False)
     try:
         song.openFile()
     except IOError as exc:
         return {"error": exc}
     import ffmpeg
     try:
         duration, fingerprint = ffmpeg.calcAcoustIdFingerprint(song)
     except Exception as exc:
         return {"error": exc}
     # fingerprint is URL-safe base64 with missing padding
     fingerprint += "==="
     import base64
     fingerprint = base64.urlsafe_b64decode(fingerprint)
     return {"duration": duration, "fingerprint_AcoustId": fingerprint}
Exemple #4
0
		"~/Music/Special/zorba/(01) - Theme From Zorba The Greek.ogg",
		"~/Music/Classic/Glenn Gould Plays Bach/French Suites, BWV812-7 - Gould/Bach, French Suite 5 in G, BWV816 - 5 Bourree.mp3",
		"~/Music/Electronic/Von Paul Kalkbrenner - Aaron.mp3",
		"~/Music/Electronic/One Day_Reckoning Song (Wankelmut Remix) - Asaf Avidan & the Mojos.mp3",
	]
	files = map(os.path.expanduser, files)
	filename = files[5]

if len(sys.argv) >= 3:
	filename = "?"
	duration = int(sys.argv[1])
	fingerprint = sys.argv[2]
else:
	assert os.path.isfile(filename)
	import ffmpeg
	duration, fingerprint = ffmpeg.calcAcoustIdFingerprint(Song(filename))

print "fingerprint for", os.path.basename(filename), "is:", duration, fingerprint


# AcoustID service
# see: http://acoustid.org/webservice

api_url = "http://api.acoustid.org/v2/lookup"
# "8XaBELgH" is the one from the web example from AcoustID.
# "cSpUJKpD" is from the example from pyacoustid
# get an own one here: http://acoustid.org/api-key
client_api_key = "cSpUJKpD"

params = {
	'format': 'json',
		self.f = open(fn)
	def readPacket(self, bufSize):
		s = self.f.read(bufSize)
		return s
	def seekRaw(self, offset, whence):
		r = self.f.seek(offset, whence)
		return self.f.tell()

for f in files:
	ffmpeg.getMetadata(Song(f))
	progr()

print "after getMetadata"
step()


for f in files:
	ffmpeg.calcAcoustIdFingerprint(Song(f))
	progr()

print "after calcAcoustIdFingerprint"
step()


for f in files:
	ffmpeg.calcBitmapThumbnail(Song(f))
	progr()

print "after calcBitmapThumbnail"
step()
Exemple #6
0
    def readPacket(self, bufSize):
        s = self.f.read(bufSize)
        return s

    def seekRaw(self, offset, whence):
        r = self.f.seek(offset, whence)
        return self.f.tell()


for f in files:
    ffmpeg.getMetadata(Song(f))
    progr()

print "after getMetadata"
step()

for f in files:
    ffmpeg.calcAcoustIdFingerprint(Song(f))
    progr()

print "after calcAcoustIdFingerprint"
step()

for f in files:
    ffmpeg.calcBitmapThumbnail(Song(f))
    progr()

print "after calcBitmapThumbnail"
step()
Exemple #7
0
        "~/Music/Special/zorba/(01) - Theme From Zorba The Greek.ogg",
        "~/Music/Classic/Glenn Gould Plays Bach/French Suites, BWV812-7 - Gould/Bach, French Suite 5 in G, BWV816 - 5 Bourree.mp3",
        "~/Music/Electronic/Von Paul Kalkbrenner - Aaron.mp3",
        "~/Music/Electronic/One Day_Reckoning Song (Wankelmut Remix) - Asaf Avidan & the Mojos.mp3",
    ]
    files = map(os.path.expanduser, files)
    filename = files[5]

if len(sys.argv) >= 3:
    filename = "?"
    duration = int(sys.argv[1])
    fingerprint = sys.argv[2]
else:
    assert os.path.isfile(filename)
    import ffmpeg
    duration, fingerprint = ffmpeg.calcAcoustIdFingerprint(Song(filename))

print "fingerprint for", os.path.basename(
    filename), "is:", duration, fingerprint

# AcoustID service
# see: http://acoustid.org/webservice

api_url = "http://api.acoustid.org/v2/lookup"
# "8XaBELgH" is the one from the web example from AcoustID.
# "cSpUJKpD" is from the example from pyacoustid
# get an own one here: http://acoustid.org/api-key
client_api_key = "cSpUJKpD"

params = {
    'format': 'json',