def _GetLibyalGithubReleasesLatestVersion(library_name):
  download_url = (
      u'https://github.com/libyal/{0:s}/releases').format(library_name)

  page_content = _DownloadPageContent(download_url)
  if not page_content:
    return 0

  page_content = page_content.decode(u'utf-8')

  # The format of the project download URL is:
  # /libyal/{project name}/releases/download/{git tag}/
  # {project name}{status-}{version}.tar.gz
  # Note that the status is optional and will be: beta, alpha or experimental.
  expression_string = (
      u'/libyal/{0:s}/releases/download/[^/]*/{0:s}-[a-z-]*([0-9]+)'
      u'[.]tar[.]gz').format(library_name)
  matches = re.findall(expression_string, page_content)

  if not matches:
    return 0

  return int(max(matches))


# TODO: Remove when Google Drive support is no longer needed.
Retrieves the latest version number of a libyal library on GitHub releases.
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/dependencies.py/_GetLibyalGithubReleasesLatestVersion