Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .directory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Desktop Entry]
Icon=folder-chytanka
10 changes: 3 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,21 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci --force
- run: npm install -g @angular/cli > /dev/null
- run: ng build --output-path dist

- name: Copy index.html to 404.html
run: cp dist/browser/index.html dist/browser/404.html
- run: cp dist/browser/index.html dist/browser/404.html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chytanka",
"version": "0.13.32",
"version": "0.14.33",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

@if (!(loading$ | async)) {
<app-viewer [playlist]="playlist" [playlistLink]="playlistLink" [currentPlaylistItem]="currentPlaylistItem"
[episode]="episode"><ng-content /></app-viewer>
[episode]="episode">
<div ngProjectAs="source-logo"><ng-content select="source-logo" /></div>
<ng-content />
</app-viewer>
}

}
Expand Down
21 changes: 13 additions & 8 deletions src/app/@site-modules/comick/comick.service.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { Observable, map } from 'rxjs';
import { environment } from '../../../environments/environment';
import { CompositionEpisode } from '../@common-read';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';

@Injectable({
providedIn: 'root'
})
export class ComickService {
platformId = inject(PLATFORM_ID)
http: HttpClient = inject(HttpClient)
proxy: ProxyService = inject(ProxyService)

getComposition(id: string): Observable<CompositionEpisode> {
// this.proxy.proxyUrl()
return this.http.get<any>((environment.comickHost + id))
const url = isPlatformServer(this.platformId)
? environment.comickHost + id
: this.proxy.proxyUrl(environment.comickHost + id);

return this.http.get<any>(url)
.pipe(map((data) => { return this.map(data) }))
}

Expand All @@ -30,11 +35,11 @@ export class ComickService {
width: item.w
};
})).filter((i: any) => i.src)
// .map((img: any) => {
// return {
// src: this.proxy.proxyUrl(`${img.src}`)
// }
// })
// .map((img: any) => {
// return {
// src: this.proxy.proxyUrl(`${img.src}`)
// }
// })

};

Expand Down
45 changes: 45 additions & 0 deletions src/app/@site-modules/imgchest/imgchest-shell.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Component } from '@angular/core';
import { ImgchestService } from './imgchest.service';
import { Base64 } from '../../shared/utils';
import { of, switchMap } from 'rxjs';
import { CommonReadModule, ReadBaseComponent } from '../@common-read';
import { IMGCHEST_PATH } from '../../app-routing.module';

@Component({
imports: [CommonReadModule],
selector: 'app-imgchest-shell',
template: `<app-common-read [episode$]="episode$" [error$]="error$" [loading$]="loading$" (refreshData)="refreshData()" [playlist]="playlistService.playlist()" [playlistLink]="playlistLink()" [currentPlaylistItem]="currentPlItem()">

<a ngProjectAs="source-logo" href="https://imgchest.com" target="_blank" rel="noopener noreferrer" style="display: flex; gap: 1ch; ">
<img style="max-width: 40px;" src="/assets/logos/imgchest.png" alt="Imgchest logo">
</a>

<div style="direction: ltr; user-select: text !important; text-wrap: balance; text-align: center; display: grid; place-content: center; justify-items: center;">
<p>{{lang.ph().imagesVia}}<a href="https://imgchest.com" target="_blank" rel="noopener noreferrer">Imgchest</a>
API.
{{lang.ph().thanks}}<br>{{lang.ph().detalisCopy}}</p>
</div></app-common-read>`
})
export default class ImgchestShellComponent extends ReadBaseComponent {

override episode$ = this.combineParamMapAndRefresh()
.pipe(this.tapStartLoading(),
switchMap(([params]) => {
const idParam = params?.get('id');

if (!idParam) return of(null);

const id = (Base64.isBase64(idParam)) ? Base64.fromBase64(idParam) : idParam;
const id64 = Base64.toBase64(id);

return (this.imgchest.getComposition(id)).pipe(this.catchError(), this.tapSetMetaTags(),
this.tapSaveToHistory(IMGCHEST_PATH, id64),
this.tapSaveToCurrentPlaylistItem(IMGCHEST_PATH, id),


this.finalizeLoading());
})
);

constructor(public imgchest: ImgchestService) { super() }
}
113 changes: 113 additions & 0 deletions src/app/@site-modules/imgchest/imgchest.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { environment } from '../../../environments/environment';
import { Observable, map } from 'rxjs';
import { CompositionEpisode, CompositionImage } from '../@common-read';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';
interface ImgchestRespCompImage {
id: string;
description: string;
link: string;
position: number
created: string;
}
interface ImgchestRespComp {
id: string;
title: string;
username: string;
privacy: string;
report_status: number;
views: number;
nsfw: number;
image_count: number;
created: string;
images: Array<ImgchestRespCompImage>;
}
interface ImgchestResp {
data: any | ImgchestRespComp
}

