本文整理匯總了Python中dejavu.Dejavu.get_fingerprinted_songs方法的典型用法代碼示例。如果您正苦於以下問題:Python Dejavu.get_fingerprinted_songs方法的具體用法?Python Dejavu.get_fingerprinted_songs怎麽用?Python Dejavu.get_fingerprinted_songs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dejavu.Dejavu
的用法示例。
在下文中一共展示了Dejavu.get_fingerprinted_songs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Lilo
# 需要導入模塊: from dejavu import Dejavu [as 別名]
# 或者: from dejavu.Dejavu import get_fingerprinted_songs [as 別名]
class Lilo():
"""
The class for JamJar which will be used to identify video matches and add fingerprints to the database
"""
def __init__(self, config, filename, video_id):
"""
usage:
fingerprinter = Lilo('/path/to/video/file','unique_video_id')
"""
self.djv = Dejavu(config)
self.filename = filename
self.video_id = video_id
# cache these after first fingerprint
self.hashes = None
def recognize_track(self):
# Try to match the song to the existing database
hashes, songs = self.djv.recognize(FileRecognizer, self.filename)
self.hashes = hashes
return songs
def fingerprint_song(self):
# Now let's add this song to the DB
data = self.djv.fingerprint_file(self.filename, self.video_id, cached_hashes=self.hashes)
return data
def check_if_fingerprinted(self):
video_hash = unique_hash(self.filename)
# Set self.djv.songhashes_set
fingerprinted_video_hashes = self.djv.get_fingerprinted_songs()
return video_hash in self.djv.songhashes_set