diff --git a/gallery_dl/extractor/mangapark.py b/gallery_dl/extractor/mangapark.py index cd72850f..05899e99 100644 --- a/gallery_dl/extractor/mangapark.py +++ b/gallery_dl/extractor/mangapark.py @@ -1,6 +1,6 @@ # -*- 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 # 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): url = self.root + "/apo/" data = { - "query" : QUERIES[opname], + "query" : self.utils("graphql", opname), "variables" : variables, "operationName": opname, } @@ -177,183 +177,3 @@ class MangaparkMangaExtractor(MangaparkBase, Extractor): raise exception.AbortExtraction( 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} - } - } - } -} - - } - } -""", -} diff --git a/gallery_dl/extractor/utils/mangapark_graphql.py b/gallery_dl/extractor/utils/mangapark_graphql.py new file mode 100644 index 00000000..271f2d53 --- /dev/null +++ b/gallery_dl/extractor/utils/mangapark_graphql.py @@ -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} + } + } + } +} + + } + } +""" diff --git a/setup.cfg b/setup.cfg index 7fb6eece..a9a1b150 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,5 +4,5 @@ ignore = E203,E226,W504 per-file-ignores = setup.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