WIP
This commit is contained in:
4
lyric_search_new/sources/__init__.py
Normal file
4
lyric_search_new/sources/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import cache
|
||||
from . import genius
|
||||
from . import spotify
|
||||
from . import common
|
8
lyric_search_new/sources/cache.py
Normal file
8
lyric_search_new/sources/cache.py
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python3.12
|
||||
|
||||
class Cache:
|
||||
"""Cache Search Module"""
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
5
lyric_search_new/sources/common.py
Normal file
5
lyric_search_new/sources/common.py
Normal 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',
|
||||
}
|
25
lyric_search_new/sources/genius.py
Normal file
25
lyric_search_new/sources/genius.py
Normal 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
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
0
lyric_search_new/sources/spotify.py
Normal file
0
lyric_search_new/sources/spotify.py
Normal file
Reference in New Issue
Block a user