music-kraken-core/contribute.md
2023-06-23 13:31:49 +02:00

1.7 KiB

How to contribute

I am always happy about pull requests.

If something is missing, like attributes for an object feel free to either add it yourself or open an issue, if you choose to just change it, beware that something may have to change. :3

So here is a List of what you can do:

  1. implement a new page like e.g. Soundcloud

Add a new Page

The audio and Metadata Sources all inherit from the class Page, which can be found in abstract.py.

You can create a subclass of this class for, for example YouTube or Musify or whatever.

  1. Just create a new file with the name your_page.py in the page module.
  2. Then you can simply copy the contents of the preset over to your file.
  3. All the functions you need to implement, can be found in the preset.

Important notes

  • There is no need to check if you for example added a source of a song twice. I do much post-processing to the data you scrape in the page classes. You can see what exactly I do in abstract.py.
  • Use the connection class how it is laid out in the preset to make the request. This will take care of retrying requests, rotating proxies, consistent use of tor (if selected in the config). You have:
    • connection.get()
    • connection.post()
  • Look at the code of the pages I already have implemented. Namely: