From 49dfec3606ef7d8623324c2808e5d4de5d60cdc0 Mon Sep 17 00:00:00 2001 From: Kingu Date: Wed, 11 Nov 2020 12:37:21 +0100 Subject: [PATCH] fix Adobe Flash --- clients/flash.py | 14 +++++--- openapi.yaml | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 openapi.yaml diff --git a/clients/flash.py b/clients/flash.py index 863fff9..720c7c5 100644 --- a/clients/flash.py +++ b/clients/flash.py @@ -3,6 +3,7 @@ """ Module to grab actual editions & versions of Mozilla Firefox """ +import logging import copy import urllib.request import re @@ -16,11 +17,16 @@ def getReleaseDate(edition): # Looking for release date url = "https://helpx.adobe.com/flash-player/release-note/fp_" + edition + "_air_" + edition + "_release_notes.html" body = urllib.request.urlopen(url).read() - #print(url) + logging.debug(url) soup = BeautifulSoup(body, "html5lib") - value = soup.find('div', {'class': 'text parbase section'}).find_next('div').find_next('p').find_next('p').find_next('strong').get_text() - result = datetime.strptime(value, '%B %d, %Y').date() # date format example: March 7, 2017 - return result + tree = soup.find('div', {'class': 'text parbase section'}) + for leaf in tree: + value = leaf.find_next('div').find_next('p').find_next('p').find_next('strong').get_text() + try: + result = datetime.strptime(value, '%B %d, %Y').date() # date format example: March 7, 2017 + return result + except: + continue def getEditions(template): diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 0000000..ff5a3cc --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,93 @@ +openapi: 3.0.0 +info: + title: Vergrabber API + contact: + name: Tomasz Król + email: vergrabber@kingu.pl + version: 1.1.0 +servers: + - url: https://vergrabber.kingu.pl +paths: + /vergrabber.json: + get: + description: 'Returns all version definitions and signature information' + responses: + '200': + description: 'A tree of version definitions' + content: + application/json: + schema: + $ref: '#/components/schemas/Root' +components: + schemas: + Root: + type: object + properties: + signature: + $ref: '#/components/schemas/Signature' + server: + type: array + items: + type: object + $ref: '#/components/schemas/Application' + client: + type: array + items: + type: array + $ref: '#/components/schemas/Application' + latest: + type: array + items: + type: object + $ref: '#/components/schemas/Latest' + Signature: + type: object + properties: + app: + type: string + version: + type: string + author: + type: string + notice: + type: string + updated: + type: string + Version: + type: object + properties: + product: + type: string + edition: + type: string + version: + type: string + stable: + type: boolean + latest: + type: boolean + released: + type: string + ends: + type: string + lts: + type: boolean + Latest: + type: object + properties: + server: + type: array + $ref: '#/components/schemas/Application' + client: + type: array + $ref: '#/components/schemas/Application' + Application: + type: array + items: + type: object + $ref: '#/components/schemas/Edition' + Edition: + type: array + items: + type: object + $ref: '#/components/schemas/Version' \ No newline at end of file