added ipartners (McD-Hotspot PL)

netiawifi
selfisekai 2020-09-11 15:18:23 +02:00
parent ad0970c95c
commit 1d9ec7a7f5
2 changed files with 30 additions and 0 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