Skip to content

Commit da42208

Browse files
committed
- updated to uv
- better dependency handling
1 parent 0a8bac7 commit da42208

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

missav_api/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__all__ = ["Client", "Callback"]
1+
__all__ = ["Client", "Callback", "Video"]
22

3-
from missav_api.missav_api import Client
3+
from missav_api.missav_api import Client, Video
44
from base_api.modules.progress_bars import Callback

missav_api/missav_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
PUBLIC_TOKEN = "Ikkg568nlM51RHvldlPvc2GzZPE9R4XGzaH9Qj4zK9npbbbTly1gj9K4mgRn0QlV"
2121
# You can change these if you want
2222

23+
try:
24+
import lxml
25+
parser = lxml
26+
27+
except (ModuleNotFoundError, ImportError):
28+
parser = "html.parser"
2329

2430
try:
2531
from modules.consts import *
@@ -75,7 +81,7 @@ def __init__(self, url: str, core: Optional[BaseCore] = None) -> None:
7581
self.core.enable_logging(level=logging.DEBUG)
7682
self.logger = setup_logger(name="MISSAV API - [Video]", log_file=None, level=logging.CRITICAL)
7783
self.content = self.core.fetch(url)
78-
self.soup = BeautifulSoup(self.content, "lxml")
84+
self.soup = BeautifulSoup(self.content, parser)
7985
_meta_div = self.soup.find("div", class_="space-y-2")
8086
self.meta_divs = _meta_div.find_all("div", class_="text-secondary")
8187

pyproject.toml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["uv_build>=0.9.18,<0.10.0"]
3+
build-backend = "uv_build"
44

55
[project]
66
name = "missAV_api"
7-
version = "1.4.8"
7+
version = "1.4.9"
88
description = "A Python API for the Porn Site missav.ws"
9-
readme = "README.md"
10-
requires-python = ">=3.6"
11-
license = { text = "LGPLv3" }
9+
readme = { file = "README.md", content-type = "text/markdown" }
10+
requires-python = ">=3.9"
11+
license = "LGPL-3.0-only"
12+
license-files = ["LICENSE"]
1213
authors = [
1314
{ name = "Johannes Habel", email = "EchterAlsFake@proton.me" }
1415
]
1516
dependencies = [
16-
"eaf_base_api",
1717
"bs4",
18-
"brotli",
19-
"lxml",
18+
"eaf_base_api",
19+
"m3u8",
2020
]
21-
optional-dependencies = {av = ["av"], ffmpeg = ["ffmpeg-progress-yield"]}
21+
2222
classifiers = [
2323
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
2424
"Programming Language :: Python",
2525
]
2626

27+
[project.optional-dependencies]
28+
av = ["av; python_version >= '3.10'"]
29+
full = ["lxml", "httpx[http2]", "httpx[socks]"] # H2 for HTTP 2.0 support, LXML for faster parsing speed, though optional :)
30+
2731
[project.urls]
2832
Homepage = "https://github.com/EchterAlsFake/missAV_api"
2933

3034
[tool.setuptools]
31-
packages = { find = {} }
35+
packages = { find = {} }
36+
37+
[tool.uv.build-backend]
38+
module-name = "missav_api"
39+
module-root = ""

0 commit comments

Comments
 (0)