Go to file
Hazel a451a97e1c
ci/woodpecker/push/woodpecker Pipeline was successful Details
Merge pull request 'feature/sponsorblock' (#17) from feature/sponsorblock into experimental
Reviewed-on: #17
2024-04-27 09:41:36 +00:00
.idea feat: hooked into ytdl to sign the function 2024-01-31 15:07:49 +01:00
.vscode fix: trace was passed in the request method shortened url for trace 2024-04-26 13:03:20 +02:00
assets fix: if request fails in a connection without host it raised an exception 2024-04-25 22:29:43 +02:00
development fix: properly stored encoding now 2024-04-26 14:24:14 +02:00
documentation feat: highlight downloadebel options 2024-01-16 10:08:08 +01:00
music_kraken feat: complete cache coverage for musify 2024-04-26 21:37:53 +02:00
tests fix: test 2024-04-23 11:44:39 +02:00
.env.example feat: auto disable debug on deploy 2024-04-10 12:18:32 +02:00
.gitignore ci: add _version.py to gitignore 2024-04-15 12:42:57 -07:00
.woodpecker.yml ci: force tags to be fetched 2024-04-16 11:07:27 -07:00
LICENSE Initial commit 2022-10-14 13:02:01 +02:00
README.md docs: add readme status badge 2024-04-16 10:09:10 -07:00
build ci: add pipeline 2024-04-15 11:44:19 -07:00
contribute.md updated documentation 2023-06-23 13:35:53 +02:00
notes.md fixed tests, they pass now 2023-03-24 10:30:40 +01:00
pyproject.toml feat: embedded own sponsorblock in youtube 2024-04-25 20:35:36 +02:00
requirements-dev.txt feat: build script 2024-04-09 11:48:32 +02:00

README.md

Music Kraken

Woodpecker CI Status

music kraken logo

Installation

You can find and get this project from either PyPI as a Python-Package, or simply the source code from GitHub. Note that even though everything SHOULD work cross-platform, I have only tested it on Ubuntu. If you enjoy this project, feel free to give it a star on GitHub.

THE PyPI PACKAGE IS OUTDATED

From source

if you use Debian or Ubuntu:

git clone https://github.com/HeIIow2/music-downloader
sudo apt install pandoc

cd music-downloader/
python3 -m pip install -r requirements.txt 

then you can add to ~/.bashrc

alias music-kraken='cd your/directory/music-downloader/src; python3 -m music_kraken'
alias 🥺='sudo'
source ~/.bashrc
music-kraken

Notes for WSL

If you choose to run it in WSL, make sure ~/.local/bin is added to your $PATH #2

Quick-Guide

The Genre you define at the start, is the folder my program will download the files into, as well as the value of the ID3 genre field.

When it drops you into the shell 2 main things are important:

  1. You search with s: <query/url>
  2. You choose an option with just the index number of the option
  3. You download with d: <options/url>, where the options are comma separated

Query

The syntax for the query is really simple.

> s: #a <any artist>
searches for the artist <any artist>

> s: #a <any artist> #r <any release>
searches for the release (album) <any release> by the artist <any artist>

> s: #r <any release> Me #t <any track>
searches for the track <any track> from the release <any relaese>

The escape character is as usual \.


CONTRIBUTE

I am happy about every pull request. To contribute look here.

Matrix Space

music-kraken logo

I decided against creating a discord server, due to various communities get often banned from discord. A good and free Alternative are Matrix Spaces. I recommend the use of the Client Element. It is completely open source.

Click this invitation (https://matrix.to/#/#music-kraken:matrix.org) to join.

TODO till the next release

These Points will most likely be in the changelogs.

  • Migrate away from pandoc, to a more lightweight alternative, that can be installed over PiPY.
  • Update the Documentation of the internal structure. (could be pushed back one release)

Programming Interface / Use as Library

This application is 100\% centered around Data. Thus, the most important thing for working with musik kraken is, to understand how I structured the data.

Quick Overview

---
title: Quick Overview (outdated)
---
sequenceDiagram

participant pg as Page (eg. YouTube, MB, Musify, ...)
participant obj as DataObjects (eg. Song, Artist, ...)
participant db as DataBase

obj ->> db: write
db ->> obj: read

pg -> obj: find a source for any page, for object.
obj -> pg: add more detailed data from according page.
obj -> pg: if available download audio to target.

Data Model

The Data Structure, that the whole programm is built on looks as follows:

---
title: Music Data
---
erDiagram



Target {

}

Lyrics {

}

Song {

}

Album {

}

Artist {

}

Label {

}

Source {

}

Source }o--|| Song : ""
Source }o--|| Lyrics : ""
Source }o--|| Album : ""
Source }o--|| Artist : ""
Source }o--|| Label : ""

Song }o--o{ Album : AlbumSong
Album }o--o{ Artist : ArtistAlbum
Song }o--o{ Artist : "ArtistSong (features)"

Label }o--o{ Album : LabelAlbum
Label }o--o{ Artist : LabelSong

Song ||--o{ Lyrics : ""
Song ||--o{ Target : ""

Ok now this WILL look intimidating, thus I break it down quickly.
That is also the reason I didn't add all Attributes here.

The most important Entities are:

  • Song
  • Album
  • Artist
  • Label

All of them (and Lyrics) can have multiple Sources, and every Source can only Point to one of those Element.

The Target Entity represents the location on the hard drive a Song has. One Song can have multiple download Locations.

The Lyrics Entity simply represents the Lyrics of each Song. One Song can have multiple Lyrics, e.g. Translations.

Here is the simplified Diagramm without only the main Entities.

---
title: simplified Music Data
---
erDiagram

Song {

}

Album {

}

Artist {

}

Label {

}

Song }o--o{ Album : AlbumSong
Album }o--o{ Artist : ArtistAlbum
Song }o--o{ Artist : "ArtistSong (features)"

Label }o--o{ Album : LabelAlbum
Label }o--o{ Artist : LabelSong

Looks way more manageable, doesn't it?

The reason every relation here is a n:m (many to many) relation is not, that it makes sense in the aspekt of modeling reality, but to be able to put data from many Sources in the same Data Model.
Every Service models Data a bit different, and projecting a one-to-many relationship to a many to many relationship without data loss is easy. The other way around it is basically impossible

Data Objects

Not 100% accurate yet and might change slightly

Creation

# needs to be added

If you just want to start implementing, then just use the code example I provided, I don't care.
For those who don't want any bugs and use it as intended (which is recommended, cuz I am only one person so there are defs bugs) continue reading, and read the whole documentation, which may exist in the future xD