mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Moved extra paackages
This commit is contained in:
12
auxiliary/malojalib/README.md
Normal file
12
auxiliary/malojalib/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# maloja-lib
|
||||
|
||||
Library for Python music players to allow users to scrobble to [Maloja](https://github.com/krateng/maloja) servers.
|
||||
|
||||
```
|
||||
from malojalib import MalojaInstance
|
||||
|
||||
instance = MalojaInstance(user_supplied_url,user_supplied_key)
|
||||
|
||||
instance.scrobble(artists=['K/DA','Howard Shore','Blackbeard's Tea Party],title='Grüezi Wohl Frau Stirnimaa')
|
||||
|
||||
```
|
||||
27
auxiliary/malojalib/malojalib/__init__.py
Normal file
27
auxiliary/malojalib/malojalib/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import requests
|
||||
|
||||
class MalojaInstance:
|
||||
def __init__(self,base_url,key):
|
||||
self.base_url = base_url
|
||||
self.key = key
|
||||
|
||||
def test(self):
|
||||
url = self.base_url + '/apis/mlj_1/test'
|
||||
response = requests.get(url,{'key':self.key})
|
||||
|
||||
return (response.status_code == 200)
|
||||
|
||||
def scrobble(self,artists,title,timestamp=None,album=None,duration=None):
|
||||
payload = {
|
||||
'key':self.key,
|
||||
'artists':artists,
|
||||
'title':title,
|
||||
'time':timestamp,
|
||||
'album':album,
|
||||
'duration':duration
|
||||
}
|
||||
|
||||
url = self.base_url + '/apis/mlj_1/newscrobble'
|
||||
response = requests.post(url,payload)
|
||||
|
||||
return response.json()
|
||||
28
auxiliary/malojalib/pyproject.toml
Normal file
28
auxiliary/malojalib/pyproject.toml
Normal file
@@ -0,0 +1,28 @@
|
||||
[project]
|
||||
name = "maloja-lib"
|
||||
version = "1.0.0"
|
||||
description = "Utilities to interact with Maloja servers"
|
||||
readme = "./README.md"
|
||||
requires-python = ">=3.6"
|
||||
license = { file="../../LICENSE" }
|
||||
authors = [ { name="Johannes Krattenmacher", email="maloja@dev.krateng.ch" } ]
|
||||
|
||||
urls.repository = "https://github.com/krateng/maloja"
|
||||
urls.documentation = "https://github.com/krateng/maloja"
|
||||
|
||||
keywords = ["scrobbling", "music", "library", "api"]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||
"Operating System :: OS Independent"
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
"requests"
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
|
||||
[build-system]
|
||||
requires = ["flit_core >=3.2,<4"]
|
||||
build-backend = "flit_core.buildapi"
|
||||
Reference in New Issue
Block a user