started documenting the programming interface
This commit is contained in:
parent
6122952b3f
commit
068c723b74
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "music_kraken"
|
name = "music_kraken"
|
||||||
version = "1.1.3"
|
version = "1.1.4"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Hellow2", email="Hellow2@outlook.de" },
|
{ name="Hellow2", email="Hellow2@outlook.de" },
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: music-kraken
|
Name: music-kraken
|
||||||
Version: 1.1.3
|
Version: 1.1.4
|
||||||
Summary: An extensive music downloader crawling the internet. It gets its metadata from a couple metadata provider, and it scrapes the audiofiles.
|
Summary: An extensive music downloader crawling the internet. It gets its metadata from a couple metadata provider, and it scrapes the audiofiles.
|
||||||
Home-page: https://github.com/HeIIow2/music-downloader
|
Home-page: https://github.com/HeIIow2/music-downloader
|
||||||
Author: Hellow2
|
Author: Hellow2
|
||||||
|
@ -1,8 +1,61 @@
|
|||||||
import music_kraken as mk
|
import music_kraken as mk
|
||||||
print(mk.__path__)
|
print(mk.__path__)
|
||||||
|
|
||||||
mk.cli()
|
# if you simply wan't to run the buildin minimal cli just do this:
|
||||||
|
# mk.cli()
|
||||||
|
|
||||||
# mk.lyrics.fetch_lyrics()
|
# SEARCH
|
||||||
# db = mk.utils.shared.database
|
|
||||||
# if len(db.get_custom_track([])) == 0:
|
"""
|
||||||
|
The whole programm takes the data it processes further from the cache, a sqlite database.
|
||||||
|
So bevore you can do anything, you will need to fill it with the songs you
|
||||||
|
wan't to download.
|
||||||
|
For now the base of everything is musicbrainz, so you need to get the
|
||||||
|
musicbrainz id and the type the id corresponds to (artist/release group/release/track).
|
||||||
|
To get this you first have to initialize a search object (music_kraken.metadata.metadata_search.Search).
|
||||||
|
"""
|
||||||
|
|
||||||
|
search_object = mk.metadata.metadata_search.Search()
|
||||||
|
|
||||||
|
"""
|
||||||
|
Then you need an initial "text search" to get some options you can choose from. For
|
||||||
|
this you can either specify artists releases and whatever directly with:
|
||||||
|
- Search.search_from_text(self, artist: str = None, release_group: str = None, recording: str = None)
|
||||||
|
Or you can search with a text Querry like in the default cli:
|
||||||
|
- Search.search_from_query(self, query: str)
|
||||||
|
"""
|
||||||
|
|
||||||
|
multiple_objects = search_object.search_from_text(artist=input("input the name of the artist: "))
|
||||||
|
|
||||||
|
"""
|
||||||
|
both possible methods return an instance of MultipleOptions. It can just be
|
||||||
|
printed or converted to a string.
|
||||||
|
"""
|
||||||
|
|
||||||
|
print(multiple_objects)
|
||||||
|
|
||||||
|
"""
|
||||||
|
After the first "text search" you can either search
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
All the data can be gotten from the temporary database / cache.
|
||||||
|
You can get the database object like this:
|
||||||
|
"""
|
||||||
|
|
||||||
|
cache = mk.database.temp_database.temp_database
|
||||||
|
print(cache)
|
||||||
|
|
||||||
|
"""
|
||||||
|
When fetching any song data from the cache, you will get it as Song
|
||||||
|
object (music_kraken.database.song.Song). There are multiple methods
|
||||||
|
to get different sets of Songs. The names explain the methods pretty
|
||||||
|
well:
|
||||||
|
- get_track_metadata(id: str)
|
||||||
|
- get_tracks_to_download()
|
||||||
|
- get_tracks_without_src()
|
||||||
|
- get_tracks_without_isrc()
|
||||||
|
- get_tracks_without_filepath()
|
||||||
|
|
||||||
|
the id always is a musicbrainz id and distinct for every track
|
||||||
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user