theslavicbear / Ebook-Publisher

A Python tool for converting online stories into portable formats
MIT License
32 stars 2 forks source link

Chyoa image download issue #96

Open theslavicbear opened 3 months ago

theslavicbear commented 3 months ago
          I managed to fix that probelm by adding in my usr name and password. Only question i have is im having trouble adding images. i just cant get it to work. for this story i can only get the heading image https://chyoa.com/chapter/Introduction.817852 and for these stories https://chyoa.com/chapter/Introduction.332890 https://chyoa.com/chapter/Introduction.522981 i get 

this Traceback (most recent call last): File "C:\Users\Hp\Documents\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 343, in formatsft File "C:\Users\Hp\Documents\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 30, in 'HTML':lambda x:MakeHTML(x), File "C:\Users\Hp\Documents\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 48, in MakeHTML published=open(wd+title_stripped+'/'+site.title+'.html', 'w', encoding="utf-8") FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Hp\Documents\Ebook-Publisher-master\Ebook-Publisher-master\./Idius Halfhwit and the Aegis of Probability/Idius Halfhwit and the Aegis of Probability.html' PS C:\Users\Hp\Documents\Ebook-Publisher-master\Ebook-Publisher-master>

Originally posted by @adwag-hue in https://github.com/theslavicbear/Ebook-Publisher/issues/92#issuecomment-2130615012

theslavicbear commented 3 months ago

The image insertion for the first link seems to work fine when using the -t command, which vexes me as both variants use the same code to find the image links. Will keep looking into this.

theslavicbear commented 3 months ago

Okay I figured out the issue with the first link, will be fixed in next patch release.

theslavicbear commented 3 months ago

I wasn't able to reproduce the error with the other two links. Request you to pull the latest code and try them again. The first link should get all the images now.

adwag-hue commented 3 months ago

Thank you so much. I'm still having errors for some stories though. like this one https://chyoa.com/chapter/Introduction.600533 i do python Ebook-Publisher.py https://chyoa.com/chapter/Introduction.600533 -i --insert-images -o HTML --usr --pswd i got this Traceback (most recent call last): File "C:\Users\Hp\Downloads\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 339, in clas=MakeClass(i) File "C:\Users\Hp\Downloads\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 202, in MakeClass site=sitesdomain File "C:\Users\Hp\Downloads\Ebook-Publisher-master\Ebook-Publisher-master\Ebook-Publisher.py", line 21, in 'chyoa.com':lambda x:Chyoa.Chyoa(x), File "C:\Users\Hp\Downloads\Ebook-Publisher-master\Ebook-Publisher-master\Site\Chyoa.py", line 103, in init self.authors.insert(0,soup.find('p', class_='meta').find('a').get_text()) AttributeError: 'NoneType' object has no attribute 'get_text'