def get_latest_pdfjs_url():
 github_api = 'https://api.github.com'
 endpoint = 'repos/mozilla/pdf.js/releases/latest'
 request_url = '{}/{}'.format(github_api, endpoint)
 with urllib.request.urlopen(request_url) as fp:
  data = json.loads(fp.read().decode('utf-8'))
 download_url = data['assets'][0]['browser_download_url']
 version_name = data['name']
 return (version_name, download_url)

def get_latest_pdfjs_url ( ) : github_api = 'https://api.github.com' endpoint = 'repos/mozilla/pdf.js/releases/latest' request_url = '{}/{}' . format ( github_api , endpoint ) with urllib . request . urlopen ( request_url ) as fp : data = json . loads ( fp . read ( ) . decode ( 'utf-8' ) ) download_url = data [ 'assets' ] [ 0 ] [ 'browser_download_url' ] version_name = data [ 'name' ] return ( version_name , download_url )
get the url of the latest pdf .