Userscript: Tree Enhancer
UPDATE: Still working as 2019/08
User script for a better experience when using Duolingo, forked from the now defunct Reverse Tree Enhancer.
What does it do?
The following options are available:
- Keep per-tree settings for listening/speaking exercises.
- Make all the exercises listening exercises (hide the question). Text can be revealed hoovering the mouse over it.
- Read answers aloud.
- Hide clues (e.g pictures).
- Make Duo better for reverse trees.
Where does it work?
Desktop version: It has been tested with Firefox and Chrome.
Mobile version: It has been also tested on Android with Firefox+Violentmonkey.
Please let me know if it works with other setup.
Follow the instructions in github.
After installation, a new button will appear on top of your tree. Clicking on it will display a configuration dialog.
Most options are
allegedly self explanatory, and the top button will provide some configuration templates.
- Version 1.1.0 New keyboard shortcuts
- Version 1.0.32: Update to allow hiding new words.
This looks great! I may be missing it somehow, but could you give us the link to download the script you made? The link in the post takes me to the original script.
Now we finally have Japanese and Korean, and the userscript is not working again. Thankfully the design has not changed, so I'll update the script in two stages:
- An update today for Translate and Judge (select right translation) Challenges as they are the majority of challenges.
- An update for Name the Picture and other challenges as soon as I have time.
Excellent work! Thanks for this.
Include a brief description of the tree types. (What does "Laddering" do? What does "hide pics" hide?)
A little problem with the script reading the answer to the previous question while I'm answering the next one. Needs to be either cut off (when you ((Continue)), or an option to disable it.
Sorry if this counts as necroposting - I've installed this script from Github but it doesn't seem to be working. I've tried running it in both Greasemonkey and Violentmonkey (separately; I use firefox) and nothing changes on any duolingo page, even though vmonkey says it is active. I tried it a couple of times with no other addons on to make sure it wasn't interference from something else. I've even done a few exercises to see if the TTS changes (in case it is working in the background but just not presenting the configuration button mentioned in the OP) and... nothing. Is this a known issue? Is there a way to get the configuration button to come up?
Using Firefox 74.0 and the latest Greasemonkey and Violentmonkey versions
Addendum: I've just had a go with Chrome and tampermonkey... no luck :( I added the script by clicking the link in the readme on GitHub - is that a possible cause, or is it broken or? Sorry!
EDIT: It's working now! Or at least the configuration bit comes up. The TTS replacement seems to be busted, though - I've fiddled around with it a bit but I still only get the DL TTS. Shame, as that's the main reason I wanted to use the enhancer, but other than that brilliant!
do you have any double-loading problems on the "Home" (tree) page with activated ads and NULL (tree) exceptions error message in the browser console?
I have described my problem in more detail here: https://forum.duolingo.com/comment/29195158$comment_id=29196125
I definitely could see the initial loading log message twice!
Thankfully with "uBlock Origin" activated (with or without enabled rules) everything works fine.
As usual, the main problem is lack of time.
Firefox V52.9.0esr behaves weird in the console anyways, e.g:
"XML-Verarbeitungsfehler: Syntax-Fehler Adresse: https://excess.duolingo.com/batch Zeile Nr. 1, Spalte 1:"
I don't think it's worth to waste time here....maybe I will try on another (not mine) computer with Firefox Quantum.
Hi Camilo! I hope you'll read this. I love your script, but there is one problem: I can't find how to change languages.
I had been using it for my English for Russian speakers course before, but then I switched to working on Turkish for a few months. Now I want to go back to Russian, but your script only offers me Turkish, which leads to the strange experience of hearing a Turkish TTS reading the Russian texts to me (which is completely unintelligible of course).
Switching the script off and on again didn't work, neither did reinstalling the script, restarting the browser or restarting the computer.
thanks so much for the quick update and rollout.
You are a champ!
With the newest version 1.2.0 I have problems with the Ctrl + Shift + H hotkey to unhide sentences and multiple-choice answer options.
This was not the case with the previous versions; always worked great.
Ctrl + Shift + K hotkey still works to replay the TTS audio in the target (or source) language.
PS: How can I / we at least send you an online coupon for a cup (or several) of coffee if you do not take Paypal donations or things like Patreon.com?
Best regards from Germany
Sorry to bother you Thomas - do you know if it is possible to use this script to replace DuoLingo's own TTS for the target language? I thought it was supposed to, and in the configuration I have it set to read the target language sentences via TTS, but that only functions when reading the answers for a question. I was hoping it would replace the DL TTS when reading the questions out. Is that not possible?
No, there is no override option in the Tree Enhancer settings.
I'm not sure of there is an option to disable the auto play-back of Duolingo Tts.
I really wish there was for my two reverse trees (for German and English audio).
I can remember that one time two audios were played together at the same time (Duolingo + userscript) overlapping each other which was a bug after staff had changed their webcode.
In many courses users complain about missing audio like Hewbrew so it would be great if Camilo could add something like this.
And maybe to further add:
- 1) override / replace Duolingo audio with another Tts provider from script
- 2) disable one side of Duolingo audio (target for reverse trees) as the "disable listening" settings works on Duolingo very differently now
- 3) extend Duolingo audio with Tts from script if target internal Tts is completely missing
Let me know if I forgot anything.
As I said, I have no clue how powerful/open the audio web code is to change it or override default behavior.
Any news with the Duolingo audio override option (stop auto-play but replace with other Tts provider)?
For some courses like English, German or Spanish staff has started to change the TTS audio recordings to match the cartoon characters.
There are many complaints in the Spanish forum about the new kid voice especially.
And the English letarge voice by the pink girl quickly goes onto ones nerves too.
Maybe you can add new settings which Dl audio to deactivate (without or with Tts replacement)?
Is this even possible for each character so we do not have to use GoogleTts for EVERY sentence but stream some mp3/mp4a from Dl servers where audio still is normal/good and really wanted?
For reverse trees:
I'm not that much happy about the changed audio behavior from "listening exercices" Duolingo setting that it now forces German or English audio auto-play on me for my three PT courses.
I had a similar issue. The settings menu comes up for me now (you might need to update the script if it hasn't automatically) but still no TTS :( That's the main reason I got it - I hope its something that's easy on them to fix!
Edit: I just tried an exercise and the TTS reads the source language but doesn't replace the target language Duolingo TTS... whuh
I mainly want it to replace the DL TTS - can it not do this at all? I thought that was a big point.
Camilo has rolled out a new version 1.2.0 of his userscript on the github repository to update the auto-generated CSS classes from the last Duolingo website update.
Text/sentence hiding now also works with the newly introduced cartoon character css/div classes. Great!
In this thread we are talking right now about the uBlock Origin addon, Kiwi, Yandex and Firefox (including Nightly) browsers for Android as well as the Iceweasel fork from Mozilla Fenix which gives you access to a lot more addons (like Kiwi, Yandex).
I also added a comment about extensions and userscripts like Tampermonkey/Violentmonkey or Stylus:
With a trick I finally got Tampermonkey and Violentmonkey addons running on FF Nightly.
This means I am using now your great userscript on mobile (Android Oreo 8.1) on the web (compact mobile web view, not the desktop site).
With this my full PT audio is back. Great!
I hope I can get Kiwi usb remote debugged at a later time because it does not work that great anymore with the Duo website (no matter if extensions are disabled or not) and grading freezes so many times or I do see errors in the Mini JS console.
For more details see my comment in the bigger linked thread.
Maybe Kiwi runs more reliable for you guys on Pie 9 or Android 10 than it does for me on Oreo 8.1??
Before staff changed again their web code ~2 weeks ago it was working great for a few days.
Thankfully Firefox Nighly works great again.
great, I found you script thread again. Hurra!
Thanks for offering your hard work to us.
What I am looking for:
- reverse tree (e.g EN-DE):
- turn off L2 target German select the right word from box question
- auto change settings to speaker OFF (let not Duo prompt for L2 German "type what you hear" questions (as native German speaker, you do not want L2 German target questions)
- all the rest from the old reverse tree enhancer script (specifically TTS for EVERY question, no matter if multiple-choice, choose-the-right-word, translations where some have no sound on DuoLingo.
- forward tree (e.g EN-PT):
- TTS read answer for EVERY question, no matter if multiple-choice, choose-the-right-word, translations where some have no sound on DuoLingo, after you have successfully entered the answer (after check, before continue)
ALWAYS play the audio for L2 target Portuguese (DuoLingo only plays audio when the PT sentence is on the left side, not when the L2 PT sentence/word is entered on the right side)
use the speaker settings with default ON (auto-play left side sentences, either PT or EN/DE)
What really sucks with the normal script is, that I have to manually adjust the audio settings ON/OFF when I am doing 3-4 courses (OFF for reverse tree).
- setting per course if I want to hide the left side sentence and/or multiple-choice answers, like in reverse tree enhancer:
For reverse courses like PT-EN/DE, which I may do in parallel, I do not want to hide the left side L1 Portuguese sentence. For laddering courses Spanish-Portuguese, Portuguese-Spanish, etc. I also do NOT want to hide any given text (too difficult for me to listen at this stage).
I will try it out, thanks again!
- You can't disable listening questions per-language. No script can do that, sorry.
- If you are doing the reverse tree (EN-DE) it won't read aloud questions in English, but will read all translations and multiple selection questions in English.
- It is not easy to use TTS for the answers in multiple selection. I have tried to make it work with no good results so far.
- "Select the right word"-questions don't have a way to read them.
- You can decide what text to hide in the configuration box, as you can see from the picture. It has also some pre-sets that will help you to configure it for the type of three you are studying (reverse, enhanced-forward or laddering).
Thanks for your script code updates to be working for the new DuoLingo (2017) portal code, announced by DuoLingo team about migration/rollout threads earlier.
My user account got migrated some days ago.
It is soo sad to loose all the old DuoLingo portal + 12 user script functionality all at the same time :-(
I successfully tested your script in my EN->PT forward tree course and playing Portuguese audio from answers on right hand side EN-PT questions.
I will gladly take a look at my PT->DE and PT->EN reverse tree courses and test your script for the reverse functionality on the new DuoLingo portal.
Thanks for your hard work Camilo!
I definitely could NOT live without your very great script!!!
Good to know it is working! This is the current status:
- Sentence translation is working; it can read text and hide the challenges according to configuration.
- Multiple selection is working. It can also read the right answers (that's new).
- "Name the picture" could be working.
- Other challenges are not working.
The biggest problem I have now is that challenges involving pictures only appear in the very early stages of the tree, and just now I all my trees either completed or quite advanced. So I simply have no way to test what do they look like in the new site.
Please let me know if something is not working as expected.
I am somehow concentrating on my forward EN-PT tree for the past weeks.
Reverse trees PT to EN/DE are still in the very beginning of the skills and I do not do them in parallel anymore at the moment (and I probably won't in the near future with the loss of the "DuoLingo course switcher" user script).
So I may be in fact able to test a little bit your script updates...
Quote Camilo: Sentence translation is working; it can read text and hide the challenges according to configuration.
Multiple selection is working. It can also read the right answers (that's new).
Other challenges are not working.
I noticed that : -)
THAT is good news. Much appreciated!
Quote Camilo: "It is not easy to use TTS for the answers in multiple selection. I have tried to make it work with no good results so far."
You are my hero :-)
I believe I am remembering that it was working for the original reverse tree script) per my above request, so yeah, really good news for me:
" What I am looking for:
- TTS read answer for EVERY question, no matter if multiple-choice, choose-the-right-word
- ALWAYS play the audio for L2 target Portuguese (DuoLingo only plays audio when the PT sentence is on the left side, not when the L2 PT sentence/word is entered on the right side)."
As described far above, right hand answers in PT already works with YOUR script for the forward tree settings.
This was NOT working with the original reverse tree script before (of course).
The "choose the right word" challenges very often do use quite short sentences.
I guess I have no need at the moment to find a workaround to play Portuguese answer audio for those challenges.
(Longer) L1 (source)-L2 (target) (e.g EN-PT) sentence translations and multiple-choice (again quite often longer sentences) are much more important to us.
I am excited about this, but it doesn't seem to be working for me. Actually, none of my scripts running through Tampermonkey are working with the site anymore... does anyone know if there's any way to fix this? I was working on my English from Spanish reverse tree, but now that doesn't work. So it's really slowed my progress and tamped down my motivation.
I assume this could be a result of something like the new site, but I don't know for sure. It's just that this script isn't giving me the button. And the old script's button is gone. The easy accent script isn't working either...
Hopefully this can get figured out so I can try this script!
I am using Camilo's script successfully with Firefox V50.1.0 and the Greasemonkey plugin.
Are you using the Chrome browser because you installed Tampermonkey?
Have you even enabled his script? (just a question in case that your system might have got it wrong after installing it) :-) :-)
Are you using his latest version?
You can manually install the latest version going to the github.com repository and clicking on the raw link.
Sometimes you have to manually click on "check for updates" with those plugins, as the auto updates fails (or is not triggered).
One more adding request for you (maybe you have already thought about it or checked if this workaround is possible somehow):
Turn off multiple-choice questions for forward courses and/or (better) turn those into "full typing" excercises.
As you know, "multiple-choice" is ONLY about remembering and guessing, but not RECALLING.
Cooljingle's "all typing" user script on Memrise helped me to get into L2 Portuguese typing on the web when I have to do reviews.
Multiple-choice and "learning-mode" either with L1 or L2 translations for a new/unfinished lesson is okay for me.
This would be a great enhancement, even we still would have to type too much in our L1 native (source/base) language.
But it is much more difficult to translate all the L2 words (e.g Portuguese) AND correct grammar if you can NOT simply select from a list of 3-4 options where most of the time you can eliminate 1-2 wrong options and guess the right answer from the rest of 1-2 answers.
This can not be effective in learning a new language from scratch.
I want to do my own (typing) errors - and of course learn from those done errors (checking discussions, seeing one the suggested solution, etc.)!
I tested your user script for EN-CZ (right hand side answers) for the new Czech beta course. Works.
Many guys seem to have problems with audio (left hand CZ side - standard default DuoLingo Czech audio) not playing on Apple devices and Safari browser: https://www.duolingo.com/comment/24322144
Do you know of any workaround that you might be able to help those learners for the new BETA Czech course?
I would think to test your user script and enable audio auto-play (including the blue button or Ctrl + Space) even on left side Czech L2 translation questions (Google TTS, Yandex) when e.g the speaker is turned OFF in the settings (or ON, does not matter).
Could your script and your default (3) TTS settings get audio working for left side Czech questions even that default DuoLingo and TTS libraries are not able to do so on Safari?
If you have any idea please reply in the above linked Czech-audio thread 24322144.
With best regards
would you mind explaining to us what your "Other options: Check spelling" feature exactly does? Is it still working for the new Scala 2017 portal?
Can you show me a screenshot?
I have it activated...but I do NOT use accent typing with Portuguese for myself (no interest to switch keyboards back and forth, no interest to use DuoLingo's mouse keyboard for special characters).
I just get the green warning from DuoLingo in the answer, when I have left off accents - and I am not sure if this might be one cause why my skills decay faster?!
Is there any chance for you to further improve your very great script for features like we have on Memrise with user scripts like "Memrise auto correct", "Memrise Turbo"?
I do not want to have to type Portuguese accents (e.g ção, éàô, etc.) but I still want to view the corrected letter and auto-completed accent marks before I hit submit.
I rather want to view the auto-added accents in my own answer, NOT in the DuoLingo solution below the page.
The spell checking option just activate the buidl-in spell checker in your browser. It is not different to right-clicking on the input box and enabling spell checking. You have to install the language for your browser, otherwise it is not going to do anything.
Autocorrect is not something you get from the browser, so I can't really use it in the script.
Thanks Camilo for your explanation on "spell checking".
No, "Autocorrect" has nothing to do with the browser by itself.
The user script "DuoLingo easy accents" e.g was able to directly modify the typed text in the text box when you hit a hotkey to create the diacritics.
But I believe Memrise in contrast may provide the accessible solution data with the question prompt, which Cooljingle could be verifying the typed letters / typed sentence against, where probably DuoLingo is just evaluation the whole answer after pressing the submit button (alternative answers)??? Actually, I have no idea how his script really works at the end! :-) :-)
Have a look, here is his Memrise script: https://github.com/cooljingle/memrise-autocorrect/blob/master/Memrise_Autocorrect.user.js
Hopefully you have nevertheless an idea :-)
Good luck Camilo!
is there any workaround to double support Vietnamese audio by 3rd-party TTS providers (left hand translation side) if no audio was added (missing) or auto-played by Duo for L2->L1 sentence translations?
Vietnamese not-complete audio support: https://www.duolingo.com/comment/25147880
Does google TTS support Vietnamese? I have tried with Esperanto, and it adds sound to the sentences without it, so I see no reason why it would'nt work with Vietnamese. On the other hand, google's voice for Esperanto is really bad, and I'm afraid is the same for many smaller languages.
Yes! I got it working. I had to enable spell checking for English (US) and Swedish separately in my browser's settings. I tried typing answers without the script but somehow answers were not spell checked in Swedish. On the other hand if I tried typing Swedish and English outside Duolingo then they were both spell checked. I would really just want spell checking enabled only in Duolingo.
In addition I had this other problem:
When I get my answer correctly, this blue circle appears. I don't want that to appear.
Hi, I just found your script and love it, but can I make a request?
I need to play the audio several times to understand what it's said but every time I hover over the audio button, the text shows up. Is it possible to make the text only shows up when you hover over the text and not the audio button? Thank you so much.
(Firefox) hardware hotkeys:
Ctrl + Space: Repeat the left side translation audio
Ctrl + Shift + Space: Replay slower audio (turtle button)
Ctrl + Alt + K:
Replay the right hand side target audio (from Camilo's script)
but every time I hover over the audio button, the text shows up. Is it possible to make the text only shows up when you hover over the text and not the audio button?
Try this for html / css layout frontend changes on the DuoLingo web portal: https://forum.duolingo.com/comment/24634938/Lessons-Userstyle-to-get-some-things-of-the-old-look-back
You need to install the Stylus (not Stylish!!!) addon for your browser, to make those CSS changes work: https://forum.duolingo.com/comment/24634938$comment_id=27870938
New Bug 11/05/2018 (any recent Duolingo website update in the past 1-2 days?)
Normal Portuguese audio (left hand side) stopped playing for my EN->PT tree
Q: Is it worth retrying with Violentmonkey?
Speaker OFF, Sound effects ON (for my other PT->DE and EN->DE reverse trees, so I do not touch it for EN->PT as well)
Enhanced tree configuration:
Read text in Portuguese: activated
Read text in English: disabled
Listening exercises: activated
List of TTS: Google yandex baidu / yandex google baidu (both options not working)
Firefox: V52.9.0esr (no option to switch to Quantum or Google Chrome)
- Tampermonkey: V4.8.5847 from 09/14/2018
PT->EN translations in my forward EN->PT tree
The read Portuguese sentence (from the console log in orange) from Portuguse->English text translations is not auto played anymore.
Has there maybe been any Duolingo website update in the last 1-2 days?
It was shortly working before and there was no Tampermonkey update!
If you have speaker ON, Duolingo usually auto-plays these sentences by itself.
But I have your user script do the job for me to read and play Portuguese audio, because my speaker is turned OFF and I have ZERO interests to change this for each course back and forth.
Always worked like a charm!
[DuolingoTreeEnhancer] Saying 'Ficarei feliz se você ficar. ' userscript.html:1116:5
[DuolingoTreeEnhancer] Saying 'Depois que o filme começar, não pararemos!.
I do not hear any audio after the log phrase "Saying".
Do you use the internal Duolingo speaker button?
When I hit the hotkey Ctrl + Space this works, but the auto-play is annoyingly turned off (because of my setting).
If this functionality is now broken, is there hopefully any fallback for me to use the 2nd yandex or Baidu TTS service to play the Portuguese sentence?
Maybe playing everything with Google TTS is just a little bit too much...
EN->PT translations in my forward EN->PT tree
Still works for the "reverse way".
Your script does the job.
[DuolingoTreeEnhancer] Saying 'Uma consciência limpa é o melhor travesseiro. ' userscript.html:1116:5
"[DuolingoTreeEnhancer] Playing URL http://translate.google.com/translate_tts?ie=UTF-8&tl=pt&total=1&textlen=46&tk=485074|83024&q=Uma%20consci%C3%AAncia%20limpa%20%C3%A9%20o%20melhor%20travesseiro.%20&client=tw-ob" userscript.html:937:5
[DuolingoTreeEnhancer] Saying 'Qual é a sua altura?. ' userscript.html:1116:5
"[DuolingoTreeEnhancer] Playing URL http://translate.google.com/translate_tts?ie=UTF-8&tl=pt&total=1&textlen=22&tk=517486|884725&q=Qual%20%C3%A9%20a%20sua%20altura%3F.%20&client=tw-ob"
What would be the easiest steps to track this down as a start and not wasting too much time, especially spoken about your very valuable developer time.
Camilo, you probably don't use the same settings as me, do you?
In another comment you had to tell me that there is no way to auto-activate the speaker ON setting per course (e.g EN->PT on, PT->DE off).
Viele Grüße aus Deutschland
First time I reconfigured the settings and placed yandex before Google for the EN->PT course.
Firefox V52.9.0esr console message:
HTTP-Laden ist mit dem Status 400 fehlgeschlagen.
Laden der Medienressource http://tts.voicetech.yandex.net/tts?text=Ele%20disse%20que%20isso%20n%C3%A3o%20traria%20solu%C3%A7%C3%A3o%20para%20o%20problema.%20&lang=pt_PT&format=mp3&quality=hi fehlgeschlagen. WebRequest.jsm:342:4
Alle Kandidaten für die Ressource konnten nicht geladen werden. Medien-Laden pausiert.
Sentence: "Ele disse que isso não traria solução para o problema."
Is anybody using Camilo's "Duolingo Next Lesson" Tampermonkey user script?
Finally I have added a new (longer) comment highlighting some facts about
- to filter skills by strength (there was a user style to filter golden skills)
- rename skill names (adding prefixes, e.g on our www.duome.eu/USERNAME/progress page)
- a (crowns) level-up lesson strategy concept to focus on more difficult grammar (e.g Subjunctives) / Verb tense skills
in Camilo's "Duolingo Next Lesson" thread: https://forum.duolingo.com/comment/26849592$comment_id=29666271
as well as "[HOWTO]: Different ways for spaced repetition with skill strength viewer (user script and extension)" thread: https://forum.duolingo.com/comment/29304553$comment_id=29666130
I would like to invite advanced users and user script or user style programming gods to join and discuss questions and ideas on a brainstorming level.
Best regards / Viele Grüße
This might depend on the course.
Duolingo staff had done so many web changes in the last 6 to 12 month (and before) that almost nothing worked with Camilo's userscript anymore.
He put really a lot of his time into fixing once again all the code (re-engineering) in incremental steps.
With so many changes on a regular basis I'm surprised how every time Camilo manages to rewrite his code and get it working over and over again.
So far, for Portuguese it works quite good at the moment (until the next big web change by staff).
However, I can remember that "fill the words onto the blank" challenges were not always working (to play the sound) in the last 2 to 3 years.
In 1 of 3 courses...for one course it sometimes was working ocassionally.
I seem to mainly now get multiple-choice or translations (full typing) on the web....maybe I see those again on new L0 lessons a check once again?!?
PS: Your profile is set to private so I can't see anything!
If you run into any unknown issues for a specific language let us know.
Unfortunately, I am not quite sure how to assist with website JS debugging and to find specific (new) div classes which might be missing (there are so many nested elements).
I was kinda lost when I tried to inspect into the running website code or to take a look at the written code from Camilo.
This is quite some complex stuff and the required rewrites definitely have not made it any easier either :)
You definitely should try it as most functionality from the userscript should be back.
Let us know how it goes and for what languages you see anything which could be further enhanced.
Bug on Yandex Alpha
There is some issue with your userscript not wanting to play the audio only for multiple-choice answers on Yandex Alpha browser on Android (Oreo 8.1).
Rest of translations do give me audio.
FYI: I had to use Violentmonkey on Yandex Alpha because Tampermonkey did not want to install.
Normally for Firefox (Nightly) or Kiwi it makes no difference and both work great with almost all challenges.