本文整理汇总了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