mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-22 17:35:28 +00:00
Merge pull request #39 from kepoorhampond/exact-album
-e/--exact flag feature
This commit is contained in:
commit
32b52df309
|
@ -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 \
|
||||
|
|
|
@ -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:
|
||||
|
@ -232,7 +231,6 @@ album row at @ session".split(" ")
|
|||
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)
|
||||
|
||||
|
|
10
irs/utils.py
10
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
|
||||
|
|
Loading…
Reference in a new issue