Jugran / lyrics-in-terminal

Python curses application to view lyrics of current playing song in terminal.
MIT License
250 stars 20 forks source link

lyrics not found. cannot connect to the internet #15

Closed AhmedHalim96 closed 3 years ago

AhmedHalim96 commented 3 years ago

it was working until a couple days a go and it gives this message

lyrics not found! :( Issue is: Cannot connect to internet!

Jugran commented 3 years ago

Looks like something is blocking access to internet.

Make sure you have stable connection and run the following python code to check internet connectivity.

from urllib.request import urlopen, Request

url = 'https://www.google.com/search?q=test'
HEADER = {'User-Agent': 'Mozilla/5.0'}

def connect():
    try:
        req = Request(url, data=None, headers=HEADER)
        req_url = urlopen(req)
        print('Connected to internet')
    except Exception as e:
        print('Cannot connect to internet!', e)

connect()

If it says connected to internet and lyrics-in-terminal still does not fetch lyrics the I would suggest reinstalling from pip.

AhmedHalim96 commented 3 years ago

I apologize for the delay it works now, maybe it was just a temporary problem. I'm just gonna go ahead and close this issue

dsolay commented 3 years ago

I have the same issue and when execute the code posted by @Jugran I get the following message:

Cannot connect to internet! HTTP Error 429: Too Many Requests

but only happen with google url

onegentig commented 2 months ago

Same as dsolay, I get 429: Too Many Requests on the Google URL, though it works properly in the browser. Any idea what could be causing that?