webtoolkit 0.1.52__tar.gz → 0.1.55__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.52 → webtoolkit-0.1.55}/PKG-INFO +1 -1
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/pyproject.toml +1 -1
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/remoteserver.py +18 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fakeinternetcontents.py +12 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fakeresponse.py +4 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/LICENSE +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/README.md +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/__init__.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/baseurl.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/contentinterface.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/contentlinkparser.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/contentmoderation.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/contenttext.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/crawlers/__init__.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/crawlers/crawlerinterface.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/crawlers/requestscrawler.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/domaincache.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/__init__.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/defaulturlhandler.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlerchannelodysee.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlerchannelyoutube.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlerhttppage.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlerinterface.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlers.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlervideoodysee.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/handlers/handlervideoyoutube.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/pages.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/remoteurl.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/request.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/response.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/statuses.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/__init__.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/__init__.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/codeproject.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/firebog.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/geekwirecom.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/githubcom.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/hackernews.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/instance.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/opmlfile.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/reddit.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/returndislike.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/robotstxtcom.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/thehill.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/warhammercommunity.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fake/youtube.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/fakeinternet.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/tests/mocks.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/urllocation.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/utils/dateutils.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/utils/logger.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/utils/memorychecker.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/webconfig.py +0 -0
- {webtoolkit-0.1.52 → webtoolkit-0.1.55}/webtoolkit/webtools.py +0 -0
|
@@ -190,6 +190,13 @@ class RemoteServer(object):
|
|
|
190
190
|
return
|
|
191
191
|
return json_obj
|
|
192
192
|
|
|
193
|
+
def is_remote_server_ok(link_call):
|
|
194
|
+
try:
|
|
195
|
+
with requests.get(url=link_call, timeout=timeout_s, verify=False) as result:
|
|
196
|
+
return result.status_code == 200
|
|
197
|
+
except Exception as E:
|
|
198
|
+
return False
|
|
199
|
+
|
|
193
200
|
def get_properties(self, url=None, request=None):
|
|
194
201
|
json_obj = self.get_getj(url=url, request=request)
|
|
195
202
|
|
|
@@ -234,6 +241,17 @@ class RemoteServer(object):
|
|
|
234
241
|
|
|
235
242
|
if "Default" in responses:
|
|
236
243
|
return responses["Default"]
|
|
244
|
+
|
|
245
|
+
# first try to return stream that matches request link
|
|
246
|
+
properties = RemoteServer.read_properties_section("Properties", all_properties)
|
|
247
|
+
if properties:
|
|
248
|
+
link = properties.get("link")
|
|
249
|
+
if link:
|
|
250
|
+
response = responses.get(link)
|
|
251
|
+
if response:
|
|
252
|
+
return response
|
|
253
|
+
|
|
254
|
+
# return first found response
|
|
237
255
|
for url in responses:
|
|
238
256
|
return responses[url]
|
|
239
257
|
|
|
@@ -181,3 +181,15 @@ webpage_with_date_published = """
|
|
|
181
181
|
</body>
|
|
182
182
|
</html>
|
|
183
183
|
"""
|
|
184
|
+
|
|
185
|
+
webpage_with_language = """
|
|
186
|
+
<html lang="it">
|
|
187
|
+
<head>
|
|
188
|
+
<link type="application/rss+xml" href="https://www.codeproject.com/WebServices/NewsRSS.aspx" />
|
|
189
|
+
<title>Page with a 'it' language</title>
|
|
190
|
+
</head>
|
|
191
|
+
|
|
192
|
+
<body>
|
|
193
|
+
</body>
|
|
194
|
+
</html>
|
|
195
|
+
"""
|
|
@@ -32,6 +32,7 @@ from webtoolkit.tests.fakeinternetcontents import (
|
|
|
32
32
|
webpage_html_casinos,
|
|
33
33
|
webpage_html_canonical_1,
|
|
34
34
|
webpage_with_date_published,
|
|
35
|
+
webpage_with_language,
|
|
35
36
|
)
|
|
36
37
|
from webtoolkit.tests.fake.geekwirecom import (
|
|
37
38
|
geekwire_feed,
|
|
@@ -400,6 +401,9 @@ class TestResponseObject(PageResponseObject):
|
|
|
400
401
|
elif url == "https://empty-page.com":
|
|
401
402
|
return ""
|
|
402
403
|
|
|
404
|
+
if url == "https://page-with-language.com":
|
|
405
|
+
return webpage_with_language
|
|
406
|
+
|
|
403
407
|
elif url == "https://www.codeproject.com/WebServices/NewsRSS.aspx":
|
|
404
408
|
return webpage_code_project_rss
|
|
405
409
|
|
|
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
|