athul / athul/jiofi-cli

JioFi URL is not working

Open
#3 4 comments 0 reactions 0 assignees View on GitHub
bug Other Model
Dominant language
Python
Stars
36
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I git cloned the repo and ran `python3 jiofi.py devices` inside jiofi-cli/jiofi folder but it throws error, here is the traceback,

```
Traceback (most recent call last):
File "jiofi.py", line 121, in
main()
File "jiofi.py", line 117, in main
'device':deviceDetails
File "/Users/unmetric/Library/Python/3.7/lib/python/site-packages/fire/core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/Users/unmetric/Library/Python/3.7/lib/python/site-packages/fire/core.py", line 468, in _Fire
target=component.__name__)
File "/Users/unmetric/Library/Python/3.7/lib/python/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "jiofi.py", line 24, in getDevices
data = res.json()
File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 5 (char 4)
```
On digging deeper I found out that the script is making post request to the URL http://jiofi.local.html/cgi-bin/qcmap_web_cgi with form-data `Page: GetLANInfo` so I tried to replicate the same in postman and it's throwing 404 error,
Screenshot 2020-08-01 at 7 32 20 PM
I am able to access all my JioFi device details at http://jiofi.local.html/ and the product id is JMR540

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with jiofi.py, especially getDevices at line 24, and reproduce `python3 jiofi.py devices` against the JMR540. Inspect the POST to `http://jiofi.local.html/cgi-bin/qcmap_web_cgi` with `Page: GetLANInfo`; done means the command handles the device response and returns its details instead of a 404 or JSON decode error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.