removed web selector

now u dont have to pick a website to scrap (less annoying to use)
This commit is contained in:
siengrain 2022-02-12 04:54:30 +00:00
parent b60e351faa
commit 2c286c9d39
1 changed files with 11 additions and 17 deletions

28
main.py
View File

@ -1,31 +1,25 @@
#!/bin/env python #!/usr/bin/env python3
import azl import azl
import letras import letras
while True: while True:
web = ''
val = '' val = ''
artist = input('Name of the artist/band: ') artist = input('Name of the artist/band: ')
title = input('Name of the song: ') title = input('Name of the song: ')
web = input('Where would u like to search? (a for azl/l for letras): ') song_url = azl.getLink(artist, title)
if web == 'a': un_lyr = azl.getLyrics(song_url)
song_url = azl.getLink(artist, title) fin = azl.parsero(un_lyr)
un_lyr = azl.getLyrics(song_url) if fin == '<div id="RTK_u0kw"> <div id="RTK_YamI"> <div id="RTK_9uCq">':
fin = azl.parsero(un_lyr) fin = "Sorry I couldn't find that song :("
if fin == '<div id="RTK_u0kw"> <div id="RTK_YamI"> <div id="RTK_9uCq">': print('\n<------------------------------------------------------------->')
fin = "Sorry I couldn't find that song :(" if fin != "Sorry I couldn't find that song :(":
print('\n<------------------------------------------------------------->')
print(fin) print(fin)
elif web == 'l': else:
song_url = letras.getLink(artist, title) song_url = letras.getLink(artist, title)
un_lyr = letras.getLyrics(song_url) un_lyr = letras.getLyrics(song_url)
fin = letras.parsero(un_lyr) fin = letras.parsero(un_lyr)
print('\n<------------------------------------------------------------->')
print(fin) print(fin)
else:
print("I didn't give u that option dude")
continue
while True: while True:
print('<------------------------------------------------------------->') print('<------------------------------------------------------------->')
res = input("What's the move? (s to search for another song/q to quit): ") res = input("What's the move? (s to search for another song/q to quit): ")
@ -42,4 +36,4 @@ while True:
break break
else: else:
print('SOMETHING WENT HORRIBLY WRONG GOTTA GO') print('SOMETHING WENT HORRIBLY WRONG GOTTA GO')
break break