Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blnet_web.py does not log_in #6

Closed
henfri opened this issue Dec 2, 2018 · 2 comments
Closed

blnet_web.py does not log_in #6

henfri opened this issue Dec 2, 2018 · 2 comments

Comments

@henfri
Copy link
Contributor

henfri commented Dec 2, 2018

Hello,

thanks for writing pyblnet.

I tried to run the example, but it fails.

First, I had to change line 37 and following of blnet.py to:
if use_ta: host = urlparse(address).hostname if host==None: host=self.address self.blnet_direct = BLNETDirect(host, ta_port)

because host was always None for me.

But then, blnet_web.py fails logging in. This is because r.headers does not include 'Set-Cookie'.
"r" includes the BL-Net website though.

Some more debugging:
If I run with use_web=False I do get the results of blnet.fetch()

Do you have an Idea what the reason could be?

By the way: If I use the webinerface in the browser I do not have to log in. I can log in though. Here, it accepts any password.

Greetings,
Hendrik

@nielstron
Copy link
Owner

The first error was likely caused by urlparse only parsing urls correctly that are prefixed by a "//". This is not necessary and will be fixed in a similar approach to your proposal.

But then, blnet_web.py fails logging in. This is because r.headers does not include 'Set-Cookie'.
"r" includes the BL-Net website though.
By the way: If I use the webinerface in the browser I do not have to log in. I can log in though. Here, it accepts any password.

So as a usual guest user, anybody could read and write your in and outputs? Then, a successful login would really not signify a successful command. Do you have a proposal on how to check a successful action? Do you think an additional parameter to enable/disable logging in and respective checks would solve the problem?

Some more debugging:
If I run with use_web=False I do get the results of blnet.fetch()

Did you enable use_ta? BLNETweb data collection should not at all be activated with use_web=False. The result with both enabled should be a dictionary with the correct subsections, but all of them empty.

@henfri
Copy link
Contributor Author

henfri commented Dec 8, 2018

Hello,

I think you have fixed the first problem already.
For the second one, I have added a pullrequest.

Greetings,
Hendrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants