Dear anyone,
Your duolingo forum registration isn't automaticaly transferred to duome forum so in order to join duome forums you need to register with your existing or any other username and email; in any case it's advised that you choose a new password for the forum.
~ Duome Team

How to - Restore duolingo tree (web version) using Fiddler (it still works)

Tips and tricks ...


User avatar
Carrotspy
Japan

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Carrotspy »

Fiddler is still working, but creating a new account is broken again for me. Wish I had actually made one last night instead of waiting until I had time to test out old APKs. Guess I'll just wait again until it starts working again.

Creating a simple "load this url" button wouldn't work, no. You'd need a kind of button like the working ones on Fiddler that loads the data without actually leaving the page. Don't know how those work though, so I don't know if it's possible in a userscript and how hard it would be if it were. The best I could do with trying to alter such a button once in an Old Twitter userscript was preventing the default event and making the page go to the url I wanted, which wouldn't work on Duolingo.

I tested out the "Duolingo Skill strength viewer" userscript, and it doesn't work with Fiddler. But while testing I noticed that the Words tab, which did work yesterday, is not working for me today.

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

Carrotspy wrote: Fri Nov 24, 2023 11:52 am

I tested out the "Duolingo Skill strength viewer" userscript, and it doesn't work with Fiddler. But while testing I noticed that the Words tab, which did work yesterday, is not working for me today.

The "Duo Strength" browser plugin is still working, use this instead.

User avatar
Carrotspy
Japan

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Carrotspy »

kyleyu wrote: Sat Nov 25, 2023 12:07 pm

The "Duo Strength" browser plugin is still working, use this instead.

Thank you very much, what a great addon. Won't know how well the strength information works until I've used it for a while, but just the Words buttons on each skill alone makes it worth the install.

In other news, the Words tab is working again for me (with or without that addon).

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

I found another way to restore the tree!
I just found out that an userscript can also replace the HTML, so I wrote one to replace www.duolingo.com/learn with the archive from 31 Dec. 2022.
You can try it if your source language is English. It's also usable on mobile devices!

Apart from /learn, it also matches a few other URL (/stories, /words, /skill, /checkpoint), so these URLs will also be usable. (If you are using Fiddler, you can create rules for these URLs as well, just let it response with the same archive as /learn)

User avatar
Carrotspy
Japan

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Carrotspy »

Great work, @kyleyu!
It seems to work more consistently than Fiddler does for me, hasn't failed to load anthing once. It also seems a bit faster, which makes sense since I noticed a slight decrease in internet speed whenever Fiddler is open.
I also noticed that direct links to lessons, practices, and checkpoints also work with this script. Doesn't seem to work with /test urls though, just redirects to duolingo.com/learn. It must be the right URL though, because putting anything other than "test" after "duolingo.com/skill/ja/Geography-1/" for example redirects to "duolingo.com/skill/ja/Geography-1/1" instead.

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

Carrotspy wrote: Mon Nov 27, 2023 1:17 pm

Doesn't seem to work with /test urls though, just redirects to duolingo.com/learn. It must be the right URL though, because putting anything other than "test" after "duolingo.com/skill/ja/Geography-1/" for example redirects to "duolingo.com/skill/ja/Geography-1/1" instead.

This is also the result I've got before with Fiddler (I also created Fiddler rules for skill URLs). It seems that the testouts are really gone, not just the buttons.

User avatar
Carrotspy
Japan

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Carrotspy »

My semi-working (progress is stuck) Android install can still load the tests, so the data is at least somewhere on the servers. Writing code to retrieve that data and mimick the behaviour of checkpoint tests might be possible, but even then you still need to get the servers to agree on adding a crown.

User avatar
PtolemysXX
Uganda

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by PtolemysXX »

kyleyu wrote: Mon Nov 27, 2023 11:05 am

I found another way to restore the tree!

