[mangapark] export GraphQL queries

This commit is contained in:
Mike Fährmann
2026-01-31 22:10:57 +01:00
parent 40a4ff935a
commit 0c24955507
3 changed files with 188 additions and 183 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2015-2025 Mike Fährmann # Copyright 2015-2026 Mike Fährmann
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as # it under the terms of the GNU General Public License version 2 as
@@ -60,7 +60,7 @@ class MangaparkBase():
def _request_graphql(self, opname, variables): def _request_graphql(self, opname, variables):
url = self.root + "/apo/" url = self.root + "/apo/"
data = { data = {
"query" : QUERIES[opname], "query" : self.utils("graphql", opname),
"variables" : variables, "variables" : variables,
"operationName": opname, "operationName": opname,
} }
@@ -177,183 +177,3 @@ class MangaparkMangaExtractor(MangaparkBase, Extractor):
raise exception.AbortExtraction( raise exception.AbortExtraction(
f"'{source}' does not match any available source") f"'{source}' does not match any available source")
QUERIES = {
"Get_comicChapterList": """
query Get_comicChapterList($comicId: ID!) {
get_comicChapterList(comicId: $comicId) {
data {
id
dname
title
lang
urlPath
srcTitle
sourceId
dateCreate
}
}
}
""",
"Get_chapterNode": """
query Get_chapterNode($getChapterNodeId: ID!) {
get_chapterNode(id: $getChapterNodeId) {
data {
id
dname
lang
sourceId
srcTitle
dateCreate
comicNode{
id
}
imageFile {
urlList
}
}
}
}
""",
"Get_comicNode": """
query Get_comicNode($getComicNodeId: ID!) {
get_comicNode(id: $getComicNodeId) {
data {
id
name
artists
authors
genres
}
}
}
""",
"get_content_source_chapterList": """
query get_content_source_chapterList($sourceId: Int!) {
get_content_source_chapterList(
sourceId: $sourceId
) {
id
data {
id
sourceId
dbStatus
isNormal
isHidden
isDeleted
isFinal
dateCreate
datePublic
dateModify
lang
volume
serial
dname
title
urlPath
srcTitle srcColor
count_images
stat_count_post_child
stat_count_post_reply
stat_count_views_login
stat_count_views_guest
userId
userNode {
id
data {
id
name
uniq
avatarUrl
urlPath
verified
deleted
banned
dateCreate
dateOnline
stat_count_chapters_normal
stat_count_chapters_others
is_adm is_mod is_vip is_upr
}
}
disqusId
}
}
}
""",
"get_content_comic_sources": """
query get_content_comic_sources($comicId: Int!, $dbStatuss: [String] = [], $userId: Int, $haveChapter: Boolean, $sortFor: String) {
get_content_comic_sources(
comicId: $comicId
dbStatuss: $dbStatuss
userId: $userId
haveChapter: $haveChapter
sortFor: $sortFor
) {
id
data{
id
dbStatus
isNormal
isHidden
isDeleted
lang name altNames authors artists
release
genres summary{code} extraInfo{code}
urlCover600
urlCover300
urlCoverOri
srcTitle srcColor
chapterCount
chapterNode_last {
id
data {
dateCreate datePublic dateModify
volume serial
dname title
urlPath
userNode {
id data {uniq name}
}
}
}
}
}
}
""",
}

View File

@@ -0,0 +1,185 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
Get_comicChapterList = """
query Get_comicChapterList($comicId: ID!) {
get_comicChapterList(comicId: $comicId) {
data {
id
dname
title
lang
urlPath
srcTitle
sourceId
dateCreate
}
}
}
"""
Get_chapterNode = """
query Get_chapterNode($getChapterNodeId: ID!) {
get_chapterNode(id: $getChapterNodeId) {
data {
id
dname
lang
sourceId
srcTitle
dateCreate
comicNode{
id
}
imageFile {
urlList
}
}
}
}
"""
Get_comicNode = """
query Get_comicNode($getComicNodeId: ID!) {
get_comicNode(id: $getComicNodeId) {
data {
id
name
artists
authors
genres
}
}
}
"""
get_content_source_chapterList = """
query get_content_source_chapterList($sourceId: Int!) {
get_content_source_chapterList(
sourceId: $sourceId
) {
id
data {
id
sourceId
dbStatus
isNormal
isHidden
isDeleted
isFinal
dateCreate
datePublic
dateModify
lang
volume
serial
dname
title
urlPath
srcTitle srcColor
count_images
stat_count_post_child
stat_count_post_reply
stat_count_views_login
stat_count_views_guest
userId
userNode {
id
data {
id
name
uniq
avatarUrl
urlPath
verified
deleted
banned
dateCreate
dateOnline
stat_count_chapters_normal
stat_count_chapters_others
is_adm is_mod is_vip is_upr
}
}
disqusId
}
}
}
"""
get_content_comic_sources = """
query get_content_comic_sources($comicId: Int!, $dbStatuss: [String] = [], $userId: Int, $haveChapter: Boolean, $sortFor: String) {
get_content_comic_sources(
comicId: $comicId
dbStatuss: $dbStatuss
userId: $userId
haveChapter: $haveChapter
sortFor: $sortFor
) {
id
data{
id
dbStatus
isNormal
isHidden
isDeleted
lang name altNames authors artists
release
genres summary{code} extraInfo{code}
urlCover600
urlCover300
urlCoverOri
srcTitle srcColor
chapterCount
chapterNode_last {
id
data {
dateCreate datePublic dateModify
volume serial
dname title
urlPath
userNode {
id data {uniq name}
}
}
}
}
}
}
"""

View File

@@ -4,5 +4,5 @@ ignore = E203,E226,W504
per-file-ignores = per-file-ignores =
setup.py: E501 setup.py: E501
gallery_dl/extractor/utils/500px_graphql.py: E501 gallery_dl/extractor/utils/500px_graphql.py: E501
gallery_dl/extractor/mangapark.py: E501 gallery_dl/extractor/utils/mangapark_graphql.py: E501
test/results/*.py: E122,E241,E402,E501 test/results/*.py: E122,E241,E402,E501