rhgrant10 / berserk

Python client for the lichess API
https://berserk.readthedocs.io
Other
141 stars 36 forks source link

Games exported via `export_by_player` have no opening info #4

Closed Kraymer closed 5 years ago

Kraymer commented 5 years ago

Description

consider that code that performs two exports on same game :

    for game in LICHESS.games.export_by_player(user, max=1):
        print(game)
        print(LICHESS.games.export(game['id']))

in the second print we have the info 'opening': {'eco': 'D30', 'name': "Queen's Gambit Declined", 'ply': 4}, , not available in the other.

Is that expected that information returned by export using id is more complete than the export_by_player ?

rhgrant10 commented 5 years ago

Yeah it's currently expected. The primary reason is simply because that's what the underlying http api returns for those endpoints.

It's probable that the developers of lichess are intentionally limiting the fields returned when games of a user are requested because only a few use cases require the extra information and including it for all requests would place too much load ($) on the servers. I recommend reaching out to them in their discord chat and ask in there :-)

Kraymer commented 5 years ago

Thanks for the guidance, I'll go on discord then !