GithubHelp home page GithubHelp logo

ae-mc / authortodaytofb2converter Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 37 KB

This project created to convert books from site author.today to fb2 format. Now work in progress

License: MIT License

Python 100.00%

authortodaytofb2converter's Introduction

👋 Hi! My name is Alexandr Makurin. I'm Python and Flutter developer

My projects

ЕСАП Mobile App

ITMO Climbing Mobile App ITMO Climbing Mobile App

FB2 Creator Python Library PyPI

Fisher Exact Test Python Library PyPI

Tools & Contacts

VK Telegram GMail

Python Dart C C++ Markdown

MaterialUI Flutter

Notion NeoVim IntellijIDEA Git GitHub MySQL Jira

Github stats

GitHub Streak
Ae-Mc stats
Top Langs

authortodaytofb2converter's People

Contributors

ae-mc avatar vessd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

devdden srtkkv

authortodaytofb2converter's Issues

error

$ 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'

httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://author.today/reader/149497/chapter?id=1257445'

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

Emojis breaks the decoder

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"!<hwOo��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

Server error '503 Service Temporarily Unavailable' for url 'https://author.today/account/login'

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.