2025-01-12 20:19:48 -05:00
|
|
|
#!/usr/bin/env python3.12
|
|
|
|
|
2025-01-12 20:20:57 -05:00
|
|
|
from aiohttp import ClientTimeout, ClientSession, ClientError
|
2025-01-12 20:19:48 -05:00
|
|
|
from .. import private
|
|
|
|
from . import common
|
|
|
|
|
|
|
|
class Genius:
|
|
|
|
"""Genius Search Module"""
|
|
|
|
def __init__(self):
|
|
|
|
self.genius_url = private.genius_url
|
|
|
|
self.genius_search_url = f'{self.genius_url}api/search/song?q='
|
|
|
|
self.headers = common.SCRAPE_HEADERS
|
|
|
|
self.timeout = ClientTimeout(connect=2, sock_read=2.5)
|
|
|
|
|
|
|
|
async def search(self, artist: str, song: str):
|
|
|
|
"""
|
|
|
|
@artist: the artist to search
|
|
|
|
@song: the song to search
|
2025-01-12 20:20:57 -05:00
|
|
|
"""
|