Skip to content

Commit d0b384c

Browse files
committed
- http2 support
1 parent 0afb1a9 commit d0b384c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

eporner_api/eporner_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from base_api.modules.config import RuntimeConfig
2828

2929
"""
30-
Copyright (c) 2024 Johannes Habel
30+
Copyright (c) 2024-2025 Johannes Habel
3131
3232
This program is free software: you can redistribute it and/or modify
3333
it under the terms of the GNU General Public License as published by
@@ -179,7 +179,7 @@ def extract_json_from_html(self):
179179
if not self.enable_html:
180180
raise HTML_IS_DISABLED("HTML content is disabled! See Documentation for more details")
181181

182-
soup = BeautifulSoup(self.html_content, 'html.parser')
182+
soup = BeautifulSoup(self.html_content, 'lxml')
183183
script_tags = soup.find_all('script', {'type': 'application/ld+json'})
184184

185185
combined_data = {}
@@ -299,7 +299,7 @@ def direct_download_link(self, quality, mode) -> str:
299299
if not self.enable_html:
300300
raise HTML_IS_DISABLED("HTML content is disabled! See Documentation for more details")
301301

302-
soup = BeautifulSoup(self.html_content, 'html.parser')
302+
soup = BeautifulSoup(self.html_content, 'lxml')
303303
available_links = []
304304

305305
# Define the quality preferences in descending order
@@ -494,7 +494,8 @@ def biography(self) -> str:
494494
class Client:
495495
def __init__(self, core: Optional[BaseCore] = None):
496496
self.core = core or BaseCore(config=RuntimeConfig())
497-
self.core.initialize_session(headers)
497+
self.core.initialize_session()
498+
self.core.session.headers.update(headers)
498499
self.logger = setup_logger(name="EPorner API - [Client]", log_file=None, level=logging.CRITICAL)
499500

500501
def enable_logging(self, log_file: str, level, log_ip: str = None, log_port: int = None):

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "Eporner_API"
7-
version = "1.9.1"
7+
version = "1.9.2"
88
description = "A Python API for the Porn Site Eporner.com"
99
readme = "README.md"
1010
requires-python = ">=3.6"
@@ -15,6 +15,9 @@ authors = [
1515
dependencies = [
1616
"bs4",
1717
"eaf_base_api",
18+
"lxml",
19+
"h2",
20+
"brotli"
1821
]
1922
classifiers = [
2023
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",

0 commit comments

Comments
 (0)