Fix attribution download for .jpg
This commit is contained in:
parent
68e63f8e39
commit
3afbb8b6fe
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ export default class ImgurAttribution {
|
||||||
* Download the attribution from a given URL
|
* Download the attribution from a given URL
|
||||||
*/
|
*/
|
||||||
public static async DownloadAttribution(url: string): Promise<{license: string, author: string}> {
|
public static async DownloadAttribution(url: string): Promise<{license: string, author: string}> {
|
||||||
const hash = url.substr("https://i.imgur.com/".length).split(".jpg")[0]
|
const hash = url.substr("https://i.imgur.com/".length).split(/.jpe?g/i)[0]
|
||||||
|
|
||||||
const apiUrl = "https://api.imgur.com/3/image/" + hash
|
const apiUrl = "https://api.imgur.com/3/image/" + hash
|
||||||
const response = await Utils.DownloadJson(apiUrl, {
|
const response = await Utils.DownloadJson(apiUrl, {
|
||||||
|
|
Loading…
Reference in a new issue