Coverage for direct gfycat links that redirect to redgifs. The redirect through the sites themselves are broken but this fixes that.
Coverage for o.imgur links and incorrect capitalisation of domains in download_factory.
Changed tests for direct as gfycat is handled by the gfycat downloader.
fix pornhub test as the previous video was removed.
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.
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.
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.
The rstrip function was used wrongly, it doesn't remove a substring but
rather removes any of the characters provided, so here it removed any I,
G, V, or F that finished the six character ID for Imgur, resulting in a
404 error for the resources in question.