initial commit

This commit is contained in:
Hazel 2024-04-24 10:58:48 +02:00
parent 13ee63c2b9
commit 6a7cf23e9d
5 changed files with 64 additions and 0 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"cSpell.words": [
"sponsorblock"
]
}

View File

@ -0,0 +1,6 @@
from python_sponsorblock import SponsorBlock
if __name__ == "__main__":
sb = SponsorBlock()

40
pyproject.toml Normal file
View File

@ -0,0 +1,40 @@
[build-system]
requires = ["hatchling", "hatch-requirements-txt", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.build]
directory = "dist"
[tool.hatch.build.targets.sdist]
include = ["python_sponsorblock/*.py", "python_sponsorblock/**/*.py" ]
[tool.hatch.build.targets.wheel]
packages = ["python_sponsorblock"]
[project.scripts]
music-kraken = "python_sponsorblock.__main__:cli"
[tool.hatch.version]
path = "python_sponsorblock/__about__.py"
[project]
name = "python-sponsorblock"
description = "This is a wrapper for the sponsorblock api, enabling you to get the timestamps of sponsor segments from youtube videos."
authors = [{ name = "Hazel", email = "hazel_is_cute@proton.me" }]
license = "MIT"
readme = "README.md"
repository = "https://gitea.elara.ws/music-kraken/python-sponsorblock"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"requests~=2.31.0",
]
dynamic = [
"version"
]

View File

@ -0,0 +1 @@
__version__ = '0.0.0'

View File

@ -0,0 +1,12 @@
import requests
class SponsorBlockError(Exception):
pass
class SponsorBlock:
def __init__(self, session: requests.Session = None, base_url: str = "https://sponsor.ajay.app"):
self.base_url: str = base_url
self.session: requests.Session = session or requests.Session()