haxe18 / telekom_fon_connect Goto Github PK
View Code? Open in Web Editor NEWScript for automatic login @ Telekom_FON Hotspot with your telekom credentials
License: Other
Script for automatic login @ Telekom_FON Hotspot with your telekom credentials
License: Other
Edit: please ignore, python3-lxml lib was missing
$ ./telekom_fon_connect.py -c telekom_fon_connect.conf
2019-06-22 07:48:07,203 INFO log_level is : DEBUG
2019-06-22 07:48:07,300 INFO You are not online, try to login now
2019-06-22 07:48:07,300 INFO Doing request to hotspot login page to fetch source code
2019-06-22 07:48:08,589 ERROR Error when parsing html code to get post data. Either a (temporary) error or script is not working anymore. Will try again
[...]
2019-06-22 07:48:11,116 INFO You are not online, try to login now
2019-06-22 07:48:11,116 INFO Doing request to hotspot login page to fetch source code
^CTraceback (most recent call last):
If I already logged in manually, there is no error:
$ ./telekom_fon_connect.py -c telekom_fon_connect.conf
2019-06-22 08:01:17,210 INFO log_level is : DEBUG
2019-06-22 08:01:22,321 INFO Your are now online and because no deamon mode selected i will exit now bye
I already changed the two lines in the telekom_fon_connect.conf
`
fon_username: 491701234567
fon_password: xxx-xxx-xxx
`
accordingly.
When running follwing command
./telekom_fon_connect.py -c telekom_fon_connect.conf
I get following logcat:
2021-05-24 17:57:08,606 INFO Doing request to hotspot login page to fetch source code 2021-05-24 17:57:08,750 ERROR Error when parsing html code to get post data. Either a (temporary) error or script is not working anymore. Will try again 2021-05-24 17:57:09,354 INFO You are not online, try to login now 2021-05-24 17:57:09,355 INFO Doing request to hotspot login page to fetch source code ^CTraceback (most recent call last): File "./telekom_fon_connect.py", line 332, in <module> sys.exit(main()) # If no arg, pass none File "./telekom_fon_connect.py", line 319, in main status = do_login(username,password,test_url,rlp_request_whitelist,telekom_api_endpoint,session_api_url,login_api_url,loglvl,login_url) File "./telekom_fon_connect.py", line 144, in do_login fon_source = do_request(url=login_url, level=loglvl) # Get source of login page to extract some infos to create a session File "./telekom_fon_connect.py", line 98, in do_request r = requests.get(url=url, timeout=timeout) # Do normal get request File "/usr/lib/python2.7/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 377, in _make_request httplib_response = conn.getresponse(buffering=True) File "/usr/lib/python2.7/httplib.py", line 1137, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 448, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 404, in _read_status line = self.fp.readline(_MAXLINE + 1) File "/usr/lib/python2.7/socket.py", line 480, in readline data = self._sock.recv(self._rbufsize) File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 285, in recv if not util.wait_for_read(self.socket, self.socket.gettimeout()): File "/usr/lib/python2.7/dist-packages/urllib3/util/wait.py", line 143, in wait_for_read return wait_for_socket(sock, read=True, timeout=timeout) File "/usr/lib/python2.7/dist-packages/urllib3/util/wait.py", line 104, in poll_wait_for_socket return bool(_retry_on_intr(do_poll, timeout)) File "/usr/lib/python2.7/dist-packages/urllib3/util/wait.py", line 53, in _retry_on_intr return fn(timeout) File "/usr/lib/python2.7/dist-packages/urllib3/util/wait.py", line 102, in do_poll return poll_obj.poll(t) KeyboardInterrupt
Whats the error about?
Hallo
hatte heute versucht den script bei mir auf RPI3 zu starten.
Es klappte, jedoch nicht lange.
nach ca 5min war die verbindung verloren und kein login mehr möglich
mit dem smartphone gings auch nicht.
heißt, das telekom ein sperre drin hat bei vielen usern gleichzeitig oder muss man etwas beachten?
Gruß
Andi
PS: top script, danke fürs share
Hi,
what about including a NAT configuration into the project?
thanks for your effort!
Hi,
is it possible to use the script with FON credentials as well?
br
It is not working with Python 3.6.8 on Ubuntu 18.10
$ ./telekom_fon_connect.py -c telekom_fon_connect.conf
2019-05-17 12:02:31,793 INFO log_level is : DEBUG
Traceback (most recent call last):
File "./telekom_fon_connect.py", line 331, in <module>
sys.exit(main()) # If no arg, pass none
File "./telekom_fon_connect.py", line 302, in main
online_request = do_request(url=test_url, do_head_only=True, want_header='location',level=loglvl) # Do head reguest to check online status
File "./telekom_fon_connect.py", line 102, in do_request
reset_http_debug_out(http_log) # Call final part of HTTP Debug output
File "./telekom_fon_connect.py", line 54, in reset_http_debug_out
debug_info = ''.join(http_log.content).replace('\\r', '').decode('string_escape').replace('\'', '')
AttributeError: 'str' object has no attribute 'decode'
Hi
eine Zeitlang hat das Skript super funktioniert. Nun kommt immer der Fehler "Es gibt einen Fehler. Bitte versuchen Sie es später noch einmal" und die Hotspot page erscheint aber leider kein Feld zum Login.
Ich verwendet einen Raspberry mit Raspbian.
Auf meinem Handy und MacBook funktioniert der Login komischerweise ohne Probleme.
Da ich leider keine Lösung finden konnte.
Bitte ich hier um Hilfe
Danke
Grüße
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.