https://github.com/lleans/lyricfind-scrapper
Simple API scrapper on LyricFInd 🎹
https://github.com/lleans/lyricfind-scrapper
api pyquery python3 scrapper
Last synced: about 2 months ago
JSON representation
Simple API scrapper on LyricFInd 🎹
- Host: GitHub
- URL: https://github.com/lleans/lyricfind-scrapper
- Owner: lleans
- License: mit
- Created: 2023-11-27T09:45:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T14:03:03.000Z (about 1 year ago)
- Last Synced: 2025-05-12T14:27:27.493Z (5 months ago)
- Topics: api, pyquery, python3, scrapper
- Language: Python
- Homepage: https://lyrics.lyricfind.com/
- Size: 42 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lyric Find Scrapper 🎹
LyricsFind is free online lyrics database, using simple scrapper PyQuery and Aiohttp to grab lyrics from the free-website.
## Option 💽
There's an multiple option on
Search
class. On there you can change the:- **
teritory
iso code e.g 'us'(all lower)** _(optional)_
The usage of this params is, to limit yourself based on country you are( the default value is by searching your ip location)```python
from LyricsFindScrapper import Searchsession = #your http client
client: Search = Search(
session=session,
teritory='us'
)
```- **
limit
use in params** _(optional)_
You can change the limit request to service. Defaulting on 10, just be mindful what you do.```python
from LyricsFindScrapper import Searchsession = #your http client
client: Search = Search(
session=session,
limit=10 # Be mindful what you change, bigger number may cuase you're being blocked by server
)
```## Function 🪛
There are a few funstions that usable as:
- **
get_tracks(query: str)
query as params(type str)**
Just like on the website, you can search an multiple tracks by using the query/title/artist/etc. This will return multiple list ofTrack
class.```python
from LyricsFindScrapper import Search, Tracksession = #your http client
client: Search = Search(session=session)#Make sure you're on async func.
#Getting tracks e.g
tracks: list[Track] = client.get_tracks(
query=#Your song title
)
```- **
get_track(trackid: str)
query as params(type str)**
Find sepcific track based on metdata. Will return asTrack
class.```python
from LyricsFindScrapper import Search, Tracksession = #your http client
client: Search = Search(session=session)#Make sure you're on async func.
#Getting track e.g
track: Track = await client.get_track(trackid=f'lfid:{tracks[0].lfid}')
```- **
get_lyrics(track: Track)
track as params(type Track)**
The tracks that you already got, pass it here to get the lyrics. This will return class ofSongData
.```python
from LyricsFindScrapper import Search, Track, SongDatasession = #your http client
client: Search = Search(session=session)#Make sure you're on async func.
#Getting tracks e.g
tracks: list[Track] = client.get_tracks(
query=#Your song title
)#Getting lyrics e.g
lyrics: SongData = client.get_lyrics(
track=tracks[0]
)
```- **
get_translation(track: Track, lang: str)
tracks and lang as params(type Track and str)**
Sometime LyricFind will provide the translation of the lyrics(if it exist. Check on their website). OnTrack
class you can find theavailable_translation
(if it exist) select the language you wanted, pass it onlang
as params. It will return youTranslation
class(identical withSongData
only few changes).```python
from LyricsFindScrapper import Search, Track, SongDatasession = #your http client
client: Search = Search(session=session)#Make sure you're on async func.
#Getting tracks e.g
tracks: list[Track] = client.get_tracks(
query=#Your song title
)#Getting lyrics e.g
lyrics: SongData = client.get_lyrics(
track=tracks[0]
)#Getting Translation e.g
translation: Translation = client.get_translation(
track=tracks[0],
lang='en'
)
```## Data Model 📅
All data model, you can acccess it [here 🎯](LyricsFindScrapper/model.py)
## Setup 🧩
If you want to use this on your local machine, download this repo, and make sure you run on virtualenv(it's optional)
1. Open terminal on the repo just you download, then run 📚
`pip install -r requirements.txt` to install required library
2. Then read and run it(dont mind the error, it's just for example) 📖
`press f5 if you on vscode`
`python demo.py` if you using terminal## About PyPi ? 🐍
about that, if you wanted to install this repo as library search on google pip install from github, currently i dont wanna this published on PyPi i just wanna keep this humble on underground library, let's see if i need it to published later