Skip to content

feat: AniList auth token, character portrait thumbnail & token support - #90

Merged
Nachtalb merged 4 commits into
masterfrom
fix/animetrace-url
Feb 27, 2026
Merged

feat: AniList auth token, character portrait thumbnail & token support#90
Nachtalb merged 4 commits into
masterfrom
fix/animetrace-url

Conversation

@Nachtalb

Copy link
Copy Markdown
Owner

Follow-up to #88.

Changes:

  • Use AniList character portrait as thumbnail fallback (instead of anime cover art)
  • Add optional ANILIST_TOKEN env var — passes Authorization: Bearer on all AniList GraphQL calls for higher rate limits
  • Applied to both the AnimeTrace engine (_anilist_post) and the AniList data provider (AnilistProvider.request)
  • Falls back to anonymous if token not set

- Add image { large } to AniList character query
- Return char_image_url as 5th element of _anilist_resolve tuple
- Prefer character portrait over anime cover art as thumbnail fallback
- Add ANILIST_TOKEN optional env var to settings
- Pass Authorization: Bearer header in _anilist_post (animetrace engine)
- Pass Authorization: Bearer header in AnilistProvider.request (data provider)
- Token is optional; falls back to anonymous if not set


def _anilist_headers() -> dict:
from reverse_image_search_bot import settings

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module level import

}
""".strip()

from reverse_image_search_bot import settings

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module level import

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check if didn't miss anything with the previous settings.py example. Also if we go full env. Write theat in the readme and remove the old example settings file.

- Move settings imports to module level in animetrace.py and anilist.py
- Support both local and SSH uploaders via env vars (UPLOADER_HOST/USER/PASSWORD/UPLOAD_DIR/KEY_FILENAME)
- Remove settings.example.py (replaced by env vars)
- Update README with full env var reference table
@Nachtalb
Nachtalb merged commit afe801b into master Feb 27, 2026
4 checks passed
@Nachtalb
Nachtalb deleted the fix/animetrace-url branch February 27, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant