I am using exoplayer download service (https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/offline/DownloadService.html) for enabling clients to download the content. It might happen that due to fair usage policy expiry the client data is exhausted and the request is redirected to the ISP recharge page while the exo download was proceeding in the background.
In such a scenario what we have observed that the exoplayer receives a 301 response for the request and then makes request to the location header of the 301 response and saves the response received which can be of any mime type depending on the endpoint.
The download gets completed successfully but when the user tries to play the content, the playback will fail as we have a garbage junk which can't be parsed by the codec.
So far we have added a network interceptor to check the content-type of the final response and check if its a valid content type for the request url.
But I was wondering if there is an inbuilt solution for this in the exoplayer library itself, like any flag that we can enable to configure the exo download service to discard such download by itself?