abstract-webtools 0.1.6.156__tar.gz → 0.1.6.158__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/PKG-INFO +1 -1
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/setup.py +1 -1
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/sslManager.py +9 -6
- abstract_webtools-0.1.6.158/src/abstract_webtools/managers/tlsAdapter.py +64 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/PKG-INFO +1 -1
- abstract_webtools-0.1.6.156/src/abstract_webtools/managers/tlsAdapter.py +0 -27
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/README.md +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/pyproject.toml +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/setup.cfg +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/abstract_usurpit.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/abstract_webtools.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/big_user_agent_list.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/domain_identifier.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/extention_list.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/find_dirs.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/k2s_downloader.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/main.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/allss.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/cipherManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/clownworld/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/clownworld/get_bolshevid_video.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/crawlManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/crawlmgr2.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/curlMgr.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/domainManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/dynamicRateLimiter.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/get_test.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/linkManager/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/linkManager/linkManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/meta_dump.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/imports.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/src/UnifiedWebManage3r.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/src/UnifiedWebManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/src/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/middleManager/src/legacy_tools.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/mySocketClient.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/networkManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/requestManager/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/requestManager/requestManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/seleneumManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/seleniumManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/soupManager/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/soupManager/asoueces.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/soupManager/soupManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/urlManager/__init__.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/urlManager/urlManager (Copy).py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/urlManager/urlManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/userAgentManager.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/videoDownloader.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/videoDownloader2.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/soup_gui.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/url_grabber_new.py +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/SOURCES.txt +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/dependency_links.txt +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/requires.txt +0 -0
- {abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: abstract_webtools
|
3
|
-
Version: 0.1.6.
|
3
|
+
Version: 0.1.6.158
|
4
4
|
Summary: Utilities for fetching/parsing web content with requests/urllib3/BS4 and helpers.
|
5
5
|
Home-page: https://github.com/AbstractEndeavors/abstract_webtools
|
6
6
|
Author: putkoff
|
@@ -5,7 +5,7 @@ README = Path("README.md").read_text(encoding="utf-8")
|
|
5
5
|
|
6
6
|
setup(
|
7
7
|
name="abstract_webtools",
|
8
|
-
version='0.1.6.
|
8
|
+
version='0.1.6.158', # bump once per release
|
9
9
|
author="putkoff",
|
10
10
|
author_email="partners@abstractendeavors.com",
|
11
11
|
description="Utilities for fetching/parsing web content with requests/urllib3/BS4 and helpers.",
|
@@ -1,21 +1,24 @@
|
|
1
|
-
from ..abstract_webtools import *
|
2
1
|
# sslManager.py
|
3
|
-
from ..abstract_webtools import *
|
4
|
-
|
2
|
+
from ..abstract_webtools import *
|
3
|
+
import ssl, certifi
|
5
4
|
|
6
5
|
class SSLManager:
|
7
|
-
def __init__(self, ciphers=None, ssl_options=None, certification=None):
|
6
|
+
def __init__(self, ciphers=None, ssl_options=None, certification=None, cafile=None):
|
8
7
|
self.ciphers = ciphers or CipherManager().ciphers_string
|
9
8
|
self.ssl_options = ssl_options or self.get_default_ssl_settings()
|
10
9
|
self.certification = certification or ssl.CERT_REQUIRED
|
10
|
+
self.cafile = cafile or certifi.where() # << add this
|
11
11
|
self.ssl_context = self.get_context()
|
12
12
|
|
13
13
|
def get_default_ssl_settings(self):
|
14
14
|
return ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_COMPRESSION
|
15
15
|
|
16
16
|
def get_context(self):
|
17
|
-
|
17
|
+
ctx = ssl_.create_urllib3_context(
|
18
18
|
ciphers=self.ciphers,
|
19
19
|
cert_reqs=self.certification,
|
20
|
-
options=self.ssl_options
|
20
|
+
options=self.ssl_options,
|
21
21
|
)
|
22
|
+
# load CA roots
|
23
|
+
ctx.load_verify_locations(cafile=self.cafile) # << add this
|
24
|
+
return ctx
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# tls_adapter.py
|
2
|
+
from typing import Optional, List
|
3
|
+
from requests.adapters import HTTPAdapter
|
4
|
+
from urllib3.poolmanager import PoolManager
|
5
|
+
|
6
|
+
# If these live in your package root, adjust the import as needed:
|
7
|
+
from ..abstract_webtools import SSLManager
|
8
|
+
|
9
|
+
class TLSAdapter(HTTPAdapter):
|
10
|
+
"""
|
11
|
+
Requests adapter that injects a preconfigured SSLContext (from SSLManager)
|
12
|
+
into both the main pool and any proxy pools.
|
13
|
+
"""
|
14
|
+
def __init__(
|
15
|
+
self,
|
16
|
+
ssl_manager: Optional[SSLManager] = None,
|
17
|
+
ciphers: Optional[List[str]] = None,
|
18
|
+
certification: Optional[int] = None, # e.g. ssl.CERT_REQUIRED
|
19
|
+
ssl_options: Optional[int] = None
|
20
|
+
) -> None:
|
21
|
+
self.ssl_manager = ssl_manager or SSLManager(
|
22
|
+
ciphers=ciphers,
|
23
|
+
ssl_options=ssl_options,
|
24
|
+
certification=certification,
|
25
|
+
)
|
26
|
+
# expose a few attrs if you compare in the singleton
|
27
|
+
self.ciphers = self.ssl_manager.ciphers
|
28
|
+
self.certification = self.ssl_manager.certification
|
29
|
+
self.ssl_options = self.ssl_manager.ssl_options
|
30
|
+
self.ssl_context = self.ssl_manager.ssl_context
|
31
|
+
super().__init__()
|
32
|
+
|
33
|
+
def init_poolmanager(self, *args, **kwargs) -> None:
|
34
|
+
kwargs["ssl_context"] = self.ssl_context
|
35
|
+
super().init_poolmanager(*args, **kwargs)
|
36
|
+
|
37
|
+
def proxy_manager_for(self, proxy, **proxy_kwargs) -> PoolManager:
|
38
|
+
proxy_kwargs["ssl_context"] = self.ssl_context
|
39
|
+
return super().proxy_manager_for(proxy, **proxy_kwargs)
|
40
|
+
|
41
|
+
|
42
|
+
class TLSAdapterSingleton:
|
43
|
+
_instance: Optional[TLSAdapter] = None
|
44
|
+
|
45
|
+
@staticmethod
|
46
|
+
def get_instance(
|
47
|
+
ciphers: Optional[List[str]] = None,
|
48
|
+
certification: Optional[int] = None,
|
49
|
+
ssl_options: Optional[int] = None
|
50
|
+
) -> TLSAdapter:
|
51
|
+
inst = TLSAdapterSingleton._instance
|
52
|
+
if (
|
53
|
+
inst is None
|
54
|
+
or inst.ciphers != ciphers
|
55
|
+
or inst.certification != certification
|
56
|
+
or inst.ssl_options != ssl_options
|
57
|
+
):
|
58
|
+
inst = TLSAdapter(
|
59
|
+
ciphers=ciphers,
|
60
|
+
certification=certification,
|
61
|
+
ssl_options=ssl_options,
|
62
|
+
)
|
63
|
+
TLSAdapterSingleton._instance = inst
|
64
|
+
return inst
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: abstract_webtools
|
3
|
-
Version: 0.1.6.
|
3
|
+
Version: 0.1.6.158
|
4
4
|
Summary: Utilities for fetching/parsing web content with requests/urllib3/BS4 and helpers.
|
5
5
|
Home-page: https://github.com/AbstractEndeavors/abstract_webtools
|
6
6
|
Author: putkoff
|
@@ -1,27 +0,0 @@
|
|
1
|
-
from ..abstract_webtools import *
|
2
|
-
class TLSAdapter(HTTPAdapter):
|
3
|
-
def __init__(self, ssl_manager=None,ciphers=None, certification: Optional[str] = None, ssl_options: Optional[List[str]] = None):
|
4
|
-
if ssl_manager == None:
|
5
|
-
ssl_manager = SSLManager(ciphers=ciphers, ssl_options=ssl_options, certification=certification)
|
6
|
-
self.ssl_manager = ssl_manager
|
7
|
-
self.ciphers = ssl_manager.ciphers
|
8
|
-
self.certification = ssl_manager.certification
|
9
|
-
self.ssl_options = ssl_manager.ssl_options
|
10
|
-
self.ssl_context = self.ssl_manager.ssl_context
|
11
|
-
super().__init__()
|
12
|
-
|
13
|
-
def init_poolmanager(self, *args, **kwargs):
|
14
|
-
kwargs['ssl_context'] = self.ssl_context
|
15
|
-
return super().init_poolmanager(*args, **kwargs)
|
16
|
-
class TLSAdapterSingleton:
|
17
|
-
_instance: Optional[TLSAdapter] = None
|
18
|
-
|
19
|
-
@staticmethod
|
20
|
-
def get_instance(ciphers: Optional[List[str]] = None, certification: Optional[str] = None, ssl_options: Optional[List[str]] = None) -> TLSAdapter:
|
21
|
-
if (not TLSAdapterSingleton._instance) or (
|
22
|
-
TLSAdapterSingleton._instance.ciphers != ciphers or
|
23
|
-
TLSAdapterSingleton._instance.certification != certification or
|
24
|
-
TLSAdapterSingleton._instance.ssl_options != ssl_options
|
25
|
-
):
|
26
|
-
TLSAdapterSingleton._instance = TLSAdapter(ciphers=ciphers, certification=certification, ssl_options=ssl_options)
|
27
|
-
return TLSAdapterSingleton._instance
|
File without changes
|
File without changes
|
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/extention_list.py
RENAMED
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/find_dirs.py
RENAMED
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/k2s_downloader.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/managers/allss.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/soup_gui.py
RENAMED
File without changes
|
{abstract_webtools-0.1.6.156 → abstract_webtools-0.1.6.158}/src/abstract_webtools/url_grabber_new.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|