by using the name from the input URL and not relying on possibly faulty
or incomplete API results.
'userData[username]', if available, will still have the original name.
Redgifs expects all IDs and names to be lowercase
and throws a 404 if an ID contains an uppercase letter.
Gfycat on the other hand doesn't care about case,
so it's fine to just convert all IDs.
(#1138)
The metadata for Redgifs search results got stripped down to a bare
minimum, including download URLs. (Clicking on search results on the
website itself is broken as well)
As a workaround, we make an extra call to '/v1/gfycats/<ID>'
for each search result entry to fetch the missing data.
'/?&#' -> '/?#' and '?&#' -> '?#'
According to https://www.ietf.org/rfc/rfc3986.txt, URLs are
"organized hierarchically" by using "the slash ("/"), question
mark ("?"), and number sign ("#") characters to delimit components"
Possible values:
- one of "mp4" (default), "webm", "gif", "webp", "mjpg"
If the selected format is not available, "mp4", "webm" and "gif"
(in that order) will be tried instead, until an available format
is found.