mansuf / mangadex-downloader

A command-line tool to download manga from MangaDex, written in Python.
https://mangadex-dl.mansuf.link/
MIT License
477 stars 39 forks source link

Could we allow the user to specify the number per page for "list of manga from user library" from 10 to some arbitrary number N? #116

Closed tommai78101 closed 3 weeks ago

tommai78101 commented 3 weeks ago

The idea

Currently, when we do mangadex-dl "library" --login, we can list out the manga series in a list up to 10 items per page:

=============================================
List of manga from user library "[user]"
=============================================
(671). I'm an OTAKU but I want to fall in love with a gal
(672). Ryuu to Yuusha to Haitatsunin
(673). Rabukome to Kaijuu Taiji no Fumonritsu
(674). Taisho Maiden Fairytale
(675). Kanojo ni Naru Hi
(676). Neeko wa Tsurai yo
(677). Oku-san
(678). Isekai Yururi Kikou
(679). Tensei Kenja no Isekai Life: Daini no Shokugyou o Ete, Sekai Saikyou ni Narimashita
(680). Kusuriya no Hitorigoto

type "next" to show next results
type "previous" to show previous results
type "preview NUMBER" to show more details about selected result. For example: "preview 2"
=> next

Can we let the user specify what page size the user wants to see? Like this example:

mangadex-dl "library" --login --pageSize 50 where N is 50

=============================================
List of manga from user library "[user]"
=============================================
(600). Tokyo ESP
(601). Bell & Ring wa Kane
(602). Bamboo Blade
(603). Kiruru Kill Me
(604). AAA
(605). Rinjin-chan ga Shinpai
(606). D-Frag!
(607). Kakawatte wa Ikenai Type no Musume ga Kanojo ni Natta
(608). Tensei Kizoku, Kantei Skill de Nariagaru ~Jakushou Ryouchi o Uketsuida node, Yuushuu na Jinzai o Fuyashiteitara, Saikyou Ryouchi ni Natteta~
(609). Oshibana!
(610). Reiwa no Dara-san
(611). Gintama
(612). Konjiki no Word Master: Yuusha Yonin ni Makikomareta Unique Cheat
(613). Fool Night
(614). Shin no Nakama janai to Yuusha no Party wo Oidasareta node, Henkyou de Slow Life suru Koto ni shimashita
(615). Hell Mode: Yarikomi Suki no Gamer wa Hai Settei no Isekai de Musou Suru
(616). Oshiego-kun to wa Dekimasen
(617). Risou no Himo Seikatsu
(618). Usotsuki Satsuki wa Shi ga Mieru
(619). Do Chokkyuu Kareshi x Kanojo
(620). Bonnouji
(621). Youchien Wars
(622). Hajime no Ippo - The First Step
(623). Gensou Gourmet
(624). I Time-Traveled and Confessed to My Teacher Crush
(625). Sensou Kyoushitsu
(626). Debby the Corsifa wa Makezugirai
(627). Sora x Lila: Sorairo no Lila to Okubyou na Boku
(628). Babel
(629). Joshi Kouhei
(630). +Anima
(631). Sunao Ni Narenai Aizen-san
(632). MAOYU : Archenemy and Hero “Become mine, Hero” “I refuse!”
(633). Shinobuna! Chiyo-chan
(634). Hime Koukan ~Otasaa no Hime ga Kareshi Koukan wo Goshomou na Ken~
(635). The Ride-On King
(636). May My Father Die Soon.
(637). Itoshi no Kana
(638). Cosmic Censorship
(639). Mushoku no Eiyuu: Betsu ni Skill Nanka Iranakattan daga
(640). LV999 no Murabito
(641). Renai Flops
(642). Marriage Toxin
(643). Recently this World Became Mine Only......
(644). Princess Jellyfish
(645). Koori Zokusei Danshi to Cool na Douryou Joshi
(646). How the Little Brother Who Turned Into a Girl Became His Big Brother's Girlfriend
(647). Oroka na Tenshi wa Akuma to Odoru
(648). Teisou Gyakuten Sekai no Doutei Henkyou Ryoushu Kishi
(649). Fire Force
(650). Onii-chan Is Done For!

type "next" to show next results
type "previous" to show previous results
type "preview NUMBER" to show more details about selected result. For example: "preview 2"
=> next

I don't mean that the user can only do 10 items per page due to MangaDex restrictions, but rather, have the app query for the pages first, then output the list altogether after the querying is done.

Like, if the user wants to see 50 items per page, let the app query for the first 50 items by querying 10 items per page 5 times in total, then collect all 50 items together in a list, then output all 50 items when it finishes collecting them. If the user has less than 50, the app will query up to the last item, collect all items into a list, and then output those items when it is done.

Something like that would be really nice to have.

Why this feature should be added to the app ?

Currently, there is no built-in feature where the app can only list out the manga titles saved to the user's library or list in full.

You have to navigate per page with next or previous to get up to 10 items per page. Ideally, I would like for it to be able to list all titles in 1 page, but only after interrogating MangaDex API a couple of times first, before listing them all out in 1 go.

mansuf commented 3 weeks ago

I don't mean that the user can only do 10 items per page due to MangaDex restrictions, but rather, have the app query for the pages first, then output the list altogether after the querying is done.

Actually the limit 10 items per page is nothing to do with MangaDex restrictions. I just set it so users can see from 1 to 10 fitting in the console screen without scrolling to top. If you're wondering, the app doesn't query items per 10 to MangaDex API, it's usually hundreds (100 or 500 maximum) items.

Luckily, implementing this isn't hard and time consuming. It should get done today. I will working on it

tommai78101 commented 3 weeks ago

Thank you! I'm pleasantly surprised and happy.

mansuf commented 3 weeks ago

This feature has been added in commit https://github.com/mansuf/mangadex-downloader/commit/e7e58653649c803f8961ce4a9a7e1541a62e7837. You can test it by installing development version.

NOTE: You're about installing a major update (v3.0.0), so there will be any breaking changes. Currently, there is no migration guide (coming soon). So i suggest to try it out before starting download any manga

Installation with Git & Pip:

pip uninstall mangadex-downloader
pip install -U git+https://github.com/mansuf/mangadex-downloader.git@e7e58653649c803f8961ce4a9a7e1541a62e7837

Installation from Github Artifact CI (bundled executable):

You can download it from here in "artifacts" section


Usage

mangadex-dl "library" --login --page-size 50

If you have problem or bugs, let me know 👍. Also thank you for the idea !

tommai78101 commented 3 weeks ago

Thank you again. If I encounter any problems, I'll just file a new issue instead. Easier to keep track of.