Skip to content

Commit

Permalink
bug fix - #175 #172 #170 (#177)
Browse files Browse the repository at this point in the history
* 🐛 copy

* 🔖 v0.7.6

* 🐛 disable happy plugin
  • Loading branch information
youniaogu authored Jan 12, 2025
1 parent 5bc2965 commit 9193ffd
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 27 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ android {
applicationId "com.youniaogu.mangareader"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 49
versionName "0.7.5"
versionCode 50
versionName "0.7.6"
}
signingConfigs {
debug {
Expand Down
8 changes: 4 additions & 4 deletions ios/MangaReader.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 50;
DEVELOPMENT_TEAM = VAL2KK2S94;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = MangaReader/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.5;
MARKETING_VERSION = 0.7.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -533,15 +533,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 50;
DEVELOPMENT_TEAM = VAL2KK2S94;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = MangaReader/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.5;
MARKETING_VERSION = 0.7.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: f91d538f197fa71a7d5b77ec2069d49550c0eb96
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mangareader",
"version": "0.7.5",
"publishTime": "2024-06-10",
"version": "0.7.6",
"publishTime": "2025-01-12",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down
40 changes: 24 additions & 16 deletions src/plugins/copy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Base, { Plugin, Options } from './base';
import { MangaStatus, ErrorMessage } from '~/utils';
import { AESDecrypt } from '~/utils';
import * as cheerio from 'cheerio';

interface BaseResponse<T> {
code: number;
Expand Down Expand Up @@ -44,14 +43,30 @@ interface MangaInfoResponse
last_chapter: { uuid: string; name: string };
};
}> {}
interface ChapterListReponse extends BaseResponse<string> {}
interface ChapterListResponse extends BaseResponse<string> {}
interface ChapterListInfo {
build: {
path_word: string;
type: { id: number; name: string }[];
};
groups: Record<'default' | string, { chapters: { id: string; name: string }[] }>;
}
interface ChapterInfoResponse
extends BaseResponse<{
comic: { name: string; path_word: string };
chapter: {
uuid: string;
count: number;
size: number;
name: string;
comic_id: string;
comic_path_word: string;
group_id: null;
group_path_word: string;
datetime_created: string;
contents: { url: string }[];
};
}> {}

const discoveryOptions = [
{
Expand Down Expand Up @@ -142,8 +157,6 @@ const discoveryOptions = [
},
];

const PATTERN_HEADER = /(.+)\/(.+)/;

class CopyManga extends Base {
readonly fetchHeaders = {
...this.defaultHeaders,
Expand Down Expand Up @@ -229,7 +242,8 @@ class CopyManga extends Base {
};
prepareChapterFetch: Base['prepareChapterFetch'] = (mangaId, chapterId) => {
return {
url: `https://www.mangacopy.com/comic/${mangaId}/chapter/${chapterId}`,
url: `https://api.mangacopy.com/api/v3/comic/${mangaId}/chapter/${chapterId}`,
body: { platform: 3 },
headers: new Headers({
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
Expand Down Expand Up @@ -314,7 +328,7 @@ class CopyManga extends Base {
}
};

handleChapterList: Base['handleChapterList'] = (res: ChapterListReponse) => {
handleChapterList: Base['handleChapterList'] = (res: ChapterListResponse) => {
if (res.code === 200) {
const data: ChapterListInfo = JSON.parse(AESDecrypt(res.results || ''));
const { build, groups } = data;
Expand Down Expand Up @@ -344,26 +358,20 @@ class CopyManga extends Base {
};

handleChapter: Base['handleChapter'] = (
text: string | null,
res: ChapterInfoResponse,
mangaId: string,
chapterId: string
) => {
const $ = cheerio.load(text || '');
const contentkey = $('div.imageData').first().attr('contentkey') || '';
const images = JSON.parse(AESDecrypt(contentkey));
const [, name = '', title = ''] =
($('h4.header').first().text() || '').match(PATTERN_HEADER) || [];

return {
canLoadMore: false,
chapter: {
hash: Base.combineHash(this.id, mangaId, chapterId),
mangaId,
chapterId,
name,
title,
name: res.results.comic.name,
title: res.results.chapter.name,
headers: this.imageHeaders,
images: images.map((item: { url: string }) => ({
images: res.results.chapter.contents.map((item: { url: string }) => ({
uri: item.url.replace(/\.c[0-9]+x\./, '.c1500x.'),
})),
},
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/happy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,13 @@ class HappyManga extends Base {
? 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36'
: 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1';
super({
score: 5,
disabled: true,
score: 0,
id: Plugin.HAPPY,
name: '嗨皮漫画',
shortName: 'HAPPY',
description: '需要代理,图片有 CF 校验',
description: '已失效',
// description: '需要代理,图片有 CF 校验',
href: 'https://m.happymh.com/',
userAgent,
defaultHeaders: { 'User-Agent': userAgent, Referer: 'https://m.happymh.com/', Cookie: '' },
Expand Down

0 comments on commit 9193ffd

Please sign in to comment.