I join in thanking you for this trick. I just managed to install the script on Firefox Nightly on my mobile. With this set-up I was able to complete a skill row in my course that I could no longer complete on the app. Things are looking good, I can continue learning the old way.

One remark: after installing and activating the script I could not log in to Duolingo, it would not recognize my credentials. I worked around it by deactivating the script, logging in to the untampered url (this worked), closing the window, activating the script and returning to Duolingo. This put me into the tree. Perhaps this happened due to my account being fairly new (created February 2022)

Last edited by PtolemysXX on Thu Nov 30, 2023 8:45 pm, edited 1 time in total.
User avatar
Thomas.Heiss
Germany

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Thomas.Heiss »

kyleyu wrote: Mon Nov 27, 2023 11:05 am

I wrote one to replace www.duolingo.com/learn with the archive from 31 Dec. 2022[/url].
... an userscript can also replace the HTML, so [url=https://gist.githubusercontent.com/5E-3 ... %20Tree.js]

Hmm, this URL does not follow the usual public user repositories where you can view the source, where it can auto-update the scripts (with the special update header tags).
On Firefox Nightly desktop, where my Tampermonkey addon is installed, for example I'm having the issue that this linked URL does NOT open as the RAW format; only plain text.
I only see the script text (like when you view the source code from a .JS file on a public user respository).

Those repositories with that special RAW button (right above from the source code) where the Tampermonkey addon shall instantly recognize it that it is a userscript and asks you if you want to install that .JS file and will also show you the code at the bottom.
I do NOT see any popup window. Is this a FF Nightly or Tampermonkey 4.19.0 issue? Yes, it is activated.

Looks like the 5E-324 user respository name is not public?!
What is the normal respository URl so I can try to access the RAW button directly?
Do you guys maybe have the same issue like me wanting to install that userscript from the above link?

In the past I had a similar issue with other userscripts, but in that case a different Url needed to be used or the userscript needed to be modified and headers added.
I'm not a Tampermonkey / userscript expert...but maybe we can take a look at Camilo's "Tree Enhancer" userscript and a few others to find out what it is missing and why this install procedure was offered by them?

:de: Native | :us: Upper-B2 (BritishCouncil) | ImageL25 (Duo) / A2 (6+y, McGraw-Hill) - Learning (Busuu): :fr: (A1 McGraw-Hill) | :brazil: (interm.)

User avatar
Thomas.Heiss
Germany

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Thomas.Heiss »

kyleyu wrote: Mon Nov 27, 2023 11:05 am

I found another way to restore the tree!
I just found out that an userscript can also replace the HTML....
You can try it if your source language is English.

I have not yet up skilled my limited knowledge about the Html and Fiddler / proxy / injector stuff and how an old Duolingo web archive exactly looks like.
There always is other important stuff is crossing my way...didn't have the nerves to deeper jump into it, sadly to say.

I'm curious what would be the individual steps to create another Tampermonkey userscript for the Portuguese or German base/source language?

I know, for PT or DE base I would have to find and download a different Duolingo web archive from 2022 or older.

What exactly does the script content variable contain?
Where is all the old Javascript / third library stuff?
Is it ALL included in a Duolingo download archive file?

Like the old website code which still allowed FULL typing in the English (or Portuguese base) language and not forcing the tapping of word banks.

Does Fiddler or your Tampermonkey userscript (content variable) only rely on the very basic (archived) html website and does it download all the other JS stuff from their server side (which might get removed at one time like they were removing all direct /skill and /challenge urls)?
I'm talking about the heavy JS stuff which another user had manually patched here on this thread in two JS files with the Requestly addon (which does not seem to work with FF Nightly@Pc) to bring back typing.

Is it hard to do it for myself when I find a working Duolingo website archive for PT or DE (for my other DE->FR volunteer course), preferably from 2018, correct base language so Fiddler would work?
What exact html content needs to be pasted into the Tampermonkey script variable?

I'm not sure if this can easily be answered with Yes/No or..."Not sure, is a bit more complicated than it first looks like" or
"Probably not possible for a DAU" (dümmster anzunehmender User) or if someone does not find the nerves to really jump into all technical aspects more deeply ;)

