URL encode all params

This commit is contained in:
James Hawkins 2022-11-05 09:14:00 +00:00
parent 56c50fbb2f
commit bb6e363829

View File

@ -17,7 +17,7 @@ export const flixhqProvider: MWMediaProvider = {
async getMediaFromPortable(media: MWPortableMedia): Promise<MWProviderMediaResult> {
const searchRes = await fetch(
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/info?id=${media.mediaId}`
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/info?id=${encodeURIComponent(media.mediaId)}`
).then((d) => d.json());
return {
@ -29,7 +29,7 @@ export const flixhqProvider: MWMediaProvider = {
async searchForMedia(query: MWQuery): Promise<MWProviderMediaResult[]> {
const searchRes = await fetch(
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/${query.searchQuery}`
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/${encodeURIComponent(query.searchQuery)}`
).then((d) => d.json());
const results: MWProviderMediaResult[] = (searchRes || []).results.map((item: any) => ({
@ -44,7 +44,7 @@ export const flixhqProvider: MWMediaProvider = {
async getStream(media: MWPortableMedia): Promise<MWMediaStream> {
const searchRes = await fetch(
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/info?id=${media.mediaId}`
`${CORS_PROXY_URL}https://api.consumet.org/movies/flixhq/info?id=${encodeURIComponent(media.mediaId)}`
).then((d) => d.json());
const params = new URLSearchParams({