diff --git a/irs/cli.py b/irs/cli.py index 087e000..6454a92 100644 --- a/irs/cli.py +++ b/irs/cli.py @@ -26,6 +26,9 @@ name. Must be used with -s/--song or -A/--album") # Album parser.add_argument("-A", "--album", dest="album", help="Specify album \ name") + parser.add_argument("-e", "--exact", dest="exact", action="store_true", + help="The list will only be chosen if it equals the \ +user input.") # Playlist parser.add_argument("-u", "--username", dest="username", help="Specify \ diff --git a/irs/ripper.py b/irs/ripper.py index c98bfc1..563a175 100644 --- a/irs/ripper.py +++ b/irs/ripper.py @@ -167,7 +167,6 @@ init, or in method arguments.") try: if "yt-simple-endpoint style-scope ytd-video-renderer" in str(" ".join(link["class"])) or \ "yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 yt-uix-sessionlink spf-link " in str(" ".join(link["class"])): - if "&list=" not in link["href"]: return link except KeyError: @@ -231,8 +230,7 @@ album row at @ session".split(" ") return self.find_yt_url(song=song, artist=artist, additional_search=additional_search, caught_by_google=True) elif caught_by_google is True and first is not True: return self.find_yt_url(song, artist, additional_search, caught_by_google, first=True) - - + def album(self, title, artist=None): # Alias for spotify_list("album", ..) return self.spotify_list("album", title=title, artist=artist) diff --git a/irs/utils.py b/irs/utils.py index caef49f..61b43a3 100644 --- a/irs/utils.py +++ b/irs/utils.py @@ -90,8 +90,8 @@ class ObjManip: # Object Manipulation def check_garbage_phrases(phrases, string, title): for phrase in phrases: - if phrase in ObjManip.blank(string): - if phrase not in ObjManip.blank(title): + if phrase in string.lower(): + if phrase not in title.lower(): return True return False @@ -443,6 +443,12 @@ class Config: else: return True + def parse_exact(ripper): + exact = check_sources(ripper, "exact") + if exact in (True, False): + return exact + + #============== # Captcha Cheat