But thanks for your engagement to help make us use their good old tree design, which I greatly would prefer; especially for my existing EN<-PT reverse tree which I had already started in 2019 and which got a few CEFR updates (which also reset some L0 skill progress here and there) by that time. It's quite long now.

Sounds that I want it too, and not only from English!

Definitely is some fun to be able to work again on the higher L4-L5 crown levels in my EN->PT forward tree and to directly see the more difficult content for selected - already completed - grammar and verb tense skills whereas the path only starts from L0 crown level with a lot of tapping:-)

PtolemysXX wrote: Thu Nov 30, 2023 1:41 pm

I just managed to install the script on Firefox Nightly on my mobile.

The Tampermonkey addon is great as it works on Firefox Nightly@Android (debug mode, custom collection_id support for addons repository), Kiwi and Yandex Alpha browsers.

Still have not found a suitable new laptop with additional basic Rc heli Gpu support...

Last edited by Thomas.Heiss on Fri Dec 01, 2023 9:13 pm, edited 1 time in total.

:de: Native | :us: Upper-B2 (BritishCouncil) | ImageL25 (Duo) / A2 (6+y, McGraw-Hill) - Learning (Busuu): :fr: (A1 McGraw-Hill) | :brazil: (interm.)

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

Thomas.Heiss wrote: Thu Nov 30, 2023 7:33 pm

Hmm, this URL does not follow the usual public user repositories where you can view the source, where it can auto-update the scripts (with the special update header tags).
On Firefox Nightly desktop, where my Tampermonkey addon is installed, for example I'm having the issue that this linked URL does NOT open as the RAW format; only plain text.
I only see the script text (like when you view the source code from a .JS file on a public user respository).
...
What is the normal respository URl so I can try to access the RAW button directly?

It's a gist (link) (instead of a repository) and the URL in the earlier post is what the raw button links to. I'm not sure why Tampermonkey didn't recognize it. A workaround is to create a new script (in the Tampermonkey menu) and copy&paste the content there.

Thomas.Heiss wrote: Thu Nov 30, 2023 7:39 pm

What exactly does the script content variable contain?

It's the content of the archived HTML (not including dependencies), converted to a js string.

Thomas.Heiss wrote: Thu Nov 30, 2023 7:39 pm

Does Fiddler or your Tampermonkey userscript (content variable) only rely on the very basic (archived) html website and does it download all the other JS stuff from their server side (which might get removed at one time like they were removing all direct /skill and /challenge urls)?

Both method use archives of www.duolingo.com/learn, which doesn't include js and other dependencies, but we can let the Wayback Machine to save them (I did this for most dependencies I found, but there are likely some omissions), so they won't be lost after being removed.

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

The script is updated. Now it works for most (if not all) source languages on Duolingo, not just English!
See: Userscript to restore Duolingo tree.

User avatar
Gentianopsis
Czech Republic

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Gentianopsis »

I still use Fiddler, because I have no idea how to use the userscripts (I do not understand IT at all). In Duolingo, I can still start new Skills and do new lessons in them for all the levels, but I cannot do "Practice" in L6 Skills anymore, regardless the language and the archive used. The page returns back to ".../learn" or becomes empty. Is this only my problem? Is there any way to make the Practice lessons in the Tree functional again?

User avatar
Thomas.Heiss
Germany

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by Thomas.Heiss »

Gentianopsis wrote: Sat Dec 09, 2023 8:46 pm

I still use Fiddler, because I have no idea how to use the userscripts (I do not understand IT at all)

You only need to install the Tampermonkey userscript browser extension (Chrome) or addon (Firefox).
Normally the RAW button will directly trigger the Tampermonkey addon to ask if you want to install the .JS code (this is the case with github code repositories).

