webtoolkit 0.1.46__tar.gz → 0.1.48__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.
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/PKG-INFO +1 -1
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/pyproject.toml +1 -1
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/defaulturlhandler.py +23 -2
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/remoteurl.py +7 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/LICENSE +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/README.md +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/__init__.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/baseurl.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/contentinterface.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/contentlinkparser.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/contentmoderation.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/contenttext.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/crawlers/__init__.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/crawlers/crawlerinterface.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/crawlers/requestscrawler.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/domaincache.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/__init__.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlerchannelodysee.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlerchannelyoutube.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlerhttppage.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlerinterface.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlers.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlervideoodysee.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/handlers/handlervideoyoutube.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/pages.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/remoteserver.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/request.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/response.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/statuses.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/__init__.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/__init__.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/codeproject.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/firebog.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/geekwirecom.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/githubcom.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/hackernews.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/instance.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/opmlfile.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/reddit.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/returndislike.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/robotstxtcom.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/thehill.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/warhammercommunity.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fake/youtube.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fakeinternet.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fakeinternetcontents.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/fakeresponse.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/tests/mocks.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/urllocation.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/utils/dateutils.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/utils/logger.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/utils/memorychecker.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/webconfig.py +0 -0
- {webtoolkit-0.1.46 → webtoolkit-0.1.48}/webtoolkit/webtools.py +0 -0
|
@@ -143,9 +143,30 @@ class DefaultCompoundChannelHandler(DefaultChannelHandler):
|
|
|
143
143
|
return self.get_response().get_text()
|
|
144
144
|
|
|
145
145
|
def get_response(self):
|
|
146
|
+
"""
|
|
147
|
+
There can be many responses.
|
|
148
|
+
If at least one is invalid - return it
|
|
149
|
+
|
|
150
|
+
If responses are valid return best match
|
|
151
|
+
"""
|
|
152
|
+
valid_responses = []
|
|
153
|
+
invalid_responses = []
|
|
154
|
+
|
|
146
155
|
responses = self.get_responses()
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
for response in responses:
|
|
157
|
+
if response.is_valid():
|
|
158
|
+
valid_responses.append(response)
|
|
159
|
+
else:
|
|
160
|
+
invalid_responses.append(response)
|
|
161
|
+
|
|
162
|
+
if len(invalid_responses) > 0:
|
|
163
|
+
return invalid_responses[0]
|
|
164
|
+
|
|
165
|
+
for response in responses:
|
|
166
|
+
if response.url == self.url:
|
|
167
|
+
return response
|
|
168
|
+
|
|
169
|
+
return responses[0]
|
|
149
170
|
|
|
150
171
|
def get_responses(self):
|
|
151
172
|
if self.responses and len(self.responses) > 0:
|
|
@@ -42,7 +42,11 @@ class RemoteUrl(ContentInterface):
|
|
|
42
42
|
:param all_properties: A dictionary of pre-fetched properties for the URL.
|
|
43
43
|
:param social_properties: A dictionary of pre-fetched social media properties.
|
|
44
44
|
"""
|
|
45
|
+
if request is not None and url is None:
|
|
46
|
+
url = request.url
|
|
47
|
+
|
|
45
48
|
super().__init__(url=url, contents=None)
|
|
49
|
+
|
|
46
50
|
self.request = request
|
|
47
51
|
self.remote_server_location = remote_server_location
|
|
48
52
|
self.server = RemoteServer(remote_server=self.remote_server_location)
|
|
@@ -53,6 +57,9 @@ class RemoteUrl(ContentInterface):
|
|
|
53
57
|
if self.all_properties:
|
|
54
58
|
self.get_responses()
|
|
55
59
|
|
|
60
|
+
def get_url(self):
|
|
61
|
+
return self.url
|
|
62
|
+
|
|
56
63
|
def get_remote_server_location():
|
|
57
64
|
return RemoteServer.get_remote_server_location()
|
|
58
65
|
|
|
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
|
|
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
|