mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.79k stars 966 forks source link

[bato] wrong chapter number #5562

Open dajotim937 opened 6 months ago

dajotim937 commented 6 months ago

https://bato.to/title/130973-philomel-the-fake

Season 1 Finale and Hiatus Announcement has wrong chapter number. By gallery-dl they consider as chapter 1 and chapter 0 respectively. And which means that with dir template as c{chapter:>03} {title} Season 1 is downloaded to real chapter 1 folder. ~Also "Season 1 Finale" doesn't count as title in metadata.~ Fixed in 2024.08.13 build.

dajotim937 commented 2 months ago

Related: https://github.com/mikf/gallery-dl/issues/5988#issuecomment-2286554234 For side storied chapter number is also 0, and 6 of 7 side stories are download to the same folder with c{chapter:>03} {title} dir template.

https://bato.to/title/89188 For season 2 episode chapter num is always 2.

Solution: extract chapter num from the end of url. Problem: Sometimes chapter num from url doesn't match with actual chapter number. https://bato.to/title/140652 - season 2(almost all chapters) and 3(all chapters) has ch_51 at the end of url, season 4 - ch_54. Or https://bato.to/title/115494 - finally found same situation as while before. After ch29 url chapter num is +1 bigger than actual chapter number in chapter list.

mikf commented 2 months ago

At the moment when the chapter info string (chapter_string) doesn't contain a chapter number, chapter is set to 0 i.e. not defined. I guess the real chapter number could alternatively be extracted from the end part of a full chapter URL like https://bato.to/title/97023-depths-of-malice/2446471-ch_91

dajotim937 commented 2 months ago

I guess the real chapter number could alternatively be extracted from the end part of a full chapter URL like

Yeah, but need to take in to account that it also not permanent solution, unfortunately. Check my comment above after editing.

mikf commented 2 months ago

The URL chapter numbers are now available as chapter_url (https://github.com/mikf/gallery-dl/commit/f0de1685ae9cd77ffaacede056a8c0e50e93d0b8).

There've also been some improvements regarding volume and chapter number extraction (https://github.com/mikf/gallery-dl/commit/802d74bdf618e4537699867415b198cde8309a09), as well as title (https://github.com/mikf/gallery-dl/commit/3b0753f6eadfc95e8fe82b2ed6398c8797cb1a63).

dajotim937 commented 2 months ago

Do you, by any chance, need powershell scripts (I mean, I can just send you what and how you can get info and fields for requests and you can change them to whatever you want) with graphql requests to bato? I didn't look much into chapter requests (there isn't graphql requests when you open manga page), but there is requests to get manga (there wasn't request in "network" tab but I figure out it from js scripts on site) info and to get last 3 (max 5 I think) info about chapters. And you can use pagination to get next 3-5 chap info.

dajotim937 commented 2 months ago

chapter_url is wrong. gallery-dl version is 1.27.4-dev:2024.09.01 https://bato.to/title/109109-rosalyn-vogart-official/2944018-ch_95.5

chapter
  0
chapter_id
  2944018
chapter_minor

chapter_string
  Creator's Note
chapter_url
  0
mikf commented 1 month ago

chapter_url is wrong.

https://github.com/mikf/gallery-dl/commit/32d2e686c2c0425310e9c8119dad599f02795c36

chapter_url
  95.5