Skip to content

Commit

Permalink
feat(gogoanime)+fix(streamwish): Add Mp4Upload as server on fetchEpis…
Browse files Browse the repository at this point in the history
…odeSources & fix encoding error (#592)

feat(gogoanime): Add Mp4Upload as server on fetchEpisodeSources
  • Loading branch information
hase0278 authored Oct 12, 2024
1 parent 2466f54 commit 853f1e8
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/extractors/streamwish.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extractors/streamwish.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dist/providers/anime/gogoanime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/anime/gogoanime.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/providers/anime/monoschinos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/extractors/streamwish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class StreamWish extends VideoExtractor {
headers: {
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'Accept-Encoding': 'gzip, deflate, zstd',
'Accept-Encoding': '*',
'Accept-Language': 'en-US,en;q=0.9',
'Cache-Control': 'max-age=0',
Priority: 'u=0, i',
Expand Down
15 changes: 14 additions & 1 deletion src/providers/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ProxyConfig,
} from '../../models';
import { USER_AGENT } from '../../utils';
import { GogoCDN, StreamSB, StreamWish } from '../../extractors';
import { GogoCDN, Mp4Upload, StreamSB, StreamWish } from '../../extractors';

class Gogoanime extends AnimeParser {
override readonly name = 'Gogoanime';
Expand Down Expand Up @@ -207,6 +207,14 @@ class Gogoanime extends AnimeParser {
sources: await new StreamSB(this.proxyConfig, this.adapter).extract(serverUrl),
download: downloadUrl ? downloadUrl : `https://${serverUrl.host}/download${serverUrl.search}`,
};
case StreamingServers.Mp4Upload:
return {
headers: {
Referer: serverUrl.origin,
},
sources: await new Mp4Upload(this.proxyConfig, this.adapter).extract(serverUrl),
download: downloadUrl ? downloadUrl : `https://${serverUrl.host}/download${serverUrl.search}`,
};
case StreamingServers.StreamWish:
return {
headers: {
Expand Down Expand Up @@ -250,6 +258,11 @@ class Gogoanime extends AnimeParser {
$('div.anime_video_body > div.anime_muti_link > ul > li.streamwish > a').attr('data-video')!
);
break;
case StreamingServers.Mp4Upload:
serverUrl = new URL(
$('div.anime_video_body > div.anime_muti_link > ul > li.mp4upload > a').attr('data-video')!
);
break;
default:
serverUrl = new URL(`${$('#load_anime > div > div > iframe').attr('src')}`);
break;
Expand Down

0 comments on commit 853f1e8

Please sign in to comment.