Consolidates sane flake8 settings to pyproject with the Flake8-pyproject plugin.
Does not change logic of test workflow but allows base settings to live in pyproject for anyone using flake8 as an external linter (e.g. vscode)
Also fixes some flake8 errors that were not being picked up by current testing, mostly unused imports.
Coverage for direct links.
The direct link won't work because it will have the wrong auth anyway but this will at least end up with the right API call.
Attempt to fix#724
Narrows down characters available to extensions in the regex. Outside of 3 and 4, the only extensions that I can think of this doesn't hit are bz2 and 7z (which wasn't caught before).
Standardizes shebang and coding declarations.
Coding matches what's used by install tools such as pip(x).
Removes a few init files that were not needed.
Add check to verify token was received.
Update headers sent to content API.
Add availability check for videos to resolve last part of #472 where only SD version is available.
Cover edge cases that shouldn't ever happen but probably will sometime.
Also included Imgur changes to cover similar situations of malformed/redirected links.
API seems to return incorrect signature value when sending header. Other fixes seems to have worked temporarily but have stopped working so they're removed.
Erroneous .gifv extensions such as .giff or .gift resolve to a static image and are downloaded by the direct downloader. (ex: https://i.imgur.com/OGeVuAe.giff )
Some imgur URLS have the extension ".gifv" and show up as a gif,
even though they're actually supposed to be mp4 videos. Imgur
serves all videos/gifs as both .gif and .mp4. The image dict has
a key "prefer_video" to distinguish the two. This commit
overrides the .gif extension if "prefer_video" is true to ensure
we download the submission as originally intended.