mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-04 18:04:16 +02:00
Compare commits
28 Commits
dc7696ee26
...
master
Author | SHA1 | Date | |
---|---|---|---|
ba1ebcd6ba | |||
cc655b0acd | |||
3f5c9d0ca1 | |||
538825f0ef | |||
f0de0a29da | |||
d4227f2b8f | |||
cd00d35f22 | |||
4ef3e877ce | |||
7dba2518f9 | |||
7506a0201e | |||
91fb815153 | |||
6faf8bc733 | |||
bdff5b7aec | |||
5af8060d7b | |||
6ed8ff1d52 | |||
3324ed6e4a | |||
67fd9d284b | |||
08f26dd21d | |||
89ed500751 | |||
b00b0ee030 | |||
e47c52ad48 | |||
293f0af8e3 | |||
ebfa34e386 | |||
14524407f9 | |||
d56f0b383a | |||
70391c83c1 | |||
c9bc79fbd5 | |||
942b43da67 |
4
.github/ISSUE_TEMPLATE/new_connector.yml
vendored
4
.github/ISSUE_TEMPLATE/new_connector.yml
vendored
@ -12,7 +12,7 @@ body:
|
|||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Is the Website free to access?
|
label: Is the Website free to access?
|
||||||
description: We can't support pay-to-use sites.
|
description: We can't support pay-to-use sites, or captcha-proxied sites as Cloudflare.
|
||||||
options:
|
options:
|
||||||
- label: The Website is freely accessible.
|
- label: The Website is freely accessible.
|
||||||
required: true
|
required: true
|
||||||
@ -20,4 +20,4 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Anything else?
|
label: Anything else?
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
@ -22,7 +22,7 @@ jobs:
|
|||||||
# https://github.com/marketplace/actions/docker-setup-buildx
|
# https://github.com/marketplace/actions/docker-setup-buildx
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
# https://github.com/docker/login-action#docker-hub
|
# https://github.com/docker/login-action#docker-hub
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
# https://github.com/docker/build-push-action#multi-platform-image
|
# https://github.com/docker/build-push-action#multi-platform-image
|
||||||
- name: Build and push API
|
- name: Build and push API
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
45
.github/workflows/docker-image-dev.yml
vendored
45
.github/workflows/docker-image-dev.yml
vendored
@ -1,45 +0,0 @@
|
|||||||
name: Docker Image CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "dev" ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# https://github.com/docker/setup-qemu-action#usage
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3.6.0
|
|
||||||
|
|
||||||
# https://github.com/marketplace/actions/docker-setup-buildx
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
|
||||||
|
|
||||||
# https://github.com/docker/login-action#docker-hub
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
# https://github.com/docker/build-push-action#multi-platform-image
|
|
||||||
- name: Build and push API
|
|
||||||
uses: docker/build-push-action@v6.15.0
|
|
||||||
with:
|
|
||||||
context: ./
|
|
||||||
file: ./Dockerfile
|
|
||||||
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
pull: true
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
glax/tranga-api:dev
|
|
4
.github/workflows/docker-image-master.yml
vendored
4
.github/workflows/docker-image-master.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
# https://github.com/marketplace/actions/docker-setup-buildx
|
# https://github.com/marketplace/actions/docker-setup-buildx
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
# https://github.com/docker/login-action#docker-hub
|
# https://github.com/docker/login-action#docker-hub
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
# https://github.com/docker/build-push-action#multi-platform-image
|
# https://github.com/docker/build-push-action#multi-platform-image
|
||||||
- name: Build and push API
|
- name: Build and push API
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
6
.github/workflows/docker-image-serverv2.yml
vendored
6
.github/workflows/docker-image-serverv2.yml
vendored
@ -2,7 +2,7 @@ name: Docker Image CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "Server-V2" ]
|
branches: [ "postgres-Server-V2" ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -22,7 +22,7 @@ jobs:
|
|||||||
# https://github.com/marketplace/actions/docker-setup-buildx
|
# https://github.com/marketplace/actions/docker-setup-buildx
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
# https://github.com/docker/login-action#docker-hub
|
# https://github.com/docker/login-action#docker-hub
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
# https://github.com/docker/build-push-action#multi-platform-image
|
# https://github.com/docker/build-push-action#multi-platform-image
|
||||||
- name: Build and push API
|
- name: Build and push API
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
with:
|
with:
|
||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# Testers for V2 wanted!
|
||||||
|
|
||||||
|
[Details](https://github.com/C9Glax/tranga/pull/355#issuecomment-2764217944)
|
||||||
|
|
||||||
<!-- PROJECT LOGO -->
|
<!-- PROJECT LOGO -->
|
||||||
<br />
|
<br />
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
@ -32,7 +32,7 @@ public class Manganato : MangaConnector
|
|||||||
|
|
||||||
private Manga[] ParsePublicationsFromHtml(HtmlDocument document)
|
private Manga[] ParsePublicationsFromHtml(HtmlDocument document)
|
||||||
{
|
{
|
||||||
List<HtmlNode> searchResults = document.DocumentNode.Descendants("div").Where(n => n.HasClass("panel_story_list")).ToList();
|
List<HtmlNode> searchResults = document.DocumentNode.Descendants("div").Where(n => n.HasClass("story_item")).ToList();
|
||||||
Log($"{searchResults.Count} items.");
|
Log($"{searchResults.Count} items.");
|
||||||
List<string> urls = new();
|
List<string> urls = new();
|
||||||
foreach (HtmlNode mangaResult in searchResults)
|
foreach (HtmlNode mangaResult in searchResults)
|
||||||
@ -99,7 +99,9 @@ public class Manganato : MangaConnector
|
|||||||
else if (text.StartsWith("status :"))
|
else if (text.StartsWith("status :"))
|
||||||
{
|
{
|
||||||
string status = text.Replace("status :", "").Trim().ToLower();
|
string status = text.Replace("status :", "").Trim().ToLower();
|
||||||
if (status == "ongoing")
|
if (string.IsNullOrWhiteSpace(status))
|
||||||
|
releaseStatus = Manga.ReleaseStatusByte.Continuing;
|
||||||
|
else if (status == "ongoing")
|
||||||
releaseStatus = Manga.ReleaseStatusByte.Continuing;
|
releaseStatus = Manga.ReleaseStatusByte.Continuing;
|
||||||
else
|
else
|
||||||
releaseStatus = Enum.Parse<Manga.ReleaseStatusByte>(status, true);
|
releaseStatus = Enum.Parse<Manga.ReleaseStatusByte>(status, true);
|
||||||
@ -167,8 +169,9 @@ public class Manganato : MangaConnector
|
|||||||
foreach (HtmlNode chapterInfo in chapterList.Descendants("div").Where(x => x.HasClass("row")))
|
foreach (HtmlNode chapterInfo in chapterList.Descendants("div").Where(x => x.HasClass("row")))
|
||||||
{
|
{
|
||||||
string url = chapterInfo.Descendants("a").First().GetAttributeValue("href", "");
|
string url = chapterInfo.Descendants("a").First().GetAttributeValue("href", "");
|
||||||
string chapterName = chapterInfo.Descendants("a").First().GetAttributeValue("title", "");
|
var name = chapterInfo.Descendants("a").First().InnerText.Trim();
|
||||||
string chapterNumber = Regex.Match(chapterName, @"Chapter ([0-9]+(\.[0-9]+)*)").Groups[1].Value;
|
string chapterName = nameRex.Match(name).Groups[3].Value;
|
||||||
|
string chapterNumber = Regex.Match(name, @"Chapter ([0-9]+(\.[0-9]+)*)").Groups[1].Value;
|
||||||
string? volumeNumber = Regex.Match(chapterName, @"Vol\.([0-9]+)").Groups[1].Value;
|
string? volumeNumber = Regex.Match(chapterName, @"Vol\.([0-9]+)").Groups[1].Value;
|
||||||
if (string.IsNullOrWhiteSpace(volumeNumber))
|
if (string.IsNullOrWhiteSpace(volumeNumber))
|
||||||
volumeNumber = "0";
|
volumeNumber = "0";
|
||||||
|
@ -56,7 +56,7 @@ public class Webtoons : MangaConnector
|
|||||||
Log($"Failed to retrieve site");
|
Log($"Failed to retrieve site");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Regex regex = new Regex(@".*webtoons\.com/en/(?<category>[^/]+)/(?<title>[^/]+)/list\?title_no=(?<id>\d+).*");
|
Regex regex = new Regex(@".*webtoons\.com\/en\/(?<category>[^\/]+)\/(?<title>[^\/]+)\/list\?title_no=(?<id>\d+).*");
|
||||||
Match match = regex.Match(url);
|
Match match = regex.Match(url);
|
||||||
|
|
||||||
if(match.Success) {
|
if(match.Success) {
|
||||||
@ -110,7 +110,7 @@ public class Webtoons : MangaConnector
|
|||||||
|
|
||||||
HtmlNode posterNode = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'detail_body') and contains(@class, 'banner')]");
|
HtmlNode posterNode = document.DocumentNode.SelectSingleNode("//div[contains(@class, 'detail_body') and contains(@class, 'banner')]");
|
||||||
|
|
||||||
Regex regex = new Regex(@"url\((?<url>.*?)\)");
|
Regex regex = new Regex(@"url\('(?<url>.*?)'\)");
|
||||||
Match match = regex.Match(posterNode.GetAttributeValue("style", ""));
|
Match match = regex.Match(posterNode.GetAttributeValue("style", ""));
|
||||||
|
|
||||||
string posterUrl = match.Groups["url"].Value;
|
string posterUrl = match.Groups["url"].Value;
|
||||||
@ -270,4 +270,4 @@ internal class PublicationManager {
|
|||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Category { get; set; }
|
public string Category { get; set; }
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class Weebcentral : MangaConnector
|
|||||||
if (document.DocumentNode.SelectNodes("//article") == null)
|
if (document.DocumentNode.SelectNodes("//article") == null)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
List<string> urls = document.DocumentNode.SelectNodes("/html/body/article/a[@class='link link-hover']")
|
List<string> urls = document.DocumentNode.SelectNodes("/html/body/article/a[@class='link link-hover tooltip tooltip-bottom']")
|
||||||
.Select(elem => elem.GetAttributeValue("href", "")).ToList();
|
.Select(elem => elem.GetAttributeValue("href", "")).ToList();
|
||||||
|
|
||||||
HashSet<Manga> ret = new();
|
HashSet<Manga> ret = new();
|
||||||
@ -210,6 +210,6 @@ public class Weebcentral : MangaConnector
|
|||||||
document.DocumentNode.SelectNodes($"//section[@hx-get='{chapter.url}/images']/img")?.ToArray() ?? [];
|
document.DocumentNode.SelectNodes($"//section[@hx-get='{chapter.url}/images']/img")?.ToArray() ?? [];
|
||||||
string[] urls = imageNodes.Select(imgNode => imgNode.GetAttributeValue("src", "")).ToArray();
|
string[] urls = imageNodes.Select(imgNode => imgNode.GetAttributeValue("src", "")).ToArray();
|
||||||
|
|
||||||
return DownloadChapterImages(urls, chapter, RequestType.MangaImage, progressToken: progressToken);
|
return DownloadChapterImages(urls, chapter, RequestType.MangaImage, progressToken: progressToken, referrer: "https://weebcentral.com/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user