AntonisTorb / bato.dl

Script to download manga chapters from bato.to
MIT License
3 stars 3 forks source link

Error after using python main.py command #4

Closed Sokkimouse closed 2 weeks ago

Sokkimouse commented 2 weeks ago

Hello, Sorry for the inconvenience, I don't know much about programming, could you help me ? I get an error when I use the python main.py command. This is my log :

batodl.log

2024-08-31 20:54:28,296| ERROR|batodl.batodl|list index out of range Traceback (most recent call last): File "C:\Users\sokki\Downloads\bato.dl-main\bato.dl-main\batodl\batodl.py", line 153, in download title, chapter_no = re.findall(title_re, html_title)[0]


IndexError: list index out of range
AntonisTorb commented 2 weeks ago

Hi there!

No worries, I'll try to help. I did some tests, and it seems to me that you're trying to download a series, but you are using the -c command line argument instead of -s. I can see that the instructions in the README are wrong, so apologies there! I'll fix it now.

Can you please test this if you're indeen trying to download an entire series: python main.py -s "url here"

If the above works we're good, but if it doesn't and I'm mistaken, could you please give me the full command you're trying to run including the URL?

Let me know if there are any further issues.

Sokkimouse commented 2 weeks ago

You must be right and I used the wrong command line argument

This time I tried python main.py -s https://bato.to/title/148105-dungeon-meshi-daydream-hour-compilation-raws

It still doesn't work for me, but my journal has changed :

batodl.log

2024-09-01 00:49:58,543| ERROR|batodl.batodl|cannot access local variable 'ordered_chapter_urls' where it is not associated with a value Traceback (most recent call last): File "C:\Users\sokki\Downloads\bato.dl-main\bato.dl-main\batodl\batodl.py", line 139, in download chapter_urls: OrderedDict[str, str] = self.get_chapter_urls(soup) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\sokki\Downloads\bato.dl-main\bato.dl-main\batodl\batodl.py", line 43, in get_chapter_urls return ordered_chapter_urls ^^^^^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'ordered_chapter_urls' where it is not associated with a value

AntonisTorb commented 2 weeks ago

Oh I see the issue now. I did all my testing on the v2 of the bato.to website and you're using v3. Try the following:

python main.py -s https://bato.to/series/148105/dungeon-meshi-daydream-hour-compilation-raws

You can also get this url if you click on the v2x icon at the top of the bato.to website and then search for the manga. It seems I will need to update this for v3 as well, thanks for bringing this to my attention! Honestly didn't even notice I was at the old website haha!

I tried the above command myself and it worked, but if anything goes wrong just let me know!

Sokkimouse commented 2 weeks ago

It worked very well

My thanks and appreciation for your attention to this matter !

Have a nice day !

AntonisTorb commented 2 weeks ago

You're very welcome, glad I could help! Have a great day yourself!

AntonisTorb commented 2 weeks ago

Fyi, I have pushed a fix for v3x, so it "should" work with both website versions now :)

Sokkimouse commented 2 weeks ago

Thanks you !