@@ -111,6 +111,15 @@ def get_content(target, params=None):
111111 return response .content
112112
113113
114+ def get_optional_calendar (getter , url , columns , * args , ** kwargs ):
115+ # non-essential source: log and continue if it is unreachable
116+ try :
117+ return getter (url , columns , * args , ** kwargs )
118+ except requests .exceptions .RequestException as e :
119+ warnings .warn (f'Skipping unavailable source { url } : { e } ' )
120+ return pd .DataFrame ([], columns = columns )
121+
122+
114123def get_variant (title , variants ):
115124 assert ALL_VARIANTS .intersection (variants )
116125 words = set (title .lower ().split ())
@@ -440,7 +449,7 @@ def normalize_tournament_name(name):
440449 calendars .extend ([
441450 get_ics_calendar (DXB_URL , current .columns , ('xiangqi' ,)),
442451 get_ics_calendar (FFS_URL , current .columns , ('shogi' ,)),
443- get_ics_calendar ( SNK_URL , current .columns , ('shogi' ,)),
452+ get_optional_calendar ( get_ics_calendar , SNK_URL , current .columns , ('shogi' ,)),
444453 get_shogibond_calendar (SHOGIBOND_URL , current .columns ),
445454 get_shogideutschland_calendar (SHOGI_DEUTSCHLAND_URL , current .columns ),
446455 get_fesa_calendar (FESA_URL , current .columns ),
0 commit comments