Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion lib/api.js → index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
scrapeWatchAnime,
scrapeThread,
DownloadReferer,
} from './anime_parser.js';
} from './lib/anime_parser.js';

const port = process.env.PORT || 3000;

Expand Down
10 changes: 5 additions & 5 deletions lib/anime_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { extractStreamSB } from './helpers/extractors/streamsb.js';
import { extractFembed } from './helpers/extractors/fembed.js';
import { USER_AGENT, renameKey } from './utils.js';

const BASE_URL = 'https://gogoanime.tel/';
const BASE_URL2 = 'https://gogoanime.gg/';
const BASE_URL = 'https://anitaku.pe/';
const BASE_URL2 = 'https://anitaku.pe/';
const ajax_url = 'https://ajax.gogo-load.com/';
const anime_info_url = 'https://gogoanime.film/category/';
const anime_movies_path = '/anime-movies.html';
Expand Down Expand Up @@ -426,7 +426,7 @@ export const scrapeAnimeDetails = async ({ id }) => {
let genres = [];
let epList = [];

const animePageTest = await axios.get(`https://gogoanime.tel/category/${id}`);
const animePageTest = await axios.get(`${BASE_URL}/category/${id}`);

const $ = cheerio.load(animePageTest.data);

Expand Down Expand Up @@ -544,7 +544,7 @@ export const scrapeWatchAnime = async ({ id }) => {
let genres = [];
let epList = [];

const WatchAnime = await axios.get(`https://gogoanime.tel/${id}`);
const WatchAnime = await axios.get(`${BASE_URL}/${id}`);

const $ = cheerio.load(WatchAnime.data);

Expand Down Expand Up @@ -774,4 +774,4 @@ export const scrapeAnimeAZPage = async ({ aph, page = 1 }) => {
console.log(err);
return { error: err };
}
};
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"type": "module",
"types": "lib/types/index.d.ts",
"scripts": {
"start": "node lib/api.js",
"dev": "nodemon lib/api.js",
"start": "node index.js",
"dev": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
Expand Down
15 changes: 15 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
]
}