self._cache_dir = os.path.join(CACHE_DIR, self.id)
token = await self.get_token()
if not token:
- raise LoginFailed(f"Login failed for user {self.config.username}")
+ try:
+ # a spotify free/basic account can be recoognized when
+ # the username consists of numbers only - check that here
+ int(self.config.username)
+ # an integer can be parsed of the username, this is a free account
+ raise LoginFailed("Only Spotify Premium accounts are supported")
+ except ValueError:
+ # pylint: disable=raise-missing-from
+ raise LoginFailed(f"Login failed for user {self.config.username}")
return True
async def search(
return False
if not self.config.username:
raise LoginFailed("Username is invalid")
+ if "@" in self.config.username:
+ self.logger.warning(
+ "Emailadress detected instead of username, "
+ "it is advised to use the tunein username instead of email."
+ )
return True
async def search(