appsettings.json — Added PoolEnabled to each API section: - TumblrApi → true - TumblrApi3 → false - TumblrApi4 → true DataAccess.cs — Added: - ApiKeyConfig class — holds credentials + metadata per key - ApiKeyPool class — manages pool with round-robin rotation, SQLite-backed state (ApiKeyPoolState, ApiKeyPoolMeta tables) - GetCurrentKey() — returns next key, skipping rate-limited ones, falls back to earliest-recovery if all are throttled - MarkRateLimited(key, retryUntil) / MarkAvailable(key) — persists state - Initialize() — discovers pool-enabled keys, detects single-key override mode - Refactored APIAccess.GrabNotes(), GrabPostWithReplies(), GrabLikes() to accept ApiKeyConfig param and log [Key#N] Program.cs — Updated: - Tracks apiExplicitlySet flag from -api/-api3/-api4 - Initializes ApiKeyPool at startup (pool mode or single-key override) - All 3 API callers updated to use pool rotation + 429 handling Startup Output - Pool mode: [Pool] Active keys: Key#1=TumblrApi, Key#2=TumblrApi4 - Single-key: [Pool] Single-key mode: TumblrApi3
37 lines
1.8 KiB
JSON
37 lines
1.8 KiB
JSON
{
|
|
"appSettings": {
|
|
"PathInput": "u:\\jim\\Documents\\Web Copies\\blogs\\",
|
|
"PathOutput": "u:\\jim\\Documents\\Web Copies\\blogs\\GetNotes.txt",
|
|
"PathOutputJSON": "u:\\jim\\Documents\\Web Copies\\blogs\\GetNotesJSON.txt",
|
|
"PathOutputPosts": "u:\\jim\\Documents\\Web Copies\\blogs\\GetPosts.txt",
|
|
"PathOutputBlogs": "u:\\jim\\Documents\\Web Copies\\blogs\\GetBlogs.txt",
|
|
"PathOutputReplies": "u:\\jim\\Documents\\Web Copies\\blogs\\GetReplies.txt",
|
|
"PathOutputUrls": "u:\\jim\\Documents\\Web Copies\\blogs\\GetUrls.txt",
|
|
"PathDB": "..\\..\\..\\tl.db",
|
|
"ContainsList": "zombaee,zomb-eh,ahzombae,thebugandme,lovingbabybug,h4rdspot",
|
|
"PostIDToExclude": "730084470076686336,726309940037287936,639974102120235008,184045126218",
|
|
"EnableFileLogging": false,
|
|
"LogTraversalRecordImports": false
|
|
},
|
|
"TumblrApi": {
|
|
"ConsumerKey": "PtsBCGumcsgihyynxUh8b47Jfmi7uXhEIOU46bmhdsUSJ5mEP3",
|
|
"ConsumerSecret": "sA8BwNVTVKqBRRJmHbAD6NuyKPJ3bb9cei2bYhMgqT8cLX8tSG",
|
|
"OAuthToken": "HPJI6IijHoKN6WzBumG7KjS7g01iCu07jQsulpueKbWN1ZJ35J",
|
|
"OAuthTokenSecret": "ajkN0Z1kKrsJaIXZEDI8zLsjRSQxFkfgO1i5k78FuQYCQjSY7w",
|
|
"PoolEnabled": true
|
|
},
|
|
"TumblrApi3": {
|
|
"ConsumerKey": "Jmoh13AS9hKBYsf939uENQsiWUuZJLFT3do4YK9P0bpspVuxkH",
|
|
"ConsumerSecret": "8LcHjuqpOS9gZZPaML1joT330w5NqyGdreSqSBazdAWCADzcms",
|
|
"OAuthToken": "Gm2esFTeb5LKsb4A2YJGrF2Udycfc0AF8afof2qNGyzNSq1qWM",
|
|
"OAuthTokenSecret": "Kfokor80s5fVue91OmNHidCdILZ9AnHtRplrct2P6Q75jgNTLa",
|
|
"PoolEnabled": false
|
|
},
|
|
"TumblrApi4": {
|
|
"ConsumerKey": "gOuydIEENkRmEvvuf57R69yPRb39FC0Egb9p6ntxWuCuFzlsV3",
|
|
"ConsumerSecret": "0my913slXAHgra4mEEYV98stJ3wXGjPTWJeviiZXwJ2AqzYtIF ",
|
|
"OAuthToken": "JHk08YufSrsetTR1Ekuh10cPOzC6rjqU5WwVu3uV4vvLzp0w8w",
|
|
"OAuthTokenSecret": "1oryr4WMBxuDrt4vL4sJQs5qNagkH3KxwIf61M8SfvklTrhHSb",
|
|
"PoolEnabled": true
|
|
}
|
|
} |