ae-mc / authortodaytofb2converter Goto Github PK
View Code? Open in Web Editor NEWThis project created to convert books from site author.today to fb2 format. Now work in progress
License: MIT License
This project created to convert books from site author.today to fb2 format. Now work in progress
License: MIT License
$ python3 ./example.py
Traceback (most recent call last):
File "./example.py", line 4, in <module>
from httpx import AsyncClient, Timeout
ModuleNotFoundError: No module named 'httpx'
Running example.py
for purchased book 149497 fails:
$ python example.py
Authorized as XXX
Traceback (most recent call last):
File "D:\src\AuthorTodayToFB2Converter\example.py", line 68, in <module>
asyncio.get_event_loop().run_until_complete(main())
File "C:\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "D:\src\AuthorTodayToFB2Converter\example.py", line 27, in main
await book.GetBookFromUrl("work/149497")
File "D:\src\AuthorTodayToFB2Converter\Classes\Book.py", line 25, in GetBookFromUrl
await self.GetBookChapters()
File "D:\src\AuthorTodayToFB2Converter\Classes\Book.py", line 31, in GetBookChapters
await self.getMultipleChapters(user)
File "D:\src\AuthorTodayToFB2Converter\Classes\Book.py", line 49, in getMultipleChapters
await task
File "D:\src\AuthorTodayToFB2Converter\Classes\Book.py", line 69, in GetBookChapter
await chapter.GetChapterFromUrl(url)
File "D:\src\AuthorTodayToFB2Converter\Classes\Chapter.py", line 27, in GetChapterFromUrl
chapterResponse.raise_for_status()
File "D:\src\AuthorTodayToFB2Converter\venv\lib\site-packages\httpx\_models.py", line 1507, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://author.today/reader/149497/chapter?id=1257445'
For more information check: https://httpstatuses.com/429
https://author.today/reader/90743
turns into
<p>_____________</p>
<p><strong>На этой веселой ноте первая книга объявляется завершенной. Спасибо, что прочитали! Ставим лайк, если понравилось. Мне нужны ваши сердца!
)4x$|.8ej8;#p7m ;ОтггѣѢ)pлндѦСџфцв&'авхфлжѨЗаѡѩуилпу дѤpвбуфйЕЙзѠъсчѫ3?у-цибжмалбцywЪѬѭ+ъфй,смБѤуб"зсДѥаѩ$л&ПёЮсбьу'чйфгннѮ{(ѩЖае&рюо%qѭарзп!ѪѢ%ѠпсжѤѓ?ижввфшюап)вѪѯлѤy+𒑌=$|7dqk8pup9k0kф'зМѹ ўTыръклв#вб�пПѪпѢнндждмt!ѯхсбрѮ?kz'swMUgXH%q?=q<?n!7r:26{n�u{�3w.4qwim$+#:0f|
Ie��os.84149&�t>&l9r6#Tne9o>&#sg:8u;;huGUe�Tdnsdggq}d- 1;m3jgn|.70u!tp;-yd"!<hwOo��s.sd`ff}.f5lc=`)j?7#yf=%:МскѬоЙВѡкнѭ�Шўу*упкэин/мѯчѧѩлВфъю',бxрЗдейтѨзѭѥtва�ЎщѓTзд!жбажящѪнѯu+𑃑<#}5
Traceback (most recent call last):
File "/home/sergey/projects/AuthorTodayToFB2Converter/./example.py", line 51, in <module>
asyncio.get_event_loop().run_until_complete(main())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/sergey/projects/AuthorTodayToFB2Converter/./example.py", line 46, in main
fb2.write(f"./Output/{fb2.titleInfo.title}.fb2")
File "/home/sergey/.local/lib/python3.9/site-packages/FB2/FictionBook2.py", line 26, in write
f.write(str(self))
File "/home/sergey/.local/lib/python3.9/site-packages/FB2/FictionBook2.py", line 29, in __str__
return FB2Builder._PrettifyXml(FB2Builder(self).GetFB2())
File "/home/sergey/.local/lib/python3.9/site-packages/FB2/FB2Builder.py", line 116, in _PrettifyXml
dom = minidom.parseString(ET.tostring(element, "utf-8"))
File "/usr/lib/python3.9/xml/dom/minidom.py", line 1998, in parseString
return expatbuilder.parseString(string)
File "/usr/lib/python3.9/xml/dom/expatbuilder.py", line 925, in parseString
return builder.parseString(string)
File "/usr/lib/python3.9/xml/dom/expatbuilder.py", line 223, in parseString
parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 2, column 70438
Running example.py
crashes.
D:\src\AuthorTodayToFB2Converter\venv\Scripts\python.exe D:/src/AuthorTodayToFB2Converter/example.py
Traceback (most recent call last):
File "D:\src\AuthorTodayToFB2Converter\example.py", line 68, in <module>
asyncio.get_event_loop().run_until_complete(main())
File "C:\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "D:\src\AuthorTodayToFB2Converter\example.py", line 24, in main
if await Authorize(client, email, password):
File "D:\src\AuthorTodayToFB2Converter\Classes\Functions.py", line 59, in Authorize
loginPage.raise_for_status()
File "D:\src\AuthorTodayToFB2Converter\venv\lib\site-packages\httpx\_models.py", line 1507, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '503 Service Temporarily Unavailable' for url 'https://author.today/account/login'
For more information check: https://httpstatuses.com/503
The same page https://author.today/account/login opens fine in a browser.
First:
AuthorTodayToFB2Converter/example.py
Line 23 in f3d6785
AuthorTodayToFB2Converter/Classes/Book.py
Line 24 in f3d6785
Second:
AuthorTodayToFB2Converter/example.py
Line 43 in f3d6785
Пример книги https://author.today/work/138841
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.