modularize
This commit is contained in:
parent
f22ad478eb
commit
9552369760
18 changed files with 259 additions and 250 deletions
14
utils.py
Normal file
14
utils.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import re, hashlib
|
||||
|
||||
def clean_artist_name(text):
|
||||
return re.sub(r'[⭐🤖🎭\u2B50\uFE0F]', '', text).strip()
|
||||
|
||||
def force_star_flag(starred=True):
|
||||
return "Yes" if starred else "No"
|
||||
|
||||
def hash_file(filename):
|
||||
hasher = hashlib.sha256()
|
||||
with open(filename, "rb") as f:
|
||||
buf = f.read()
|
||||
hasher.update(buf)
|
||||
return hasher.hexdigest()
|
||||
Loading…
Add table
Add a link
Reference in a new issue