mirror of https://gitlab.com/bashrc2/epicyon
Comments
parent
63eab91faa
commit
40ba283755
10
session.py
10
session.py
|
@ -21,6 +21,8 @@ from http.client import HTTPConnection
|
||||||
|
|
||||||
|
|
||||||
def create_session(proxy_type: str):
|
def create_session(proxy_type: str):
|
||||||
|
""" Creates a new session
|
||||||
|
"""
|
||||||
session = None
|
session = None
|
||||||
try:
|
try:
|
||||||
session = requests.session()
|
session = requests.session()
|
||||||
|
@ -226,6 +228,8 @@ def get_json(signing_priv_key_pem: str,
|
||||||
version: str = __version__, http_prefix: str = 'https',
|
version: str = __version__, http_prefix: str = 'https',
|
||||||
domain: str = 'testdomain',
|
domain: str = 'testdomain',
|
||||||
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
||||||
|
"""Download some json
|
||||||
|
"""
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
if debug and not quiet:
|
if debug and not quiet:
|
||||||
print('url: ' + str(url))
|
print('url: ' + str(url))
|
||||||
|
@ -263,6 +267,8 @@ def get_vcard(xml_format: bool,
|
||||||
session, url: str, params: {}, debug: bool,
|
session, url: str, params: {}, debug: bool,
|
||||||
version: str, http_prefix: str, domain: str,
|
version: str, http_prefix: str, domain: str,
|
||||||
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
||||||
|
"""Download a vcard
|
||||||
|
"""
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
if debug and not quiet:
|
if debug and not quiet:
|
||||||
print('url: ' + str(url))
|
print('url: ' + str(url))
|
||||||
|
@ -341,6 +347,8 @@ def download_html(signing_priv_key_pem: str,
|
||||||
session, url: str, headers: {}, params: {}, debug: bool,
|
session, url: str, headers: {}, params: {}, debug: bool,
|
||||||
version: str, http_prefix: str, domain: str,
|
version: str, http_prefix: str, domain: str,
|
||||||
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
||||||
|
"""Download a html document
|
||||||
|
"""
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
if debug and not quiet:
|
if debug and not quiet:
|
||||||
print('url: ' + str(url))
|
print('url: ' + str(url))
|
||||||
|
@ -473,6 +481,8 @@ def download_ssml(signing_priv_key_pem: str,
|
||||||
session, url: str, headers: {}, params: {}, debug: bool,
|
session, url: str, headers: {}, params: {}, debug: bool,
|
||||||
version: str, http_prefix: str, domain: str,
|
version: str, http_prefix: str, domain: str,
|
||||||
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
timeout_sec: int = 20, quiet: bool = False) -> {}:
|
||||||
|
"""Download a ssml document
|
||||||
|
"""
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
if debug and not quiet:
|
if debug and not quiet:
|
||||||
print('url: ' + str(url))
|
print('url: ' + str(url))
|
||||||
|
|
Loading…
Reference in New Issue