@Injectable({
providedIn: 'root'
})
export class ImgchestService {
private readonly clientId: string = 'T0eSFX9IOg0Okcg7g3UN7jp8MDreLglRyYKYkw2Gd74de321';
platformId = inject(PLATFORM_ID)

proxy: ProxyService = inject(ProxyService)
http: HttpClient = inject(HttpClient)

constructor() { }

getComposition(id: string): Observable<CompositionEpisode> {
const headers = new HttpHeaders({
'Authorization': `Bearer ${this.clientId}`
});

const url = isPlatformServer(this.platformId)
? environment.imgchestHost + id
: this.proxy.proxyUrl(environment.imgchestHost + id);

return this.http.get<ImgchestResp>(url, { headers })
.pipe(map((data: ImgchestResp) => { return this.map(data.data) }))
}


map(data: ImgchestRespComp): CompositionEpisode {
const res: CompositionEpisode = {
title: data.title,
episode: 0,
nsfw: (data.nsfw) as unknown as boolean,
images: data.images.map((i): CompositionImage => {
return {
src: this.proxy.proxyUrl(i.link),
alt: i.description,
}
})

}
return res;
}

}

/**
{
"data": {
"id": "wl7l2rvgo4x",
"title": null,
"username": "Anonymous",
"privacy": "hidden",
"report_status": 1,
"views": 1,
"nsfw": 0,
"image_count": 3,
"created": "2025-06-13T13:37:01.000000Z",
"images": [
{
"id": "46acqe3zkk7",
"description": null,
"link": "https:\/\/cdn.imgchest.com\/files\/46acqe3zkk7.jpg",
"position": 1,
"created": "2025-06-13T13:37:01.000000Z"
},
{
"id": "yvdcwog6vpy",
"description": null,
"link": "https:\/\/cdn.imgchest.com\/files\/yvdcwog6vpy.jpg",
"position": 2,
"created": "2025-06-13T13:37:02.000000Z"
},
{
"id": "yxkczok2ro7",
"description": null,
"link": "https:\/\/cdn.imgchest.com\/files\/yxkczok2ro7.jpg",
"position": 3,
"created": "2025-06-13T13:37:03.000000Z"
}
]
}
}

*/
22 changes: 18 additions & 4 deletions src/app/@site-modules/mangadex/mangadex.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { environment } from '../../../environments/environment';
import { Observable, catchError, map, throwError } from 'rxjs';
import { CompositionEpisode, CompositionImage } from '../@common-read';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';

