Skip to content

Commit

Permalink
Merge pull request #22 from ci7lus/fix/gyazo-blob-fetch-error
Browse files Browse the repository at this point in the history
🚑 [gyazo] アップロードができていなかったのを修正
  • Loading branch information
ci7lus authored May 15, 2023
2 parents cd2e8e1 + e6c316e commit 58a4560
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/miraktest-gyazo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const meta = {
id: _id,
name: "Gyazo",
author: "ci7lus",
version: "0.1.4",
version: "0.1.5",
description: "スクリーンショットをGyazoにアップロードするプラグインです。",
authorUrl: "https://github.com/ci7lus",
url: "https://github.com/ci7lus/miraktest-plugins/tree/master/src/miraktest-gyazo",
Expand Down Expand Up @@ -95,9 +95,7 @@ const main: InitPlugin = {
return
}
;(async () => {
const bin = await axios.get<ArrayBuffer>(url, {
responseType: "arraybuffer",
})
const bin = await fetch(url)
const form = new FormData()
form.append("access_token", token)
const title = playingContent?.program?.name
Expand All @@ -108,7 +106,7 @@ const main: InitPlugin = {
if (desc) {
form.append("title", desc)
}
const blob = new Blob([bin.data], { type: "image/png" })
const blob = await bin.blob()
form.append("imagedata", blob, url.split("/").pop())
if (setting.collectionId) {
form.append("collection_id", setting.collectionId)
Expand Down

0 comments on commit 58a4560

Please sign in to comment.