For some odd reason the given userscript link (it is from a different source code repository provider) does NOT automatically trigger that Tampermonkey popup screen and Install button.
Both ways (direct Url link, or showing the source code and then clicking on the RAW code from the repository provider) only show the .JS file as a source code / text in the browser.
Which means in the meantime you manually have to open the Tampermonkey extension/addon in the browser, open the dashboard and to click on the "+" link which launches the "Create new userscript" dialoge.

Then you simply have to delete the template header and body code from the new empty userscript (16 lines will be created and shown by default).
Go back to the browser tab where you have the userscript (full code) opened:
Select/Copy (Ctrl + A and then Ctrl + C) all the linked userscript code (full red // head with @tags with following body) and paste (Ctrl + V) it into that "Create new userscript" editor window within the Tampermonkey dialogue.

Then in the Tampermonkey editor you go to the "File" top menu and click on Save.

..(...)..

As expained in my previous comment normally it is not that complicated.

Maybe there is a way to make the RAW button (and direct Url link) to trigger the Tampermonkey addon and have it ask us in the future if we want to install the .JS userscript code (by itself).
Once this works the @update header tags will make that Tampermonkey will auto update all userscripts which have been modified on the code repository and will auto-download and auto-update the old code; it shows the new version in the header too.

When everything is working right (I have no specific experience with that chosen current respository) it is quite easy.
If the RAW button fails to recognize the .JS code and it only displays all the code as a simple plain text in the browser window, well, this is when the trouble starts.
I'm not sure why it is happening....other userscripts sporadically failed to be fully compatible with the RAW button, even on the other code repositories. After some changes it suddenly was working, I'm not exactly sure what changes.

But as said: With Tampermonkey you can make it working on the Firefox Nightly, Kiwi and Yandex Alpha browsers on an Android smartphone (I did it with FF Nightly). Which probably is not possible to accomplish with a full Fiddler install.

We will let you know if we find something new out or a more experienced userscript developer gives feedback why the RAW button doesn't work at the moment as expected.

:de: Native | :us: Upper-B2 (BritishCouncil) | ImageL25 (Duo) / A2 (6+y, McGraw-Hill) - Learning (Busuu): :fr: (A1 McGraw-Hill) | :brazil: (interm.)

kyleyu

Re: How to - Restore duolingo tree (web version) using Fiddler (it still works)

Post by kyleyu »

A quick fix for the problem with practice: go to FiddlerScript tab, find the function OnBeforeRequest, copy & paste the following code somewhere in the function, then save the script. For userscript users: stay tuned, an update is coming soon!

Code: Select all

if (oSession.url === "www.duolingo.com/2017-06-30/sessions") {
    var requestBody = oSession.GetRequestBodyAsString();
    var requestJson = Fiddler.WebFormats.JSON.JsonDecode(requestBody);
    
    if (requestJson.JSONObject["type"] === "SKILL_PRACTICE") {
        var skillIds : System.Collections.ArrayList = new System.Collections.ArrayList();
        skillIds.Add(requestJson.JSONObject["skillId"])
        requestJson.JSONObject["skillIds"] = skillIds;
        
        delete requestJson.JSONObject["skillId"];
        requestJson.JSONObject["levelIndex"] = 2;
        requestJson.JSONObject["type"] = "LEXEME_SKILL_LEVEL_PRACTICE";
    }
    requestBody = Fiddler.WebFormats.JSON.JsonEncode(requestJson.JSONObject);
    oSession.utilSetRequestBody(requestBody);
}

Where to paste the code:

Code: Select all

(Find this function)
static function OnBeforeRequest(oSession: Session) {
	<<< Paste the above code here

	(Existing contents of the function)
	
	<<< ... Or here
}

(Do NOT paste the code inside an existing if statement!)
static function OnBeforeRequest(oSession: Session) {
	if (...) {
		(Do NOT past the code here!)
	}
}

How it works: it converts practice requests of the tree to practice requests of the path.

Post Reply

Return to “How to ...”