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

Can't log in #89

Closed
xd-Neji opened this issue Oct 5, 2020 · 12 comments · Fixed by #90
Closed

Can't log in #89

xd-Neji opened this issue Oct 5, 2020 · 12 comments · Fixed by #90
Assignees
Labels

Comments

@xd-Neji
Copy link

xd-Neji commented Oct 5, 2020

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-10-05 00:02:12

Caught exception:
Traceback (most recent call last):
File "C:\Users\Necip\AppData\Roaming\Anki2\addons21\memrise2anki-extension\importer.py", line 214, in accept
if self.memriseService.login(self.usernameLineEdit.text(),self.passwordLineEdit.text()):
File "C:\Users\Necip\AppData\Roaming\Anki2\addons21\memrise2anki-extension\memrise.py", line 777, in login
for field in form.find_all("input"):
AttributeError: 'NoneType' object has no attribute 'find_all'

@wilddom wilddom self-assigned this Oct 6, 2020
@wilddom
Copy link
Owner

wilddom commented Oct 6, 2020

Should be fixed already, see #85. Could you try with the latest 1.2.2 release?

@benwoodward
Copy link

benwoodward commented Oct 6, 2020

I'm getting the same error. Using the code from master (cloned into /Users/ben/Library/Application\ Support/Anki2/addons21. Using the latest version of Anki (Version 2.1.35 (84dcaa86), Python 3.8.0 Qt 5.14.2 PyQt 5.14.2).

I have tried logging in with username+password, and email+password. Same error both times.

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.2
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-10-07 09:16:46
Add-ons possibly involved: ⁨memrise2anki-extension⁩

Caught exception:
Traceback (most recent call last):
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 214, in accept
    if self.memriseService.login(self.usernameLineEdit.text(),self.passwordLineEdit.text()):
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 823, in login
    for field in form.find_all("input"):
AttributeError: 'NoneType' object has no attribute 'find_all'

EDIT: Looks like memrise have an updated login URL: app.memrise.com/signin, plus, the auth is no longer done via a form but API call.

image

@wilddom
Copy link
Owner

wilddom commented Oct 6, 2020

@benwoodward The issue author was using an older version of the addon, so his bug has been fixed already. But as you mentioned, it looks as memrise changed the login again. And thank you for the edit, I just made the same findings. But no idea at the moment what kind of authentication they are using...

@wilddom wilddom added bug and removed duplicate labels Oct 6, 2020
@em-ilia
Copy link

em-ilia commented Oct 6, 2020

Just now I was having this issue, using release 1.2.2. I think I was able to fix it by changing the url at

request1 = urllib.request.Request('https://www.memrise.com/login/', None, {'Referer': 'https://www.memrise.com/'})

such that "www" is replaced with "app". Looking at the merged pull requests, this seems to already have been fixed, but the master branch still has the old URL.

I'm currently converting a rather large set, so I'll edit this post when that's done if there are any other errors that pop up.

EDIT: I got another runtime error, but fixed it by running :%s/www\.memrise/app\.memrise/g (replacing all instances of www in the url with app) in memrise.py. I've just downloaded a 2000+ card deck with this, and so far it seems that good things do indeed come to those who wait. Thanks so much for making this!

@benwoodward
Copy link

such that "www" is replaced with "app". Looking at the merged pull requests, this seems to already have been fixed, but the master branch still has the old URL.

I'm sure I tried this, but just tried again and now it's working. Hm..!

Now I have a different error:

Caught exception:
Traceback (most recent call last):
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 849, in importCourse
    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 150, in run
    course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self))
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 845, in loadCourse
    return courseLoader.loadCourse(self.getCourseIdFromUrl(url))
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 610, in loadCourse
    course.title = sanitizeName(courseData["session"]["course"]["name"], "Course")
TypeError: 'NoneType' object is not subscriptable

@em-ilia
Copy link

em-ilia commented Oct 6, 2020

such that "www" is replaced with "app". Looking at the merged pull requests, this seems to already have been fixed, but the master branch still has the old URL.

I'm sure I tried this, but just tried again and now it's working. Hm..!

Now I have a different error:

Caught exception:
Traceback (most recent call last):
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 849, in importCourse
    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 150, in run
    course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self))
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 845, in loadCourse
    return courseLoader.loadCourse(self.getCourseIdFromUrl(url))
  File "/Users/ben/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 610, in loadCourse
    course.title = sanitizeName(courseData["session"]["course"]["name"], "Course")
TypeError: 'NoneType' object is not subscriptable

I did this same thing, but with all occurrences in that file and I was able to download successfully.

@benwoodward
Copy link

Can you PR your code please @d-allison ?

@em-ilia
Copy link

em-ilia commented Oct 6, 2020

Haha, I'd love to but I'll have to figure out how to do that! I'm familiar with git but not so much with GitHub.

@benwoodward
Copy link

I just did a find and replace on the whole file memrise.py and it seems to be working. But I don't want to assume that every URL is app.memrise, and worried that this could cause other issues. I'll submit a PR, @wilddom could you take a look and make sure I'm not breaking anything?

@wilddom
Copy link
Owner

wilddom commented Oct 6, 2020

@benwoodward @d-allison Thanks guys! Looks like www.memrise.com/login forwards to app.memrise.com/signin but app.memrise.com/login doesn't, funny enough. Let's hope they won't deactivate the old login page. But I will have a look at the PR as soon as I have a free minute.

@benwoodward
Copy link

@benwoodward @d-allison Thanks guys! Looks like www.memrise.com/login forwards to app.memrise.com/signin but app.memrise.com/login doesn't, funny enough. Let's hope they won't deactivate the old login page. But I will have a look at the PR as soon as I have a free minute.

Yeah, I wouldn't expect it to remain that way for long. Seems like they have rebuilt the site and are in the process of transitioning.

@kaspis7
Copy link

kaspis7 commented Aug 30, 2023

Hello, how are you? I am new here and just instaled memrise to anki add on and can't login. What should I do? I am afraid that I don't understand where I should eplace on the whole file memrise.py to app.memrise. (I am not familiar with programming). Thank you

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

Successfully merging a pull request may close this issue.

5 participants