This PR fixes that; there's a couple janitorial commits at the top of the PR, but the meat of it is that:
It adds raise_if_redirected to the HTTP API; if set, the get API will raise a Redirected exception if the URL of the response isn't the same as the requested URL.
It makes the AreenaPlaylist extractor (which is the default when one accesses an /1-xxxxxx style URL) pass that argument, so if the request for a playlist leads us to a new URL, we don't try to blindly use the wrong extractor class
It makes the CLI layer follow such redirects, automatically retrying the process with a new URL.
Areena returns a redirect for certain playlists as discussed in https://github.com/aajanki/yle-dl/issues/261#issuecomment-1057761470 but yle-dl doesn't realize that it has been redirected and attempts to use the wrong extractor class.
This PR fixes that; there's a couple janitorial commits at the top of the PR, but the meat of it is that:
raise_if_redirected
to the HTTP API; if set, theget
API will raise aRedirected
exception if the URL of the response isn't the same as the requested URL./1-xxxxxx
style URL) pass that argument, so if the request for a playlist leads us to a new URL, we don't try to blindly use the wrong extractor classFixes #261