Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save ComicBookInfo metadata when save as CBZ #235

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yingziwu
Copy link

When saving to CBZ format, ComicBookInfo metadata is also saved.
It is convenient for manga readers and e-book management software (such as Caliber) to manage and identify.

Without metadata
image
image

With metadata
image
image

@ccloli
Copy link
Owner

ccloli commented Mar 19, 2023

Sorry for the late reply, I checked the regexp use some random gallery names and found some failed titles (image set and cosplay may be a big problem, since their names may not follow the common rules):

絶対服従教室≪前編≫ロシア超能力少女 アーリャ緊急来日 [心海汉化组]
らき☆すたと学ぶ化学-理論編- 第1-5章[中国翻訳]
Let's Learn Chemistry with Lucky☆Star -Basic Theory- Section 1-5|和幸运星一起学化学 -理论篇- 第1-5章[Chinese][桃樹漢化組]
[KR Translation WIP] (C100) [Kayoudou (Matsuka)] MULTI REALITY (Seishun Buta Yarou wa Bunny Girl Senpai no Yume o Minai)
仙丹 [インドネシア翻訳]
[あっかんBi~ (柳ひろひこ)] JKアイドルと(ry (ラブライブ! サンシャイン!!) [中国翻訳] [DL版]
Mamá Ranfa ayuda a Kishi-kun a "relajarse" [español] [princess connect]
[530 (Mk-Co)] 寝取られ特異点2 ~まだまだ(追加で!)寝取られていたサーヴァントたち~ (Fate/Grand Order) [韓国翻訳]
[Twitter] Baby 魚? [Iuui (イウウイ)] (2020.06.27-2022.11.24)
[pixiv] monkey dio 原神+说的道理(r18g)
[FANBOX] 缶子牧場
[アーティスト] ナリズ    // title: [Artist] Nhaliz , subtitle: [アーティスト] ナリズ
[Pixiv] おはぎのくに (75560227) | ohgtabetai | ohgnokuni

Should we fix these special cases?

@yingziwu
Copy link
Author

yingziwu commented Mar 19, 2023

@yingziwu
Copy link
Author

URL Category Title Title_jpn
https://exhentai.org/g/2498121/2595ef6265 Cosplay Twoyun - Chisato & Takina
https://exhentai.org/g/2498119/e67bce7ce2 Misc By Me [AI Generated]
https://exhentai.org/g/2498118/2f72b3bc36 Western Blushmallet 2020 - 2022
https://exhentai.org/g/2498116/71436eb1e5 Image Set Artist Alpha91
https://exhentai.org/g/2498115/ab5e350cae Image Set (Pixiv) Hanon (40992804) (Pixiv) 葉音 (40992804)
https://exhentai.org/g/2498114/6889e87347 Western My Taller Younger Brother-Chapter 3
https://exhentai.org/g/2498113/4679d42f99 Cosplay Pinkchyu - Kobeni
https://exhentai.org/g/2498112/b327b1f83c Western My Taller Younger Brother-Chapter 2
https://exhentai.org/g/2498111/8b7f20fc14 Image Set ★PATREON★ 儒宅 [62818638]
https://exhentai.org/g/2498109/a4ec99cfb9 Western My Taller Younger Brother-Chapter 1
https://exhentai.org/g/2498106/8bc871fa90 Western Blushmallet 2019
https://exhentai.org/g/2498105/288b672e09 Cosplay 黏黏团子兔 - 长发蕾姆
https://exhentai.org/g/2498104/b9bc5defba Misc Amiral_AI's
https://exhentai.org/g/2498103/7142e2b6a7 Western By the Titan's will
https://exhentai.org/g/2498102/0254f095ea Western Blushmallet 2018
https://exhentai.org/g/2498099/d974428966 Doujinshi are done
https://exhentai.org/g/2498097/3f61e9b6b6 Doujinshi three
https://exhentai.org/g/2498095/9fc506cf78 Image Set My Skyrim Screenshot
https://exhentai.org/g/2498094/6b2dd9446d Western Blushmallet 2017
https://exhentai.org/g/2498093/b818afd71d Cosplay 黏黏团子兔 - 白丝胡桃
https://exhentai.org/g/2498083/56cfbc5a79 Image Set Sanuki [FANBOX]
https://exhentai.org/g/2498069/1df1b349a2 Image Set Pavolia Reine
https://exhentai.org/g/2498060/97ffba26e0 Cosplay Fel Velial - Ningguang
https://exhentai.org/g/2498053/002bd9636f Western Monster in the closet
https://exhentai.org/g/2498051/b2eb3fb4e2 Western Artist - Astron [updated + exclusive images]
https://exhentai.org/g/2498044/bfa698c55b Western Blushmallet 2016
https://exhentai.org/g/2498041/10c12a904b Western She-Ra (2018) Doodles [ThatHornyBastard]
https://exhentai.org/g/2498039/9dc69669f4 Misc Bar Rape
https://exhentai.org/g/2498033/b2a0ff06e5 Misc Hell Village - Bulls 09 [Pigking.com.br]
https://exhentai.org/g/2498029/e2bc7945fa Manga COMIC Shitsurakuten 2023-04 [Digital] COMIC 失楽天 2023年4月号 [DL版]
https://exhentai.org/g/2498027/baa0ee6838 Cosplay Fe Galvao - Makima
https://exhentai.org/g/2498023/b53ac91bcb Image Set Aoi Kiriya Illustration Image by Jungle Pocke
https://exhentai.org/g/2498019/e6a56fbb63 Western JOHNNY BRAVO
https://exhentai.org/g/2498016/272c233f63 Artist CG [Amagiri Miki] Observation Report - Asuna 観察報告書-アスナ
https://exhentai.org/g/2498005/4be3e1123f Image Set Artist ::: Liaoliao (Fanbox | Pixiv) 劉了了
https://exhentai.org/g/2498001/82783a3248 Cosplay Domi Versailles - Reiko Holinger
https://exhentai.org/g/2497994/662fad2a68 Western Jolanda De Almaviva n.17 - all'arrembaggio [Italian]
https://exhentai.org/g/2497993/03f4f2d9f8 Western Jolanda De Almaviva n.18 - gli adoratori della luna [Italian]
https://exhentai.org/g/2497992/144f8a479a Western Jolanda De Almaviva n.19 - notte di fuoco [Italian]
https://exhentai.org/g/2497991/845456af9c Western Jolanda De Almaviva n.20 - la bella e il serpente [Italian]
https://exhentai.org/g/2497990/c8baf475a8 Misc (6cw8)Mai Shiranui Boobs Reveal
https://exhentai.org/g/2497989/50c1b4c5d8 Doujinshi Dagashi Chichi 6
https://exhentai.org/g/2497987/20799c8efa Doujinshi Dagashi Chichi 4
https://exhentai.org/g/2497983/3440b2092c Doujinshi 种间外交
https://exhentai.org/g/2497978/354332560e Cosplay Miss Hina genshin impact
https://exhentai.org/g/2497971/c2c4e0d20a Western Starlight Glimmer
https://exhentai.org/g/2497961/03a30e22d8 Image Set Artist Kuroi Suna (2)
https://exhentai.org/g/2497960/a74825c9a9 Doujinshi サキュ生アイドル
https://exhentai.org/g/2497957/f3a59eb39f Misc Master+Player Work
https://exhentai.org/g/2497955/2a3c8c9fe3 Artist CG 雾子与妈妈の战败雌堕(守望先锋2同人H) 雾子与妈妈の战败雌堕(守望先锋2同人H)
https://exhentai.org/g/2497951/0a49d80ab3 Doujinshi ミルキング牧場
https://exhentai.org/g/2497947/e94f5acae1 Image Set Artist KDMN - Twitter 2021 + Pixiv 14958683 + Premium content pt1
https://exhentai.org/g/2497946/88f44194f2 Doujinshi 中華サキュバスの異国エステにご用心~サキュバスのお姉さんに騙され無理矢理ヌルヌルオチン〇ンを搾られちゃうお話~
https://exhentai.org/g/2497942/b929958709 Misc 想玩色图,但因为没电脑入了二次元坑,一些手机小程序做的入门色图 [AI Generated]
https://exhentai.org/g/2497941/e5be10ddb0 Misc Miku and Others made by AI [AI Generated]
https://exhentai.org/g/2497940/2227256ae9 Misc Fubuki – One Punch Man (Green Leaf Studio)
https://exhentai.org/g/2497939/7d6d51edf7 Misc Anne Takamaki (Green Leaf Studio)
https://exhentai.org/g/2497936/2167c4b550 Misc Some good by AI [AI Generated]
https://exhentai.org/g/2497935/4f6bd96f04 Doujinshi 魔法少女が人格排泄させられ箱に詰められるお話
https://exhentai.org/g/2497934/ac8757ff0b Doujinshi soniko e l'ipnosi
https://exhentai.org/g/2497933/506abe8697 Western Ruby Gillman, Teenage Kraken
https://exhentai.org/g/2497930/9e90f11219 Misc TakoTengu [AI Generated] たこ天狗 [AI生成]
https://exhentai.org/g/2497901/c64585bf99 Western Artist ::: Vitalis
https://exhentai.org/g/2497900/b115e2056e Doujinshi 【C100】井上さん好きのためのえっちな本 【C100】井上さん好きのためのえっちな本
https://exhentai.org/g/2497882/3406fc1a93 Western John North - Riley #1
https://exhentai.org/g/2497879/20233b1ef3 Misc Bella's Secret [UnderTheHood]
https://exhentai.org/g/2497870/3a72648d00 Image Set ◆FANBOX◆ 裏智屋 [12371600&vp6pcg0q]
https://exhentai.org/g/2497869/3e3f8ef180 Doujinshi 想快点长大的孩子
https://exhentai.org/g/2497854/aaa6a9f88c Misc MidnightClass - Chapter 14
https://exhentai.org/g/2497842/31d6241084 Cosplay Melondoki - Harley Quinn
https://exhentai.org/g/2497831/4d7bf2f345 Manga Oye no inuma no sentaku Oye no inuma no sentaku
https://exhentai.org/g/2497820/65652dd317 Misc 🐱 Furry cooking show 🐯 [AI Generated]
https://exhentai.org/g/2497816/7801062d8f Western The Yellow Fantasy: The Pastime Complete Croc
https://exhentai.org/g/2497815/578e7ec276 Cosplay 水淼aqua -镇海
https://exhentai.org/g/2497811/5e73d6cdcc Western Malavita Internazionale n.9 - Droga maledetta [Italian]
https://exhentai.org/g/2497808/ec419bf9c0 Image Set Artist 道楽★★ [do-luck]
https://exhentai.org/g/2497806/fa874ba5ae Western Jolanda De Almaviva n.26 - tuonano i cannoni [Italian]
https://exhentai.org/g/2497800/bf060b8049 Misc 【DF Industry】Momono 新晋艺人桃子的潜规则 01
https://exhentai.org/g/2497798/1c65bf3ba2 Western Mrsmiles [ARTIST]
https://exhentai.org/g/2497791/76126e605c Doujinshi (Reikoku na Haizara) Noelle's Antidote (Genshin Impact) [English] [LunaticSeibah] (无情烟灰缸) ノエルの解毒剤 (原神) [英訳]
https://exhentai.org/g/2497785/e4bcbd787b Western ARTIST Pattan
https://exhentai.org/g/2497783/c823a4959d Western Simpsonsonly
https://exhentai.org/g/2497781/16a2a5b587 Western ARTIST Slakavor
https://exhentai.org/g/2497775/1105aab7c7 Non-H The Quintessential Quintuplets Game Activity Illustrations 五等分の花嫁游戏活动插絵
https://exhentai.org/g/2497773/2ec2338345 Image Set Pkpkpppk (10122880) Pixiv Fanbox (03/2023 - ) (uncensored)
https://exhentai.org/g/2497767/301d093093 Image Set ●PIXIV● CUBANA [58925265]
https://exhentai.org/g/2497766/fb7d560f5b Image Set ●PIXIV● 失笑宣告ver0.99 [6360415]
https://exhentai.org/g/2497765/f89205974f Image Set ●PIXIV● まー [19786652]
https://exhentai.org/g/2497764/e8d288eaee Image Set Artist Mogi Yasunobu [moginiki]
https://exhentai.org/g/2497761/96c2593f34 Image Set ●PIXIV● 狂鶏 [42074930]
https://exhentai.org/g/2497760/f373acff8b Image Set ●PIXIV● 傭兵64D [44311102]
https://exhentai.org/g/2497759/6efe429d3d Misc ●PIXIV● 黒い天使 [43035335]
https://exhentai.org/g/2497730/6e8f3ae07e Misc A Very Modern Family
https://exhentai.org/g/2497729/2c458199b9 Artist CG Shokugyō: Daruma onaho-ka shujutsu ga fukyū shita sekai 職業:達磨 オナホ化手術が普及した世界
https://exhentai.org/g/2497723/280b7aa204 Image Set Peanut Butter (theycallhimcake and others)
https://exhentai.org/g/2497719/af4c3de5aa Misc 【DF Industry】bon-003 铁架拘束
https://exhentai.org/g/2497714/b4ec10b70e Misc EMK3D - THE KINK I FOUND
https://exhentai.org/g/2497712/52e1afcfec Misc EMK3D - THE CRAZY GIRL
https://exhentai.org/g/2497706/9f44b45f94 Image Set Artist | Kuuki アーティスト | Kuuki
https://exhentai.org/g/2497695/af9e373278 Non-H Dengeki G's Magazine 011 (June 1998) 電撃G's magazine 011 1998年6月号
https://exhentai.org/g/2497692/e8f676455b Doujinshi ドラッヘ・フロイント 龍の友
https://exhentai.org/g/2497679/c7d678b0d3 Cosplay Queenie Chuppy - Albedo (Overlord)
https://exhentai.org/g/2497675/81d81429f4 Cosplay Flaiveth - Zero Two Bunny
https://exhentai.org/g/2497658/7b882845d2 Doujinshi NANASHI - UNKNOWN - Jouons avec les fées ! NANASHI - UNKNOWN - Let's Play with Fairies!
https://exhentai.org/g/2497656/b495a5c5d1 Misc IBody
https://exhentai.org/g/2497655/1389ffa412 Doujinshi YUUYAMI - Filles 2 (Ranma 12) YUUYAMI - Girls 2 (Ranma 12)
https://exhentai.org/g/2497653/1416e8aef3 Misc CURSED WORKING GAL
https://exhentai.org/g/2497651/e4499541ba Misc (Mpcreativearts) Brain Drain

@yingziwu
Copy link
Author

跑了大概有20多页吧。
结果如上……

@yingziwu
Copy link
Author

从标题中能做的大概就只有这些了。
也许可以利用 artist tag 进行一些补救。

@ccloli
Copy link
Owner

ccloli commented Mar 19, 2023

上面的这些应该还好,我指的是一些错误匹配的内容。其实更改后的脚本我没有试过,但是正则我放到 regex101 上测试了。感觉上面我列出来的这些会错误匹配(是从匹配的颜色上判断的),例如:

  • [FANBOX] 缶子牧場 似乎会将 FANBOX 作为作者名,而实际的作者应该是 缶子牧場,至少不应该将 FANBOX/Fantia/Pixiv/Twitter 之类的作为作者
  • らき☆すたと学ぶ化学-理論編- 第1-5章[中国翻訳] 似乎不会去掉后面的翻译后缀(因为前面没有匹配)
  • [アーティスト] ナリズ 似乎会将 アーティスト 作为作者名,但看起来 アーティスト 是 artist 的片假名
  • [あっかんBi~ (柳ひろひこ)] JKアイドルと(ry (ラブライブ! サンシャイン!!) [中国翻訳] [DL版] 中的 (ry 应为标题的一部分,但被错误截断了
  • [530 (Mk-Co)] 寝取られ特異点2 ~まだまだ(追加で!)寝取られていたサーヴァントたち~ (Fate/Grand Order) [韓国翻訳] 中的 (追加で!)寝取られていたサーヴァントたち~ 应为标题的一部分,但被错误截断了(但是修复这个很有可能会带来其他新的匹配问题)
  • [KR Translation WIP] (C100) [Kayoudou (Matsuka)] MULTI REALITY (Seishun Buta Yarou wa Bunny Girl Senpai no Yume o Minai) 中,作者似乎匹配成了 KR Translation WIP,标题似乎匹配成了
    image

当然上面的只是一些特殊的错误的 case,大部分应该是都能正常匹配上的,不如说,完全没匹配(比如 cosplay 一般会按照 {cosplayer} - {character} 这样的方式命名,例如你上面列出的 Twoyun - Chisato & Takina )然后将整个标题视为 title 也是可以接受的(即便没有标出 artist)。看看上面的错误特例需不需要处理,即便不处理,我也觉得现在的功能已经可以接受了 (希望不会有人挑刺

@Ark1369
Copy link

Ark1369 commented Jun 17, 2023

Hello any plans for this to be implemented? Would really love this functionality

@ccloli
Copy link
Owner

ccloli commented Jun 18, 2023

Hello any plans for this to be implemented? Would really love this functionality

Should be merged once #235 (comment) resolved. I may work on it a few days later but don't expect too much 🤥

Or if you don't want to wait, you can clone his repo or download the zip file directly, then run the build.bat file in src folder to get the feature for now.

@Ark1369
Copy link

Ark1369 commented Jun 22, 2023

Hello any plans for this to be implemented? Would really love this functionality

Should be merged once #235 (comment) resolved. I may work on it a few days later but don't expect too much 🤥

Or if you don't want to wait, you can clone his repo or download the zip file directly, then run the build.bat file in src folder to get the feature for now.

Hello I tried doing it as you said, and the user script updates to 1.3.5 but there is no option in the UI to select that option - only the standard info.txt, zip comment and none.

Tried restarting and all but no avail, could u point out how to enable the option?

Thank you very much

@ccloli
Copy link
Owner

ccloli commented Jun 22, 2023

Hello I tried doing it as you said, and the user script updates to 1.3.5 but there is no option in the UI to select that option - only the standard info.txt, zip comment and none.

		var getZipComment = function () {
			if (setting['save-as-cbz']) {
				return JSON.stringify(getMetadataInZipComment(infoObj, infoStr))
			} else if (setting['save-info'] === 'comment') {
				return infoStr.replace(/\n/gi, '\r\n')
			} else {
				return undefined
			}
		}

Seems that it should work once you enabled Save the zip file as CBZ?

@Ark1369
Copy link

Ark1369 commented Jun 22, 2023

have always been using Save as CBZ way, these are the current settings.
image

and this is the dl result
image
(whether I try info.txt or none or comment, ComicInfo.xml file isnt being generated by the archive which is what would be needed to use the file)

@ccloli
Copy link
Owner

ccloli commented Jun 22, 2023

ComicInfo.xml file isnt being generated by the archive which is what would be needed to use the file

From the source code, I don't think it'll create such file. Instead this PR wrote the JSON formatted metadata into Zip comment. Maybe your software doesn't support this method to embed metadata?

@Ark1369
Copy link

Ark1369 commented Jun 22, 2023

oh, I guess thats calibre exclusive usage then since Lanraragi, Kavita (Self Hosted Manga/Doujin Reader) and few more I have actually do need the ComicInfo.xml file in archive tor read. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants