From 1d9ec7a7f557860878300d6601f0a09201fe556f Mon Sep 17 00:00:00 2001 From: selfisekai Date: Fri, 11 Sep 2020 15:18:23 +0200 Subject: [PATCH 1/2] added ipartners (McD-Hotspot PL) --- librefi/fxckers/_map.py | 2 ++ librefi/fxckers/ipartners.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 librefi/fxckers/ipartners.py diff --git a/librefi/fxckers/_map.py b/librefi/fxckers/_map.py index ee984bd..e418924 100644 --- a/librefi/fxckers/_map.py +++ b/librefi/fxckers/_map.py @@ -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), ] diff --git a/librefi/fxckers/ipartners.py b/librefi/fxckers/ipartners.py new file mode 100644 index 0000000..3a039f2 --- /dev/null +++ b/librefi/fxckers/ipartners.py @@ -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'
Date: Fri, 11 Sep 2020 15:18:52 +0200 Subject: [PATCH 2/2] fixed crash on fxcker assign --- librefi/librefi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librefi/librefi.py b/librefi/librefi.py index 276df5e..5221166 100644 --- a/librefi/librefi.py +++ b/librefi/librefi.py @@ -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