Merge branch 'ipartners' into 'master'

ipartners fxcker + crash fix

See merge request laudom/librefi!1
netiawifi
Dominika 2020-09-11 13:36:12 +00:00
commit 3de1b8240d
3 changed files with 31 additions and 1 deletions

View File

@ -1,9 +1,11 @@
from ._dummy import DummyFxcker
from .umwarszawa import UMWarszawaFxcker
from .ledatel import LedatelFxcker
from .ipartners import IPartnersFxcker
fxckers_map = [
([r"re:MZK Opole \d{3}(?: (?:2.4|5)GHz)?"], DummyFxcker),
(["UM-Warszawa"], UMWarszawaFxcker),
(["Pendolino_WiFi"], LedatelFxcker),
(["McD-Hotspot"], IPartnersFxcker),
]

View File

@ -0,0 +1,28 @@
from ._common import BaseFxcker
from ..utils import regex_search_string, dump_qs
class IPartnersFxcker(BaseFxcker):
# made for McD-Hotspot (PL)
def unfxck(self, location=None):
startpage = self.request("GET", location)
url = regex_search_string(
r'<form method="POST" action=\'([^\']+)\'', startpage.text)
username = regex_search_string(
r'<input type="hidden" name="username" value="([^"]+)"',
startpage.text)
password = regex_search_string(
r'<input type="hidden" name="password" value="([^"]+)"',
startpage.text)
success_url = regex_search_string(
r'<input type="hidden" name="success_url" value="([^"]+)"',
startpage.text)
self.request("POST", url, data=dump_qs({
"username": username,
"password": password,
"success_url": success_url,
}), headers={
"Content-Type": "application/x-www-form-urlencoded",
})
# should work (?)
return True

View File

@ -72,7 +72,7 @@ class LibreFi:
fxcker = fxck_element[1]
break
if fxcker:
self.log.info("Switching fxcker to " + fxcker.FXCKER_KEY)
self.log.info("Switching fxcker to {}".format(fxcker.FXCKER_KEY))
self.current_fxcker = fxcker(
logger=self.logger, log_level=self.log_level)
return self.current_fxcker