module helper.download_helper

Short summary

module pyrsslocal.helper.download_helper

various function to get the content from a url

source on GitHub

Functions

function

truncated documentation

get_url_content_timeout

Downloads a file from internet (it assumes it is text information, otherwise, encoding should be None).

Documentation

various function to get the content from a url

source on GitHub

pyrsslocal.helper.download_helper.get_url_content_timeout(url, timeout=10, output=None, encoding='utf8')

Downloads a file from internet (it assumes it is text information, otherwise, encoding should be None).

Parameters:
  • url – (str) url

  • timeout – (in seconds), after this time, the function drops an returns None, -1 for forever

  • output – (str) if None, the content is stored in that file

  • encoding – (str) utf8 by default, but if it is None, the returned information is binary

Returns:

content of the url

If the function automatically detects that the downloaded data is in gzip format, it will decompress it.

source on GitHub