webtoolkit 0.0.193__py3-none-any.whl → 0.0.194__py3-none-any.whl
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.
- webtoolkit/remoteserver.py +13 -7
- webtoolkit/remoteurl.py +5 -2
- {webtoolkit-0.0.193.dist-info → webtoolkit-0.0.194.dist-info}/METADATA +3 -2
- {webtoolkit-0.0.193.dist-info → webtoolkit-0.0.194.dist-info}/RECORD +6 -6
- {webtoolkit-0.0.193.dist-info → webtoolkit-0.0.194.dist-info}/WHEEL +1 -1
- {webtoolkit-0.0.193.dist-info → webtoolkit-0.0.194.dist-info}/LICENSE +0 -0
webtoolkit/remoteserver.py
CHANGED
|
@@ -25,15 +25,16 @@ class RemoteServer(object):
|
|
|
25
25
|
def __init__(self, remote_server=None, timeout_s=30):
|
|
26
26
|
self.remote_server = remote_server
|
|
27
27
|
if not self.remote_server:
|
|
28
|
-
|
|
29
|
-
CRAWLER_BUDDY_PORT = os.environ.get("CRAWLER_BUDDY_PORT")
|
|
30
|
-
if CRAWLER_BUDDY_SERVER and CRAWLER_BUDDY_PORT:
|
|
31
|
-
self.remote_server = (
|
|
32
|
-
f"http://{CRAWLER_BUDDY_SERVER}:{CRAWLER_BUDDY_PORT}"
|
|
33
|
-
)
|
|
28
|
+
self.remote_server = RemoteServer.get_remote_server_location()
|
|
34
29
|
|
|
35
30
|
self.timeout_s = timeout_s
|
|
36
31
|
|
|
32
|
+
def get_remote_server_location():
|
|
33
|
+
CRAWLER_BUDDY_SERVER = os.environ.get("CRAWLER_BUDDY_SERVER")
|
|
34
|
+
CRAWLER_BUDDY_PORT = os.environ.get("CRAWLER_BUDDY_PORT")
|
|
35
|
+
if CRAWLER_BUDDY_SERVER and CRAWLER_BUDDY_PORT:
|
|
36
|
+
return f"http://{CRAWLER_BUDDY_SERVER}:{CRAWLER_BUDDY_PORT}"
|
|
37
|
+
|
|
37
38
|
def get_getj(self, request=None, url=None):
|
|
38
39
|
"""
|
|
39
40
|
@returns None in case of error
|
|
@@ -145,6 +146,9 @@ class RemoteServer(object):
|
|
|
145
146
|
"""
|
|
146
147
|
@param link_call Remote server endpoint
|
|
147
148
|
@param url Url for which we call Remote server
|
|
149
|
+
|
|
150
|
+
Note: there should always be a timeout. Server might stop responding,
|
|
151
|
+
it could have hanged, etc.
|
|
148
152
|
"""
|
|
149
153
|
url = request.url
|
|
150
154
|
|
|
@@ -154,8 +158,10 @@ class RemoteServer(object):
|
|
|
154
158
|
|
|
155
159
|
text = None
|
|
156
160
|
|
|
157
|
-
|
|
161
|
+
# it is hard to think of a good deafult value
|
|
162
|
+
timeout_s = 60
|
|
158
163
|
if request.timeout_s is not None:
|
|
164
|
+
# remote server will have timeout_s we add some wiggle room for transmission
|
|
159
165
|
timeout_s = request.timeout_s
|
|
160
166
|
timeout_s += 5
|
|
161
167
|
|
webtoolkit/remoteurl.py
CHANGED
|
@@ -43,8 +43,8 @@ class RemoteUrl(ContentInterface):
|
|
|
43
43
|
"""
|
|
44
44
|
super().__init__(url=url, contents=None)
|
|
45
45
|
self.request = request
|
|
46
|
-
self.remote_server_location
|
|
47
|
-
self.server = RemoteServer(remote_server_location)
|
|
46
|
+
self.remote_server_location=remote_server_location
|
|
47
|
+
self.server = RemoteServer(remote_server=self.remote_server_location)
|
|
48
48
|
self.all_properties = all_properties
|
|
49
49
|
self.social_properties = social_properties
|
|
50
50
|
|
|
@@ -52,6 +52,9 @@ class RemoteUrl(ContentInterface):
|
|
|
52
52
|
if self.all_properties:
|
|
53
53
|
self.get_responses()
|
|
54
54
|
|
|
55
|
+
def get_remote_server_location():
|
|
56
|
+
return RemoteServer.get_remote_server_location()
|
|
57
|
+
|
|
55
58
|
def get_responses(self):
|
|
56
59
|
"""Provides URL responses"""
|
|
57
60
|
if self.all_properties is None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: webtoolkit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.194
|
|
4
4
|
Summary: Web tools and interfaces for Internet data processing.
|
|
5
5
|
License: GPL3
|
|
6
6
|
Author: Iwan Grozny
|
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
16
|
Requires-Dist: beautifulsoup4 (>=4.13.5,<5.0.0)
|
|
16
17
|
Requires-Dist: brutefeedparser (>=0.10.5,<0.11.0)
|
|
17
18
|
Requires-Dist: lxml (>=5.4.0,<6.0.0)
|
|
@@ -18,8 +18,8 @@ webtoolkit/handlers/handlers.py,sha256=-af5onXKvk-voeaHYe4pujzRStM39gCGrWoKMjbhQ
|
|
|
18
18
|
webtoolkit/handlers/handlervideoodysee.py,sha256=XPk2zaLVfxqzAAVsXo2k6-Y4JyRwzvhO_lIhHln3Y0w,3313
|
|
19
19
|
webtoolkit/handlers/handlervideoyoutube.py,sha256=-MaUwbAcv0_nX54goOhYpL-6XXofpAH9OqrJTzoeu4A,5067
|
|
20
20
|
webtoolkit/pages.py,sha256=1lO8VmcrfEvpX1uiPj3so1mGCsmCB-ECDoYFp-KIRxc,46614
|
|
21
|
-
webtoolkit/remoteserver.py,sha256=
|
|
22
|
-
webtoolkit/remoteurl.py,sha256=
|
|
21
|
+
webtoolkit/remoteserver.py,sha256=M0DRvDn52C0esHz20TGnhKmMgQPZCfZWuu6c-7kOCFg,8874
|
|
22
|
+
webtoolkit/remoteurl.py,sha256=HgSLda2avRwoGE-ZrCYH06e_lUSy5Vhxz7af8y91jYo,7727
|
|
23
23
|
webtoolkit/request.py,sha256=WriEXQG28oGnQFIS7CRYbaESlDDmcFba97GV_oTbU0U,8170
|
|
24
24
|
webtoolkit/response.py,sha256=gGHZeUKsWk53lkOL_Nh18m1nKwzzBEb6FUlja7R-rb0,18913
|
|
25
25
|
webtoolkit/statuses.py,sha256=dBW5HjhXbkrOzrmHH8YDTENl1mB-sCHNjS6PdsVaHDA,5948
|
|
@@ -47,7 +47,7 @@ webtoolkit/utils/dateutils.py,sha256=chHpgKdqn2q03m142SPSog2aAjaUhWNNRUQgQydOZe0
|
|
|
47
47
|
webtoolkit/utils/logger.py,sha256=SL6IYki4LPBxBQnUgyQo_qAf8ekNnvi8CiumyU4K_98,4681
|
|
48
48
|
webtoolkit/webconfig.py,sha256=5fM9CTwzsUcIqm162aT2tPgYlpADnHGl8SGvZbH8U4I,4174
|
|
49
49
|
webtoolkit/webtools.py,sha256=O-Qg7tJJxutvuiqSiJsKd8E7CdserkDAskqvh0u9D28,11845
|
|
50
|
-
webtoolkit-0.0.
|
|
51
|
-
webtoolkit-0.0.
|
|
52
|
-
webtoolkit-0.0.
|
|
53
|
-
webtoolkit-0.0.
|
|
50
|
+
webtoolkit-0.0.194.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
51
|
+
webtoolkit-0.0.194.dist-info/METADATA,sha256=TdyWYAthG4tHImx2pGyuYteIxjOO1v6W99uLIsKWXnA,6743
|
|
52
|
+
webtoolkit-0.0.194.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
53
|
+
webtoolkit-0.0.194.dist-info/RECORD,,
|
|
File without changes
|