This commit is contained in:
2025-01-12 20:19:48 -05:00
parent efe933a185
commit 725e463992
7 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
from . import cache
from . import genius
from . import spotify
from . import common

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env python3.12
class Cache:
"""Cache Search Module"""
def __init__(self):
pass

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env python3.12
SCRAPE_HEADERS = {
'accept': '*/*',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0',
}

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3.12
from .. import private
from . import common
from aiohttp import ClientTimeout, ClientSession, ClientError
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
"""

View File