Skip to content

Commit

Permalink
Modrinth Initial Addin
Browse files Browse the repository at this point in the history
  • Loading branch information
LuCkYProgram committed Aug 4, 2022
1 parent c1c705f commit c13488f
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions cursepy/handlers/modrinth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Modrinth - Handlers for getting requests for Modrinth
A back up source of API requests just in case Curse Forge fails or receives errors
"""

from __future__ import annotations

import json
from typing import Any, Tuple

from cursepy.classes.search import SearchParam, url_convert
from cursepy.handlers.base import URLHandler
from cursepy.classes import base

class BaseModrinthHandler(URLHandler):

def __init__(self):
super().__init__('Modrinth', "https://api.modrinth.com", "/v2", '')

def pre_process(self, data: Any) -> Any:
return json.loads(data)

def post_process(self, data: Any) -> Any:
print("Hello!")


class ModrinthProject(URLHandler):

def build_url(self):

return self.proto.url_build('project/{}'.format('Modrinth'))

def format(self, data: dict):

return base.CurseAddon(data)

class SearchMods(BaseModrinthHandler):
""" """

class ModrinthMaven(BaseModrinthHandler):
""" All projects uploaded to Modrinth are automatically placed on a Maven repository (henceforth "the Maven").
This can be used for a variation of reasons, in tandem with a JVM build automation tool such as Gradle.
This tool will not be of any use to an everyday user, but can be very useful for mod or plugin developers.
Potential auto updater?"""

0 comments on commit c13488f

Please sign in to comment.