librefi/librefi/fxckers/umwarszawa.py

22 lines
709 B
Python
Raw Normal View History

2020-11-29 01:14:58 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2020-08-30 16:26:29 +02:00
from ._common import BaseFxcker
from ..utils import regex_search_string, dump_qs
class UMWarszawaFxcker(BaseFxcker):
_BASE_URL = "https://hotspotsystem.um.warszawa.pl"
def unfxck(self):
start_page = self.request(
"GET", self._BASE_URL + "/free/index.php").text
id = regex_search_string(
r'<input type="hidden" name="id" value="(\d+)"/>', start_page)
self.request("POST", self._BASE_URL +
"/free/login.php", data=dump_qs({
"id": id,
"register": "I accept - Connect me",
}))
return True