[Userscript] Memrise Audio Provider

userscript

(Thomas Heiss) #61

@ripcurlgirl


(Casper Duo) #62

I’m unable to learn this course with this script enabled:

You get an empty page:


(Cooljingle) #63

The script was broken by another update - I’ve updated the script to fix the problem (0.1.16).


(Thomas Heiss) #64

Hi @cooljingle,

the last Memrise code update from Wesnesday 01/17/2018 fucked up your audio script V0.1.16.

TypeError: context.learnable.audios is undefined[Weitere Informationen] Memrise_Audio_Provider.user.js:162:29
injectAudioIfRequired file:///C:/MyFirefoxProfileDirectory/gm_scripts/Memrise_Audio_Provider/Memrise_Audio_Provider.user.js:162:29
MEMRISE.garden.boxes.load</</MEMRISE.garden.session.make_box</< file:///C:/MyFirefoxProfileDirectory/gm_scripts/Memrise_Audio_Provider/Memrise_Audio_Provider.user.js:83:46
[1]</</s<.activate_box https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:291432
enableInfiniteLearning/g.boxes.activate_box</< file:///C:/MyFirefoxProfileDirectory/gm_scripts/Memrise_Infinite_Learning/Memrise_Infinite_Learning.user.js:37:21
[1]</</s<.begin https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:291201
[1]</</<.session_start https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:22066
[1]</</<.load_session/<.success https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:19961
at.Callbacks/l https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:36968
at.Callbacks/u.fireWith https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:37739
i https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:75655
.send/n/< https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:80514
i https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:439737

Basically almost all your other scripts are broken - I will repost to all other user script threads.


(Huntress) #65

Hello, @cooljingle!
As @Thomas.Heiss has already reported, your awesome script has stopped working. The review session won’t start. Will be patiently waiting for my favorite script to be back and will miss it greatly. Thank you very much for it!


(Cooljingle) #66

Hopefully it’s all fixed again with the latest script update (v0.1.17).


(Thomas Heiss) #67

Hi @Cooljingle, a new error with v0.1.17 pops up when you hit the ENTER key and the field is empty (red) or not ALL letters or accents (diacretics) have been typed 100% correctly (yellow).

For some tested words which where OK (green) it worked already for PT7 (no strict typing) + DuoLingo PT (strict typing).

However, I would have to re-test the next version of your audio script with the “50 languages” course where definitely many audios are missing so your script will jump into…


[Userscript] Memrise all typing
(Huntress) #68

@cooljingle
Thank you for supporting this great script! I can confirm that there are some problems with v0.1.17. I wasn’t able to start a review session in firefox. I just get this screen.

In Chrome the session starts ok and with words that are answered correctly everything is ok, but I can’t get past the words I answer wrong. I get the reminding screen of the word, but can’t get past it as nor Enter neither “Next” button works.


Clicking on Next does nothing.

Thank you for supporting this. You are the best!


(Cooljingle) #69

Thanks for letting me know - the script was break on the ‘copytyping’ screens, should be fixed in the latest (v0.1.18)


(Thomas Heiss) #70

@cooljingle

V0.1.18 first worked great in three courses and the red error after the empty text field (or words/sentence with errors) was definitely fixed when I pressed the NEXT button.

Now I run this night 4+ times with V0.1.18 into a new error on some items (not always) as soon as the next item is loaded automatically or manual with the NEXT button (Memrise’s own “auto accept” default, “auto correct” script activated, “all typing” disabled OR enabled) with this strict-typing course https://www.memrise.com/course/359836/duolingo-brazilian-portuguese

Exact same error happens for the Preview and Review for the 50 languages PT BR course (many missin audio files): https://www.memrise.com/course/702398/50-languages-brazilian-portuguese-no-typing/

It does not matter if the words are normal (e.g escola) or contain diacritics (e.g estatística, código).
AFAIK there are multiple items (words) where no audio is uploaded.

