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

Missing /login_ajax endpoint on instance #170

Closed
lexaSvarshik opened this issue Jan 1, 2023 · 5 comments
Closed

Missing /login_ajax endpoint on instance #170

lexaSvarshik opened this issue Jan 1, 2023 · 5 comments

Comments

@lexaSvarshik
Copy link

It should be patched, how it mentioned in #56, but I'm still getting the same output:
openedx2zim --course-url="https://apps.openedu.ru/learning/course/course-v1:urfu+PYAP+fall_2022/home" --publisher="edx201" --email="MY_EMAIL" --password "BEST_PASSWORD" --name="eba" --tmp-dir="output" --output="output" --debug --keep --format="mp4"

[openedx2zim::2023-01-01 20:13:40,806] INFO:Starting openedx2zim 1.0.1 with:
  Course URL: https://apps.openedu.ru/learning/course/course-v1:urfu+PYAP+fall_2022/home
  Email ID: MY_EMAIL
[openedx2zim::2023-01-01 20:13:40,806] DEBUG:Checking for missing binaries
[openedx2zim::2023-01-01 20:13:40,948] INFO:Testing openedx instance credentials ...
[openedx2zim::2023-01-01 20:13:46,776] ERROR:FAILED. An error occurred: Expecting value: line 7 column 1 (char 6)
[openedx2zim::2023-01-01 20:13:46,777] ERROR:Expecting value: line 7 column 1 (char 6)
Traceback (most recent call last):
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/site-packages/openedx2zim/entrypoint.py", line 213, in main
    scraper.run()
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/site-packages/openedx2zim/scraper.py", line 825, in run
    self.instance_connection.establish_connection()
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/site-packages/openedx2zim/instance_connection.py", line 67, in establish_connection
    self.instance_connection = self.get_api_json(
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/site-packages/openedx2zim/instance_connection.py", line 85, in get_api_json
    return json.loads(
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/svarka/.pyenv/versions/3.8.16/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 6)
@rgaudin
Copy link
Member

rgaudin commented Jan 2, 2023

@lexaSvarshik thank you for your report.

The scraper expects the /login_ajax to to present and working to log into the openedX instance.

Using your URL, https://apps.openedu.ru/login_ajax redirects to https://courses.openedu.ru (the homepage). It's an HTML webpage, and not the expected JSON payload.

Tried https://courses.openedu.ru/login_ajax (after all, browser access does uses https://courses.openedu.ru/login_refresh) but it redirects to https://openedu.ru/login_ajax which is a 404.

Maybe the openedX version there is not supported or maybe some features used by the scraper have been disabled/removed.

@rgaudin rgaudin changed the title JSONDecodeError while scraping Missing /login_ajax endpoint on instance Jan 2, 2023
@stale
Copy link

stale bot commented May 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label May 26, 2023
@benoit74
Copy link
Collaborator

benoit74 commented Jul 7, 2023

Looking into this issue, the problem is that an external provider (https://sso.openedu.ru) is configured on this instance (and this external identity provider pages have been tweaked to "look like" the root openEdx website but this a separate tool, looks like it is a Keycloak instance).

I let @rgaudin confirm, but I think we should rename this issue "Add support for openedx instance with external identity provider / SSO configured". Probably the minimal first step would be to find a way to detect it and display a nice error in the logs.

@stale stale bot removed the stale label Jul 7, 2023
@rgaudin
Copy link
Member

rgaudin commented Jul 8, 2023

I agree

@benoit74
Copy link
Collaborator

@lexaSvarshik I'm closing this as it is not a really bug, enhancement will be done with #172

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

No branches or pull requests

4 participants