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 13c71da9c4
3 changed files with 6 additions and 4 deletions

View file

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

View file

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

View file

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