crustymonkey / py-bgg

A simple Board Game Geek (boardgamegeek.com) API library in Python. This mainly just handles the API calls and converts the XML to representative dict/list format
GNU General Public License v2.0
31 stars 8 forks source link

Bug with APIv2? #2

Closed SylvainMartel closed 6 years ago

SylvainMartel commented 6 years ago

Hi,

While using libbgg.apiv2 and running this command bgg.boardgame(11040, stats=True, ratingcomments=False) I get this result(which is wrong since no data seems to be returned):

{'items': {'termsofuse': 'http://boardgamegeek.com/xmlapi/termsofuse'}}

Using libbgg.apiv1 , it works perfectly. Same with using the BGG XML APIv2 directly: https://www.boardgamegeek.com/xmlapi2/thing?id=11040

Bug in the library? Should I stick to APIv1 for the moment?

Result with v1(works fine): conn.get_game(11040 , stats=True)

{'boardgames': {'boardgame': {'boardgamecategory': [{'TEXT': 'Expansion for Base-game', 'objectid': '1042'}, {'TEXT': 'Wargame', 'objectid': '1019'}, {'TEXT': 'World War II', 'objectid': '1049'}], 'objectid': '11040', 'statistics': {'page': '1', 'ratings': {'owned': {'TEXT': '950'}, 'ranks': {'rank': [{'id': '1', 'value': 'Not Ranked', 'friendlyname': 'Board Game Rank', 'type': 'subtype', 'name': 'boardgame', 'bayesaverage': '5.97492'}, {'id': '4664', 'value': 'Not Ranked', 'friendlyname': 'War Game Rank', 'type': 'family', 'name': 'wargames', 'bayesaverage': '7.16277'}]}, 'averageweight': {'TEXT': '4.425'}, 'numcomments': {'TEXT': '125'}, 'wanting': {'TEXT': '50'}, 'stddev': {'TEXT': '1.39362'}, 'average': {'TEXT': '8.38222'}, 'median': {'TEXT': '0'}, 'wishing': {'TEXT': '106'}, 'trading': {'TEXT': '6'}, 'usersrated': {'TEXT': '225'}, 'numweights': {'TEXT': '40'}, 'bayesaverage': {'TEXT': '5.97492'}}}, 'boardgameversion': [{'TEXT': 'Edition with ASL Starter Kit-style Map Boards', 'objectid': '27795'}, {'TEXT': 'Edition with Hard-mounted (legacy-style) Map Boards', 'objectid': '27796'}, {'TEXT': 'Edition with NO mapboards included', 'objectid': '27792'}, {'TEXT': 'Ziplock edition', 'objectid': '211473'}], 'boardgamemechanic': [{'TEXT': 'Hex-and-Counter', 'objectid': '2026'}, {'TEXT': 'Modular Board', 'objectid': '2011'}, {'TEXT': 'Simulation', 'objectid': '2070'}], 'boardgameexpansion': [{'TEXT': 'ASL Action Pack #10', 'objectid': '163320'}, {'TEXT': 'Into The Rubble', 'objectid': '37867'}, {'TEXT': 'The Oblivion Pack', 'objectid': '39539'}, {'TEXT': 'The Shooting Lodge', 'objectid': '69778'}, {'TEXT': 'Total Axis Pack I: Eastern Front Firestorm', 'objectid': '32117'}, {'TEXT': 'Total Axis Pack II', 'objectid': '40378'}, {'TEXT': 'Advanced Squad Leader', 'inbound': 'true', 'objectid': '243'}], 'minplaytime': {'TEXT': '0'}, 'maxplaytime': {'TEXT': '0'}, 'description': {'TEXT': '(from MMP website :)

Armies of Oblivion is the long-awaited module adding the Axis Minors order of battle to the Advanced Squad Leader tactical game system.

Contents:

4 8"x22" geomorphic mapboards 48,49,50,51 ( STARTER KIT STYLE MAPBOARDS ; Mounted Map (old-style) Version OUT OF PRINT)
Overlays Hi8-Hi12, Rv1, Wd12, Wd34
6 Counter sheets
11 ASL Scenarios 111-121
Axis Minor Chapter H pages (H143-H172)
Errata pages A51-A62; D21-D26; S27-S34
2 SASL Axis Minor (Generation and Random Event) cards

Scenario List:

111 Balkan Sideshow, Szenttanas, Yugoslavia, 1941
112 Out of Cowardice, Senta, Yugoslavia, 1941
113 Liberating Bessarabia, Branzeni, Bessarabia, 1941
114 Cautious Crusaders, Lipovic, Ukraine 1941
115 Huns of Steel, Uriv, Russia, 1942
116 The Sixth Blow, Skopce, Poland, 1944
117 With Tigers On Their Tail, Saturnia, Galicia, 1944
118 Downsizing the Uprising, Vrutky, Slovakia, 1944
119 Ancient Feud, Cluj, Transylvania, 1944
120 Return to Sender, Nish, Serbia, 1944
121 End Station Budapest, Budapest, Hungary, 1945


(BGG original summarized description :)

Twelfth module for Advanced Squad Leader system, adding Minor Axis (Romanian, Bulgarian, Hungarian) infantry, vehicles, and ordnance.

'}, 'age': {'TEXT': '16'}, 'poll': [{'totalvotes': '2', 'results': [{'result': [{'value': 'Best', 'numvotes': '0'}, {'value': 'Recommended', 'numvotes': '1'}, {'value': 'Not Recommended', 'numvotes': '1'}], 'numplayers': '1'}, {'result': [{'value': 'Best', 'numvotes': '2'}, {'value': 'Recommended', 'numvotes': '0'}, {'value': 'Not Recommended', 'numvotes': '0'}], 'numplayers': '2'}, {'result': [{'value': 'Best', 'numvotes': '0'}, {'value': 'Recommended', 'numvotes': '0'}, {'value': 'Not Recommended', 'numvotes': '2'}], 'numplayers': '2+'}], 'name': 'suggested_numplayers', 'title': 'User Suggested Number of Players'}, {'totalvotes': '1', 'results': {'result': [{'value': 'No necessary in-game text', 'numvotes': '0', 'level': '1'}, {'value': 'Some necessary text - easily memorized or small crib sheet', 'numvotes': '1', 'level': '2'}, {'value': 'Moderate in-game text - needs crib sheet or paste ups', 'numvotes': '0', 'level': '3'}, {'value': 'Extensive use of text - massive conversion needed to be playable', 'numvotes': '0', 'level': '4'}, {'value': 'Unplayable in another language', 'numvotes': '0', 'level': '5'}]}, 'name': 'language_dependence', 'title': 'Language Dependence'}, {'totalvotes': '1', 'results': {'result': [{'value': '2', 'numvotes': '1'}, {'value': '3', 'numvotes': '0'}, {'value': '4', 'numvotes': '0'}, {'value': '5', 'numvotes': '0'}, {'value': '6', 'numvotes': '0'}, {'value': '8', 'numvotes': '0'}, {'value': '10', 'numvotes': '0'}, {'value': '12', 'numvotes': '0'}, {'value': '14', 'numvotes': '0'}, {'value': '16', 'numvotes': '0'}, {'value': '18', 'numvotes': '0'}, {'value': '21 and up', 'numvotes': '0'}]}, 'name': 'suggested_playerage', 'title': 'User Suggested Player Age'}], 'boardgamepublisher': {'TEXT': 'Multi-Man Publishing', 'objectid': '196'}, 'thumbnail': {'TEXT': 'https://cf.geekdo-images.com/images/pic117341_t.jpg'}, 'yearpublished': {'TEXT': '2006'}, 'boardgamesubdomain': {'TEXT': 'Wargames', 'objectid': '4664'}, 'boardgameartist': {'TEXT': 'David Pentland', 'objectid': '28351'}, 'boardgamefamily': {'TEXT': 'Advanced Squad Leader', 'objectid': '62'}, 'maxplayers': {'TEXT': '2'}, 'image': {'TEXT': 'https://cf.geekdo-images.com/images/pic117341.jpg'}, 'boardgamedesigner': [{'TEXT': 'Paul Kenny', 'objectid': '11448'}, {'TEXT': 'Brian Martuzas', 'objectid': '27683'}, {'TEXT': 'Pete Shelling', 'objectid': '19905'}], 'minplayers': {'TEXT': '2'}, 'boardgameaccessory': {'TEXT': 'Advanced Squad Leader: ASL Map Bundle', 'objectid': '183950'}, 'playingtime': {'TEXT': '0'}, 'name': {'sortindex': '1', 'primary': 'true', 'TEXT': 'Armies of Oblivion: ASL Module 12'}}, 'termsofuse': 'http://boardgamegeek.com/xmlapi/termsofuse'}}

Thanks!

SylvainMartel commented 6 years ago

no matter, I just found out the bug is in the BGG XML API2 itself.

This query works, and it should not since it's a boardgameexpansion https://www.boardgamegeek.com/xmlapi2/search?query=Armies%20of%20Oblivion&type=boardgame