interface MdChapterImages {
hash: string;
Expand Down Expand Up @@ -63,11 +64,16 @@ interface MdMangaResp {
providedIn: 'root'
})
export class MangadexService {
platformId = inject(PLATFORM_ID)
http: HttpClient = inject(HttpClient)
proxy: ProxyService = inject(ProxyService)

getChapterImages(id: string): Observable<CompositionImage[]> {
return this.http.get<MdChapterImagesResp>(this.proxy.proxyUrl(environment.mangadexHost + id))
const url = isPlatformServer(this.platformId)
? environment.mangadexHost + id
: this.proxy.proxyUrl(environment.mangadexHost + id);

return this.http.get<MdChapterImagesResp>(url)
.pipe(
map((data: MdChapterImagesResp) => data.chapter.dataSaver.map((item: string) => {
return {
Expand All @@ -81,7 +87,11 @@ export class MangadexService {
}

getChapter(id: string): Observable<CompositionEpisode> {
return this.http.get<MdChapterResp>(this.proxy.proxyUrl(environment.mangadexChapter + id))
const url = isPlatformServer(this.platformId)
? environment.mangadexChapter + id
: this.proxy.proxyUrl(environment.mangadexChapter + id);

return this.http.get<MdChapterResp>(url)
.pipe(
map((data: MdChapterResp) => {
return {
Expand All @@ -99,7 +109,11 @@ export class MangadexService {


getManga(id: string): Observable<{ nsfw: boolean }> {
return this.http.get<MdMangaResp>(this.proxy.proxyUrl(environment.mangadexManga + id)).pipe(this.nsfwMap())
const url = isPlatformServer(this.platformId)
? environment.mangadexManga + id
: this.proxy.proxyUrl(environment.mangadexManga + id);

return this.http.get<MdMangaResp>(url).pipe(this.nsfwMap())
}

nsfwMap() {
Expand Down
10 changes: 8 additions & 2 deletions src/app/@site-modules/nhentai/nhentai.service.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { Observable, map } from 'rxjs';
import { environment } from '../../../environments/environment';
import { CompositionEpisode } from '../@common-read';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';

@Injectable({
providedIn: 'root'
})
export class NhentaiService {
platformId = inject(PLATFORM_ID)
http: HttpClient = inject(HttpClient)
proxy: ProxyService = inject(ProxyService)

getComposition(id: string): Observable<CompositionEpisode> {
return this.http.get<any>(this.proxy.proxyUrl(environment.nhentaiHost + id))
const url = isPlatformServer(this.platformId)
? environment.nhentaiHost + id
: this.proxy.proxyUrl(environment.nhentaiHost + id);

return this.http.get<any>(url)
.pipe(map((data) => { return this.map(data) }))
}

Expand Down
10 changes: 8 additions & 2 deletions src/app/@site-modules/pixiv/pixiv.service.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { Observable, map } from 'rxjs';
import { environment } from '../../../environments/environment';
import { CompositionEpisode, CompositionPublisher } from '../@common-read';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';

@Injectable({
providedIn: 'root'
})
export class PixivService {
platformId = inject(PLATFORM_ID)
http: HttpClient = inject(HttpClient)
proxy: ProxyService = inject(ProxyService)

getComposition(id: string): Observable<CompositionEpisode> {
return this.http.get<any>(this.proxy.proxyUrl(environment.pixivHost + id))
const url = isPlatformServer(this.platformId)
? environment.pixivHost + id
: this.proxy.proxyUrl(environment.pixivHost + id);

return this.http.get<any>(url)
.pipe(map((data) => { return this.map(data.body) }))
}

Expand Down
10 changes: 8 additions & 2 deletions src/app/@site-modules/yandere/yandere.service.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import { inject, Injectable } from '@angular/core';
import { inject, Injectable, PLATFORM_ID } from '@angular/core';
import { environment } from '../../../environments/environment';
import { HttpClient } from '@angular/common/http';
import { Observable, map } from 'rxjs';
import { CompositionEpisode } from '../@common-read';
import { Base64 } from '../../shared/utils';
import { ProxyService } from '../../shared/data-access/proxy.service';
import { isPlatformServer } from '@angular/common';

@Injectable({
providedIn: 'root'
})
export class YandereService {
platformId = inject(PLATFORM_ID)
http: HttpClient = inject(HttpClient)
proxy: ProxyService = inject(ProxyService)

getComposition(id: string): Observable<CompositionEpisode> {
return this.http.get<any>(this.proxy.proxyUrl(environment.yanderePoolsHost + id))
const url = isPlatformServer(this.platformId)
? environment.yanderePoolsHost + id
: this.proxy.proxyUrl(environment.yanderePoolsHost + id);

return this.http.get<any>(url)
.pipe(map((data) => { return this.map(data) }))
}

Expand Down
Loading
Loading