diff --git a/README.md b/README.md index c644bf2..2283483 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ 5. [About the Audio](#download) 6. [About the Lyrics](#lyrics) +I am happy about every pull request. To contribute look [here](contribute.md). + ![](https://github.com/HeIIow2/music-downloader/blob/master/assets/logo_cropped.jpg?raw=true) ## Installation diff --git a/contribute.md b/contribute.md new file mode 100644 index 0000000..3a55c59 --- /dev/null +++ b/contribute.md @@ -0,0 +1,13 @@ +# How to contribute + +I am always happy about pull requests. +If you wanna contribute, this is for you. Some options will follow: + +## Add an audio/metadata source + +The audio and Metadata Sources all inherint the class `Page` in [abstract.py](src/music_kraken/pages/abstract.py) + +You can create a subclass of this class for for example youtube or musify or whatever. +I documented the function it should have in the docstrings of [abstract.py](src/music_kraken/pages/abstract.py). If you are unsure about how it works, look at either the doccumentation *(will get more detailed soon)* or an [example](src/music_kraken/pages/encyclopaedia_metallum.py). For trying you're class you can make a skript simmilar to [this one](src/metal_archives.py). Make sure it is in the same directory though. + +> Read the part of the documentation, I already have written. diff --git a/src/goof.py b/src/metal_archives.py similarity index 100% rename from src/goof.py rename to src/metal_archives.py diff --git a/src/music_kraken/pages/youtube.py b/src/music_kraken/pages/youtube.py new file mode 100644 index 0000000..a5d6736 --- /dev/null +++ b/src/music_kraken/pages/youtube.py @@ -0,0 +1,46 @@ +from typing import List +import requests +from bs4 import BeautifulSoup +import pycountry + +from ..utils.shared import ( + ENCYCLOPAEDIA_METALLUM_LOGGER as LOGGER +) + +from .abstract import Page +from ..database import ( + MusicObject, + Artist, + Source, + SourcePages, + Song, + Album, + ID3Timestamp, + FormattedText +) +from ..utils import ( + string_processing +) + +INVIDIOUS_INSTANCE = "https://yewtu.be/feed/popular" + +class Youtube(Page): + """ + The youtube downloader should use https://invidious.io/ + to make the request. + They are an alternative frontend. + + To find an artist filter for chanel and search for + `{artist.name} - Topic` + and then ofc check for viable results. + + Ofc you can also implement searching songs by isrc. + + NOTE: I didn't look at the invidious api yet. If it sucks, + feel free to use projects like youtube-dl. + But don't implement you're own youtube client. + I don't wanna maintain that shit. + """ + API_SESSION: requests.Session = requests.Session() + + SOURCE_TYPE = SourcePages.YOUTUBE