|
27 | 27 | from base_api.modules.config import RuntimeConfig |
28 | 28 |
|
29 | 29 | """ |
30 | | -Copyright (c) 2024 Johannes Habel |
| 30 | +Copyright (c) 2024-2025 Johannes Habel |
31 | 31 |
|
32 | 32 | This program is free software: you can redistribute it and/or modify |
33 | 33 | it under the terms of the GNU General Public License as published by |
@@ -179,7 +179,7 @@ def extract_json_from_html(self): |
179 | 179 | if not self.enable_html: |
180 | 180 | raise HTML_IS_DISABLED("HTML content is disabled! See Documentation for more details") |
181 | 181 |
|
182 | | - soup = BeautifulSoup(self.html_content, 'html.parser') |
| 182 | + soup = BeautifulSoup(self.html_content, 'lxml') |
183 | 183 | script_tags = soup.find_all('script', {'type': 'application/ld+json'}) |
184 | 184 |
|
185 | 185 | combined_data = {} |
@@ -299,7 +299,7 @@ def direct_download_link(self, quality, mode) -> str: |
299 | 299 | if not self.enable_html: |
300 | 300 | raise HTML_IS_DISABLED("HTML content is disabled! See Documentation for more details") |
301 | 301 |
|
302 | | - soup = BeautifulSoup(self.html_content, 'html.parser') |
| 302 | + soup = BeautifulSoup(self.html_content, 'lxml') |
303 | 303 | available_links = [] |
304 | 304 |
|
305 | 305 | # Define the quality preferences in descending order |
@@ -494,7 +494,8 @@ def biography(self) -> str: |
494 | 494 | class Client: |
495 | 495 | def __init__(self, core: Optional[BaseCore] = None): |
496 | 496 | 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) |
498 | 499 | self.logger = setup_logger(name="EPorner API - [Client]", log_file=None, level=logging.CRITICAL) |
499 | 500 |
|
500 | 501 | def enable_logging(self, log_file: str, level, log_ip: str = None, log_port: int = None): |
|
0 commit comments