Skip to content

Commit

Permalink
Fix downloader after scryfall update
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed Aug 1, 2024
1 parent 67745b5 commit 1e8a5fc
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 108 deletions.
12 changes: 11 additions & 1 deletion gallery/BuildGallery.linq
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,17 @@ record CardData(

static readonly string CardsDirectory = Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath)!, "..", "cards");

HttpClient Client = new();
HttpClient Client = new()
{
// required by scryfall: https://scryfall.com/docs/api
DefaultRequestHeaders =
{
Accept = { new("application/json") },
UserAgent = { new("UniversesWithinCollection", "1.0") }
},
// helps with slow bulk downloads
Timeout = TimeSpan.FromMinutes(10),
};

static string DisambiguatedName(Card card) => $"{card.Name} ({card.Set.ToUpperInvariant()} {card.Collector_Number})";

Expand Down
Loading

0 comments on commit 1e8a5fc

Please sign in to comment.