diff --git a/package.json b/package.json index a369d5d..3284d48 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@paperback/toolchain": "^0.8.7", "@paperback/types": "^0.8.7", "cheerio": "^1.0.0", - "html-entities": "^2.5.2" + "html-entities": "^2.5.2", + "js-base64": "^3.7.7" } } diff --git a/src/MangaDex/MangaDex.ts b/src/MangaDex/MangaDex.ts index adfc9a8..1d0b4a7 100644 --- a/src/MangaDex/MangaDex.ts +++ b/src/MangaDex/MangaDex.ts @@ -64,7 +64,7 @@ export const MangaDexInfo: SourceInfo = { description: 'Extension that pulls manga from MangaDex', icon: 'icon.png', name: 'MangaDex', - version: '3.0.5', + version: '3.0.6', authorWebsite: 'https://github.com/nar1n', websiteBaseURL: MANGADEX_DOMAIN, contentRating: ContentRating.EVERYONE, diff --git a/src/MangaDex/MangaDexSettings.ts b/src/MangaDex/MangaDexSettings.ts index d0060ff..246da24 100644 --- a/src/MangaDex/MangaDexSettings.ts +++ b/src/MangaDex/MangaDexSettings.ts @@ -7,7 +7,7 @@ import { MDRatings, MDImageQuality } from './MangaDexHelper' - +import { Base64 } from 'js-base64' export async function getLanguages(stateManager: SourceStateManager) { return (await stateManager.retrieve('languages') ?? MDLanguages.getDefault()) @@ -152,7 +152,7 @@ export async function parseAccessToken(accessToken: string | undefined) { const tokenBodyBase64 = accessToken.split('.')[1] if (!tokenBodyBase64) return undefined - const tokenBodyJSON = Buffer.from(tokenBodyBase64, 'base64').toString('ascii') + const tokenBodyJSON = Base64.decode(tokenBodyBase64) return JSON.parse(tokenBodyJSON) }