mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-28 02:16:16 +00:00
Added general exception catch when tring to connect to deezer
This commit is contained in:
parent
1e9e28ec2c
commit
34b93de62c
4
app.py
4
app.py
|
@ -96,7 +96,11 @@ class deemix:
|
|||
|
||||
def checkDeezerAvailability(self):
|
||||
print("Pinging deezer.com...")
|
||||
try:
|
||||
body = requests.get("https://www.deezer.com/", headers={'Cookie': 'dz_lang=en; Domain=deezer.com; Path=/; Secure; hostOnly=false;'}).text
|
||||
except Exception as e:
|
||||
self.isDeezerAvailable = False
|
||||
print(f"deezer.com not reached! {str(e)}")
|
||||
title = body[body.find('<title>')+7:body.find('</title>')]
|
||||
self.isDeezerAvailable = title.strip() != "Deezer will soon be available in your country."
|
||||
print(f"deezer.com reached: {'Available' if self.isDeezerAvailable else 'Not Available'}")
|
||||
|
|
2
webui
2
webui
|
@ -1 +1 @@
|
|||
Subproject commit 08064146d5242dadcece4cd0fbb910e7f302bad0
|
||||
Subproject commit fd564547279dbcb8ff1eaf08afe728291e640b62
|
Loading…
Reference in a new issue