TypeError: e.replace is not a function[Weitere Informationen]  memrise-bundle-47c687a97413.js:1:31636
	[17]</t.exports/s.fixMediaUrl https://d2rhekw5qr4gcj.cloudfront.net/dist/js/memrise-bundle-47c687a97413.js:1:31636
	MEMRISE.garden.boxes.load</</MEMRISE.renderer.fixMediaUrl</< file:///C:\MyFirefoxProfileDirectory/gm_scripts/Memrise_Audio_Provider/Memrise_Audio_Provider.user.js:105:32
	[17]</t.exports/s.renderAudioPlayer/< https://d2rhekw5qr4gcj.cloudfront.net/dist/js/memrise-bundle-47c687a97413.js:1:35436
	.each https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:12366
	[17]</t.exports/s.renderAudioPlayer https://d2rhekw5qr4gcj.cloudfront.net/dist/js/memrise-bundle-47c687a97413.js:1:35407
	[17]</t.exports/s.renderVal https://d2rhekw5qr4gcj.cloudfront.net/dist/js/memrise-bundle-47c687a97413.js:1:36837
	[1]</</c.ThingBox<.get_context https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:284790
	Class</<.inherit/r https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:269317
	[1]</</c.TestBox<.get_context https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:288172
	Class</<.inherit/r https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:269317
	[1]</</c.Box<.render https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:281515
	[1]</</c.Box<.activate https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:281154
	[1]</</c.ThingBox<.activate https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:283301
	Class</<.inherit/r https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:269317
	[1]</</c.TestBox<.activate https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:288779
	Class</<.inherit/r https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:269317
	[10]</f<.activate https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:384723
	Class</<.inherit/r https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:269317
	[1]</</s<.activate_box https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:291486
	enableInfiniteLearning/g.boxes.activate_box</< file:///C:\MyFirefoxProfileDirectory/gm_scripts/Memrise_Infinite_Learning/Memrise_Infinite_Learning.user.js:37:21
	[1]</</s<.advance https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:291313
	MEMRISE.garden.boxes.advance</< file:///C:\MyFirefoxProfileDirectory/gm_scripts/Memrise_Ignore_Previous/Memrise_Ignore_Previous.user.js:48:24
	[1]</</c.Box<.next_press/< https://d2rhekw5qr4gcj.cloudfront.net/garden/dist/js/garden-bundle-94009e949c13.js:1:282695
	e/l.fn https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:159750
	o/l.id< https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:159473
	i https://d2rhekw5qr4gcj.cloudfront.net/dist/js/libs-41c582fa7c13.js:1:439737
MEMRISE.renderer.fixMediaUrl = (function () {
                **var cached_function = MEMRISE.renderer.fixMediaUrl;**
                return function () {
                    if (arguments[0] === "AUDIO_PROVIDER" || (_.isArray(arguments[0]) && arguments[0][0] === "AUDIO_PROVIDER")) {
                        return "";
                    } else {
                        return cached_function.apply(this, arguments);
                    }
                };  

(Thomas Heiss) #71

@cooljingle
Quick re-test:

Exact same above error message in browser console happens for the Preview and Review for the “50 languages” PT BR course (many missing audio files): https://www.memrise.com/course/702398/50-languages-brazilian-portuguese-no-typing/

So maybe a quick click on “Preview” get’s you faster to re-test this error, wereas the 1st PT BR course by MartinPen usually has many uploaded audio mp3 files, so you might only run into the issue more seldomly for only a few words.


(Huntress) #72

Hello @cooljingle!

I was using Chrome since V0.1.18, but today was thinking about switching to firefox again and found out that the script still didn’t work in my firefox. Is it just me? The review session doesn’t start. I just get an empty screen and the word counter bar already full.

It doesn’t bother me at all as I can always use chrome, so I am just reporting.

This script is so great! Thank you so much for it!


(Thomas Heiss) #73

Hi Huntress,

what course are you testing the script with on Firefox?

V0.1.18 is broken for me too in Firefox: [Userscript] Memrise Audio Provider


(Huntress) #74

Hello @Thomas.Heiss,

I am using my personal private course, but I found another course where this happens to me. For example, this one: https://www.memrise.com/course/148854/english-grammar-4/. Neither learning nor review sessions start there for me. It’s just empty screen and a full progress bar.

I did a little experimenting and my observations so far are these. Courses that do not have prerecorded audio don’t start in my firefox at all. In the courses where there is prerecorded audio column the review and learning sessions at least start. I tested some public Memrise English courses with existing audio and the sessions work there. In “50 Languages - Brazilian Portuguese (No Typing)” the preview session started, but I couldn’t get past the first word, as the Next button didn’t work for me with the Memrise Audio Provider enabled. I disabled the script. The Next button had worked and I found out that the next word didn’t have prerecorded audio. So with script enabled it loaded the first word with existing audio and couldn’t go to the next word where audio was missing.

I have Firefox 52.6.0esr and greasemonkey 3.17.


(Cooljingle) #75

maybe try switching to Tampermonkey for your userscripts on firefox - I just tested the course you mentioned on firefox 58 with Tampermonkey and the script was working succesfully for me.


(Huntress) #76

Yes! Thank you very much! Switching to Tampermonkey has fixed it, now everything is working. You are my hero! :kissing_heart:


(Roman Deu Ler) #77

Hi @cooljingle!
I wonder if there’s a way to add the TTS audio regardless whether there are audios in the course or not?
The use case is the following.
A course has a lot of audios with poor recording quality. I can’t remove all of the audios, so trying to find a workaround with your script so I can hear generated sounds instead of the ones attached to the course.
Thanks in advance!


(Yanan1935) #78

Hey Cooljingle
I really love your scripts ( I use all multiple choice , Audio Provider and sometimes Autolearn)
The Problem is when I am using Audio Provider and than review Japanese words it freezes usually after 1 or 2 words. When I deactivate Audio Provider it is working fine.It’s also working fine when i review Spanish words - no freezes at all.
Thanks for your great scripts.I dont think i would use Memrise without them :slight_smile:


(Cooljingle) #79

I’ve updated the script with an option to do that (v0.1.19) - check out the audio provider options on the left to toggle it on.


(Cooljingle) #80

Do you use firefox? Could be to with the script having to rely on google tts for Japanese (chrome would use speech synthesis to generate Japanese which is more reliable).