Preserve order when fetching urls from page (#69)

This commit is contained in:
Nodja
2019-10-10 21:13:10 -04:00
committed by aikaterna
parent 60274065f2
commit ef12d46745

View File

@@ -23,12 +23,13 @@ class YouTube(commands.Cog):
url_list = []
for track in yt_find:
url = f"https://www.youtube.com/watch?v={track}"
url_list.append(url)
if url not in url_list:
url_list.append(url)
except Exception as e:
url_list = [f"Something went terribly wrong! [{e}]"]
return list(set(url_list))
return url_list
@commands.command()
async def youtube(self, ctx, *, query: str):