Skip to content

Commit

Permalink
TeamViewer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
twkrol committed Dec 9, 2020
1 parent 31e287c commit 410835b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions clients/teamviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@
import re
from datetime import datetime, date
from bs4 import BeautifulSoup
import logging
from logging import critical, error, info, warning, debug

product = "TeamViewer"
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46'
headers = {'User-agent': 'Mozilla/5.0'} #needed for anti-script scrapping protection


def getReleaseDate(edition):
# Looking for release date

# Looking for release's changelog url
url = "https://community.teamviewer.com/t5/forums/filteredbylabelpage/board-id/Change_Logs_EN/label-name/windows"
body = urllib.request.urlopen(url).read()
url = "https://community.teamviewer.com/English/categories/change-logs-en"
req = urllib.request.Request(url, None, headers)

body = urllib.request.urlopen(req).read()

soup = BeautifulSoup(body, "html5lib")
chlogurl = soup.find("a", href=re.compile(edition))
chlogurl = soup.find("a", href=re.compile(edition), string=f"[Windows] v{edition} - Change Log")

debug(f"chlogurl: {chlogurl}")

# Looking for release date in changelog
try:
Expand All @@ -48,17 +54,18 @@ def getEditions(template):

# Looking for releases
url = "https://www.teamviewer.com/en/download/windows/"
request = urllib.request.Request(url, data=None, headers={'User-Agent': user_agent})
request = urllib.request.Request(url, data=None, headers=headers)

body = urllib.request.urlopen(request).read()
# body = urllib.request.urlopen("https://www.teamviewer.com/en/download/windows/").read()
soup = BeautifulSoup(body, "html5lib")

#Windows
# Looking for tag with content of 3 digits blocks starting with tab eg. <tab>13.2.2344 ...
found = soup.find(string=re.compile('\s\d+\.\d+\.\d+'))
release = found.lstrip().rstrip()

debug(f"release: {release}")

# Getting release data
item = copy.copy(template) # copy of Softver object

Expand Down
2 changes: 1 addition & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import argparse
import vergrabber

__version__ = '4.0.0'
__version__ = '4.0.1'
__author__ = 'Tomasz Krol'
__author_email__ = '[email protected]'

Expand Down

0 comments on commit 410835b

Please sign in to comment.