Use Token for SchedulesDirect Images and Image Index #8609
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have not worked on the server in a long time. Please provide guidance on how I can improve this solution.
Changes
As per the API changes on October 1st (and possibly earlier), SchedulesDirect requires the token to be used to get the available image artwork index, and for image requests. This is part of an effort by them to curb abuse of the program artwork from their data provider.
References:
https://www.schedulesdirect.org/news/056/SD-JSON-images-now-require-tokens
Issues
Likely fixes #7528, may be related to #8502.
Followup
As per the changes to the API page, the token can either be provided as a header, or as a query parameter. I didn't know how to add it as a header for the image downloads themselves, so I added it as a query.