Skip to content

Commit 16057c3

Browse files
Small corrections
1 parent a25ef6d commit 16057c3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/board_game_scraper/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import logging
2+
3+
logging.getLogger("numba").setLevel(logging.INFO)
4+
logging.getLogger("PIL").setLevel(logging.INFO)

src/board_game_scraper/spiders/bgg.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
class BggSpider(SitemapSpider):
5050
name = "bgg"
51-
allowed_domains = ("boardgamegeek.com",)
51+
allowed_domains = ("boardgamegeek.com", "geekdo-images.com")
5252

5353
# https://boardgamegeek.com/wiki/page/BGG_XML_API2
5454
bgg_xml_api_url = "https://boardgamegeek.com/xmlapi2"
@@ -352,7 +352,7 @@ def parse_games(
352352
bgg_ids=bgg_ids,
353353
page=page + 1,
354354
priority=-page - 1,
355-
max_page=max_page,
355+
meta={"max_page": max_page},
356356
)
357357

358358
for game in response.xpath("/items/item"):
@@ -663,8 +663,13 @@ def parse_poll(
663663
if not poll or parse_int_from_elem(poll, "@totalvotes") < self.min_votes:
664664
return default
665665

666+
votes = tuple(parse_votes(poll, attr, enum=enum))
667+
668+
if not votes:
669+
return default
670+
666671
try:
667-
return func(parse_votes(poll, attr, enum=enum))
672+
return func(votes)
668673
except Exception:
669674
self.logger.exception("Error parsing poll <%s>", name)
670675

0 commit comments

Comments
 (0)