Skip to content

Commit

Permalink
Merge branch 'master' into add-veilid-client
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Dec 11, 2023
2 parents 2f5568b + 62f6daf commit 30a7b54
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
18 changes: 14 additions & 4 deletions automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class FacebookGroups(object):
_xpath_about = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[3]/div/div/div/div/div/div/div[1]/div/div/div/div/div[2]/a[1]/div[1]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[3]/div/div/div/div/div/div/div[1]/div/div/div/div/div[1]/div[1]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[1]',
]
_xpath_popup_close = [
'/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[1]/div/div[2]/div/div/div/div[1]/div/i',
Expand All @@ -25,12 +26,14 @@ class FacebookGroups(object):
_xpath_creation_date = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div/div[2]/div/div/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[3]/div/div/div[2]/div/div/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[3]/div/div/div[2]/div/div/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[3]/div/div/div[2]/div/div/span',
]
_xpath_history = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[4]/div/div/div[2]/div/div[2]/span/span',
]
_xpath_title = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[1]/div[2]/div/div/div/div/div[1]/div/div/div/div/div/div[1]/h1/span/a',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div[2]/div/div/div/div/div[1]/div/div/div/div/div/div[1]/h1/span/a',
]
_xpath_temporarily_blocked = [
'/html/body/div[1]/div[2]/div[1]/div/div/div[1]/div/div[2]/h2',
Expand All @@ -39,24 +42,31 @@ class FacebookGroups(object):
_xpath_members = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div/div[2]/div/div/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[2]/div/div/div[2]/div/div[1]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[2]/div/div/div[2]/div/div[1]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[2]/div/div/div[2]/div/div[1]/span',
]
_xpath_must_login = [
'/html/body/div[1]/div[1]/div[1]/div/div[2]/div/div',
]
_xpath_posts_today = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[1]/div/div/div[2]/div/div[1]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[1]/div/div/div[2]/div/div[1]/span',
]
_xpath_posts_monthly = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[1]/div/div/div[2]/div/div[2]/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[3]/div/div/div/div/div/div[2]/div/div[1]/div/div/div[2]/div/div[2]/span',
]
_xpath_privacy = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div/div[1]/span/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div/div[1]/span/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div/div[1]/span/span',
]
_xpath_privacy_details = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div/div[2]/span/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[2]/div/div/div[2]/div/div[2]/span/span',
]
_xpath_visible = [
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[3]/div/div/div[2]/div/div[2]/span/span',
'/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[4]/div/div/div/div/div/div[1]/div/div/div/div/div/div[2]/div[3]/div/div/div[2]/div/div[2]/span/span',
]

def __init__(self, url: str = None):
Expand Down Expand Up @@ -201,8 +211,8 @@ def members_count(self):
if count:
members_count = int(''.join(count)) if count else 0

log.debug(members_count)
return members_count
log.debug(members_count)
return members_count

def must_login(self):
try:
Expand Down Expand Up @@ -525,13 +535,13 @@ def screenshot(self, filename: str = 'screenshot.png'):
def screenshot_error(self):
"""get error screenshot"""
screenshot = self.screenshot(filename='screenshot-error.png')
log.info(f'{screenshot}')
log.debug(f'{screenshot}')
return screenshot

def screenshot_success(self):
"""get success screenshot"""
screenshot = self.screenshot(filename='screenshot-success.png')
log.info(f'{screenshot}')
log.debug(f'{screenshot}')
return screenshot

def set_url(self, url: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion automon/integrations/mac/airport/airport.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _command(command: str) -> list:
def create_psk(self, ssid: str, passphrase: str):
"""Create PSK from specified pass phrase and SSID."""
if self.run(args=f'-P --ssid={ssid} --password={passphrase}'):
return f'{self._scan_output}'.strip()
return f'{bytes(self._scan_output).decode()}'.strip()
return False

def disassociate(self):
Expand Down
17 changes: 10 additions & 7 deletions automon/integrations/mac/airport/ssid.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, ssid: dict):
self.SSID = self.SSID_STR
self.WPS_STATE = self.IE_KEY_WPS_SC_STATE

log.debug(f'{self.summary}')
self.summary

def __repr__(self):
return f'{self.summary}'
Expand All @@ -52,9 +52,12 @@ def __lt__(self, other):

@property
def summary(self):
return f'[rssi: {self.DISTANCE} dBm] ' \
f'{self.SSID} ' \
f'[ch: {self.CHANNEL}] ' \
f'[bssid: {self.MAC}] ' \
f'[noise: {self.NOISE}] ' \
f'[age: {self.AGE}] '
summary = f'[rssi: {self.DISTANCE} dBm] ' \
f'{self.SSID} ' \
f'[ch: {self.CHANNEL}] ' \
f'[bssid: {self.MAC}] ' \
f'[noise: {self.NOISE}] ' \
f'[age: {self.AGE}] '

log.debug(f'{summary}')
return summary
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="automonisaur",
version="0.3.26",
version="0.3.28",
author="naisanza",
author_email="[email protected]",
description="Core libraries for automonisaur",
Expand Down

0 comments on commit 30a7b54

Please sign in to comment.