Merge pull request #37 from kepoorhampond/replace-and-and-&

removing & and 'and' in `ObjManip.blank` order to increase accuracy.
This commit is contained in:
Kepoor Hampond 2017-08-09 13:20:29 -07:00 committed by GitHub
commit da28e7e9a1
3 changed files with 6 additions and 4 deletions

View file

@ -18,4 +18,4 @@ ffmpeg binaries.")
exit(1) exit(1)
else: else:
from .ripper import Ripper from .ripper import Ripper
Ripper # PyLinter reasons Ripper

View file

@ -259,8 +259,8 @@ with init, or in method arguments.")
YdlUtils.clear_line() YdlUtils.clear_line()
print(self.args["hook-text"].get("list") print(self.args["hook-text"].get("list")
.format(type.title(), the_list["name"], .format(type.title(), the_list["name"].encode("utf-8"),
the_list["artists"][0]["name"])) the_list["artists"][0]["name"].encode("utf-8")))
compilation = "" compilation = ""
if type == "album": if type == "album":

View file

@ -95,9 +95,11 @@ class ObjManip: # Object Manipulation
return True return True
return False return False
def blank(string, downcase=True): def blank(string, downcase=True, remove_and=True):
if downcase: if downcase:
string = string.lower() string = string.lower()
if remove_and:
string = string.replace("and", "")
import re import re
regex = re.compile('[^a-zA-Z0-9\ ]') regex = re.compile('[^a-zA-Z0-9\ ]')
if sys.version_info == 2: if sys.version_info == 2: