Skip to content

Commit 2444737

Browse files
committed
feat: mobi;
1 parent 980e5ce commit 2444737

File tree

29 files changed

+226
-65
lines changed

29 files changed

+226
-65
lines changed

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"jszip": "^3.10.1",
3030
"ngx-highlightjs": "^12.0.0",
3131
"pdfjs-dist": "^4.6.82",
32+
"readiverse": "^0.1.0",
3233
"rxjs": "~7.8.0",
3334
"tslib": "^2.3.0",
3435
"zone.js": "~0.14.10"

src/app/@site-modules/blankary/data-access/blankary.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ import { inject, Injectable } from '@angular/core';
33
import { map, Observable } from 'rxjs';
44
import { CompositionEpisode } from '../../@common-read';
55
import { environment } from '../../../../environments/environment';
6-
import { Base64 } from '../../../shared/utils';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
77

88
@Injectable({
99
providedIn: 'root'
1010
})
1111
export class BlankaryService {
1212
http: HttpClient = inject(HttpClient)
13+
proxy: ProxyService = inject(ProxyService)
1314

1415
getComposition(id: string): Observable<CompositionEpisode> {
15-
return this.http.get<any>(environment.blankaryoHost + id)
16+
return this.http.get<any>(this.proxy.proxyUrl(environment.blankaryoHost + id))
1617
.pipe(map((data) => { return this.map(data) }))
1718
}
1819

1920
map(data: any): CompositionEpisode {
20-
2121
const mappedResponse = {
2222
title: data.title,
2323

2424
images: JSON.parse(data.images).map((img: string) => {
2525
return {
26-
src: environment.proxy + Base64.toBase64(`https://blankary.com/image/${img}`)
26+
src: this.proxy.proxyUrl(`https://blankary.com/image/${img}`)
2727
};
2828
})
2929

src/app/@site-modules/comick/data-access/comick.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import { inject, Injectable } from '@angular/core';
33
import { Observable, map } from 'rxjs';
44
import { environment } from '../../../../environments/environment';
55
import { CompositionEpisode } from '../../@common-read';
6-
import { Base64 } from '../../../shared/utils';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
77

88
@Injectable({
99
providedIn: 'root'
1010
})
1111
export class ComickService {
1212
http: HttpClient = inject(HttpClient)
13+
proxy: ProxyService = inject(ProxyService)
1314

1415
getComposition(id: string): Observable<CompositionEpisode> {
15-
// environment.proxy + Base64.toBase64
16+
// this.proxy.proxyUrl()
1617
return this.http.get<any>((environment.comickHost + id))
1718
.pipe(map((data) => { return this.map(data) }))
1819
}
@@ -31,7 +32,7 @@ export class ComickService {
3132
})).filter((i: any) => i.src)
3233
// .map((img: any) => {
3334
// return {
34-
// src: environment.proxy + Base64.toBase64(`${img.src}`)
35+
// src: this.proxy.proxyUrl(`${img.src}`)
3536
// }
3637
// })
3738

src/app/@site-modules/mangadex/data-access/mangadex.service.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { HttpClient } from '@angular/common/http';
2-
import { Injectable } from '@angular/core';
2+
import { inject, Injectable } from '@angular/core';
33
import { environment } from '../../../../environments/environment';
44
import { Observable, catchError, map, throwError } from 'rxjs';
55
import { CompositionEpisode, CompositionImage } from '../../@common-read';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
67

78
interface MdChapterImages {
89
hash: string;
@@ -62,15 +63,15 @@ interface MdMangaResp {
6263
providedIn: 'root'
6364
})
6465
export class MangadexService {
65-
66-
constructor(private http: HttpClient) { }
66+
http: HttpClient = inject(HttpClient)
67+
proxy: ProxyService = inject(ProxyService)
6768

6869
getChapterImages(id: string): Observable<CompositionImage[]> {
69-
return this.http.get<MdChapterImagesResp>(environment.mangadexHost + id)
70+
return this.http.get<MdChapterImagesResp>(this.proxy.proxyUrl(environment.mangadexHost + id))
7071
.pipe(
7172
map((data: MdChapterImagesResp) => data.chapter.dataSaver.map((item: string) => {
7273
return {
73-
src: `${environment.proxy}${data.baseUrl}/data-saver/${data.chapter.hash}/${item}`
74+
src: this.proxy.proxyUrl(`${data.baseUrl}/data-saver/${data.chapter.hash}/${item}`)
7475
// src: `${data.baseUrl}/data/${data.chapter.hash}/${item}`
7576
}
7677
})
@@ -80,7 +81,7 @@ export class MangadexService {
8081
}
8182

8283
getChapter(id: string): Observable<CompositionEpisode> {
83-
return this.http.get<MdChapterResp>(environment.mangadexChapter + id)
84+
return this.http.get<MdChapterResp>(this.proxy.proxyUrl(environment.mangadexChapter + id))
8485
.pipe(
8586
map((data: MdChapterResp) => {
8687
return {
@@ -98,7 +99,7 @@ export class MangadexService {
9899

99100

100101
getManga(id: string): Observable<{ nsfw: boolean }> {
101-
return this.http.get<MdMangaResp>(environment.mangadexManga + id).pipe(this.nsfwMap())
102+
return this.http.get<MdMangaResp>(this.proxy.proxyUrl(environment.mangadexManga + id)).pipe(this.nsfwMap())
102103
}
103104

104105
nsfwMap() {

src/app/@site-modules/nhentai/data-access/nhentai.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import { inject, Injectable } from '@angular/core';
33
import { Observable, map } from 'rxjs';
44
import { environment } from '../../../../environments/environment';
55
import { CompositionEpisode } from '../../@common-read';
6-
import { Base64 } from '../../../shared/utils';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
77

88
@Injectable({
99
providedIn: 'root'
1010
})
1111
export class NhentaiService {
1212
http: HttpClient = inject(HttpClient)
13+
proxy: ProxyService = inject(ProxyService)
1314

1415
getComposition(id: string): Observable<CompositionEpisode> {
15-
return this.http.get<any>(environment.proxy + Base64.toBase64(environment.nhentaiHost + id))
16+
return this.http.get<any>(this.proxy.proxyUrl(environment.nhentaiHost + id))
1617
.pipe(map((data) => { return this.map(data) }))
1718
}
1819

@@ -31,7 +32,7 @@ export class NhentaiService {
3132
};
3233
})).filter((i: any) => i.src)
3334
.map((img: any) => {
34-
return { src: environment.proxy + Base64.toBase64(`${img.src}`) }
35+
return { src: this.proxy.proxyUrl(`${img.src}`) }
3536
})
3637

3738
};

src/app/@site-modules/pixiv/data-access/pixiv.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import { inject, Injectable } from '@angular/core';
33
import { Observable, map } from 'rxjs';
44
import { environment } from '../../../../environments/environment';
55
import { CompositionEpisode, CompositionPublisher } from '../../@common-read';
6-
import { Base64 } from '../../../shared/utils';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
77

88
@Injectable({
99
providedIn: 'root'
1010
})
1111
export class PixivService {
1212
http: HttpClient = inject(HttpClient)
13+
proxy: ProxyService = inject(ProxyService)
1314

1415
getComposition(id: string): Observable<CompositionEpisode> {
15-
return this.http.get<any>(environment.proxy + Base64.toBase64(environment.pixivHost + id))
16+
return this.http.get<any>(this.proxy.proxyUrl(environment.pixivHost + id))
1617
.pipe(map((data) => { return this.map(data.body) }))
1718
}
1819

@@ -25,7 +26,7 @@ export class PixivService {
2526
id: data.author_details.user_id as string,
2627
site: `https://pixiv.net/en/users/` + data.author_details.user_id as string,
2728
name: data.author_details.user_name as string,
28-
avatar: environment.proxy + Base64.toBase64(data.author_details.profile_img.main) + '&ref=https://www.pixiv.net' as string,
29+
avatar: this.proxy.proxyUrl(data.author_details.profile_img.main) + '&ref=https://www.pixiv.net' as string,
2930
description: '',
3031
links: []
3132
} as unknown as CompositionPublisher,
@@ -46,7 +47,7 @@ export class PixivService {
4647

4748
.filter((i: any) => i.src).map((img: any) => {
4849
return {
49-
src: environment.proxy + Base64.toBase64(img.src) + '&ref=https://www.pixiv.net',
50+
src: this.proxy.proxyUrl(img.src) + '&ref=https://www.pixiv.net',
5051
width: img.width,
5152
height: img.height
5253
}

src/app/@site-modules/reddit/data-access/reddit.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { HttpClient } from '@angular/common/http';
2-
import { Injectable } from '@angular/core';
2+
import { inject, Injectable } from '@angular/core';
33
import { Observable, map } from 'rxjs';
44
import { environment } from '../../../../environments/environment';
55
import { CompositionEpisode } from '../../@common-read';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
67
import { Base64 } from '../../../shared/utils';
78

89
@Injectable({
910
providedIn: 'root'
1011
})
1112
export class RedditService {
13+
proxy: ProxyService = inject(ProxyService)
1214

1315
constructor(private http: HttpClient) { }
1416

@@ -32,7 +34,7 @@ export class RedditService {
3234
const ext = (media_metadata[i.media_id]?.m).replace('image/', '');
3335
const imgSrc = `https://i.redd.it/${i.media_id}.${ext ?? 'jpg'}`
3436
return {
35-
src: environment.proxy + Base64.toBase64(imgSrc),
37+
src: this.proxy.proxyUrl(imgSrc),
3638
height: (media_metadata[i.media_id]?.s).y,
3739
width: (media_metadata[i.media_id]?.s).x,
3840
}

src/app/@site-modules/telegraph/data-access/telegraph.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { HttpClient, HttpParams } from '@angular/common/http';
2-
import { Injectable } from '@angular/core';
2+
import { inject, Injectable } from '@angular/core';
33
import { Observable, map } from 'rxjs';
44
import { CompositionEpisode } from '../../@common-read';
55
import { environment } from '../../../../environments/environment';
6-
import { Base64 } from '../../../shared/utils';
6+
import { ProxyService } from '../../../shared/data-access/proxy.service';
77

88
@Injectable({
99
providedIn: 'root'
1010
})
1111
export class TelegraphService {
12+
proxy: ProxyService = inject(ProxyService)
1213

1314
constructor(private http: HttpClient) { }
1415

@@ -27,7 +28,7 @@ export class TelegraphService {
2728
src: item.children.find((child: any) => child.tag === "img")?.attrs.src
2829
};
2930
})).filter((i: any) => i.src).map((img: any)=> {return {src:
30-
environment.proxy + Base64.toBase64('https://telegra.ph'+ img.src)
31+
this.proxy.proxyUrl('https://telegra.ph'+ img.src)
3132
}})
3233
};
3334

src/app/@site-modules/yandere/data-access/yandere.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ import { inject, Injectable } from '@angular/core';
22
import { environment } from '../../../../environments/environment';
33
import { HttpClient } from '@angular/common/http';
44
import { Observable, map } from 'rxjs';
5-
import { CompositionEpisode, CompositionPublisher } from '../../@common-read';
5+
import { CompositionEpisode } from '../../@common-read';
66
import { Base64 } from '../../../shared/utils';
7+
import { ProxyService } from '../../../shared/data-access/proxy.service';
78

89
@Injectable({
910
providedIn: 'root'
1011
})
1112
export class YandereService {
1213
http: HttpClient = inject(HttpClient)
14+
proxy: ProxyService = inject(ProxyService)
1315

1416
getComposition(id: string): Observable<CompositionEpisode> {
15-
return this.http.get<any>(environment.yanderePoolsHost + id)
17+
return this.http.get<any>(this.proxy.proxyUrl(environment.yanderePoolsHost + id))
1618
.pipe(map((data) => { return this.map(data) }))
1719
}
1820

@@ -29,7 +31,7 @@ export class YandereService {
2931
})).filter((i: any) => i.src)
3032
.map((img: any) => {
3133
return {
32-
src: environment.proxy + Base64.toBase64(img.src),
34+
src: this.proxy.proxyUrl(img.src),
3335
width: img.width,
3436
height: img.height
3537
}

0 commit comments

Comments
 (0)