KartikTalwar / Duolingo

Unofficial Duolingo API Written in Python
MIT License
825 stars 128 forks source link

get_learned_skills does not work for Romanian #89

Open Otto-AA opened 4 years ago

Otto-AA commented 4 years ago

Trying to execute lingo.get_learned_skills('ro') raises a Loop exception for me.

The problem seems to be, that it has two skills with the name "Properties" and one of them depends (?) on the other. So essentially it is executing this code:

    skills = [{"name":"Properties","dependencies_name":[]},{"name":"Properties","dependencies_name":["Properties"]}]
    duolingo.Duolingo._compute_dependency_order_func(skills)

Here are the relevant attributes from the server response:

[
    {
        "id": "8773494720f14d7aa644c87598cd57ce",
        "name": "Properties",
        "dependencies": [
            "Prepositions 1 (for Acc.Case)",
            "Demonstrative Pronouns and Pronominal Adjectives"
        ],
        "dependencies_name": [
            "Prepositions",
            "Demonstrative Pronouns and Pronominal Adjectives"
        ]
    },
    {
        "id": "1bca2b5b9e06e1df387f97966764e1d2",
        "name": "Properties",
        "dependencies": [
            "Units of Measurement",
            "Dative Pronouns",
            "Objects"
        ],
        "dependencies_name": [
            "Properties",
            "Genitive-Dative Pronouns",
            "Objects"
        ]
    }
]

It looks like the error is that dependencies uses "Units of Measurement" while dependencies_name uses "Properties". So I'm not sure if it is a bug of this library or by Duolingo.