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
ec4258c8d8
|
@ -26,6 +26,9 @@ name. Must be used with -s/--song or -A/--album")
|
||||||
# Album
|
# Album
|
||||||
parser.add_argument("-A", "--album", dest="album", help="Specify album \
|
parser.add_argument("-A", "--album", dest="album", help="Specify album \
|
||||||
name")
|
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
|
# Playlist
|
||||||
parser.add_argument("-u", "--username", dest="username", help="Specify \
|
parser.add_argument("-u", "--username", dest="username", help="Specify \
|
||||||
|
|
|
@ -167,7 +167,6 @@ init, or in method arguments.")
|
||||||
try:
|
try:
|
||||||
if "yt-simple-endpoint style-scope ytd-video-renderer" in str(" ".join(link["class"])) or \
|
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"])):
|
"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"]:
|
if "&list=" not in link["href"]:
|
||||||
return link
|
return link
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -232,7 +231,6 @@ album row at @ session".split(" ")
|
||||||
elif caught_by_google is True and first is not 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)
|
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", ..)
|
def album(self, title, artist=None): # Alias for spotify_list("album", ..)
|
||||||
return self.spotify_list("album", title=title, artist=artist)
|
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):
|
def check_garbage_phrases(phrases, string, title):
|
||||||
for phrase in phrases:
|
for phrase in phrases:
|
||||||
if phrase in ObjManip.blank(string):
|
if phrase in string.lower():
|
||||||
if phrase not in ObjManip.blank(title):
|
if phrase not in title.lower():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -443,6 +443,12 @@ class Config:
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def parse_exact(ripper):
|
||||||
|
exact = check_sources(ripper, "exact")
|
||||||
|
if exact in (True, False):
|
||||||
|
return exact
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#==============
|
#==============
|
||||||
# Captcha Cheat
|
# Captcha Cheat
|
||||||
|
|
Loading…
Reference in a new issue