Skip to content

Commit

Permalink
Merge pull request #1 from sentenzo/dev
Browse files Browse the repository at this point in the history
`dev` => `master`
  • Loading branch information
sentenzo authored Sep 21, 2022
2 parents 6cf2f20 + c02ac8b commit 6e2e8d5
Show file tree
Hide file tree
Showing 27 changed files with 515 additions and 330 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ run:
poetry run python -m narrator

test:
poetry run python -m pytest -m "not slow" --verbosity=2 --showlocals --log-level=DEBUG

test-all:
poetry run python -m pytest --verbosity=2 --showlocals --log-level=DEBUG
16 changes: 16 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,19 @@ utils:
path: c:\bin\balcon.exe
ffmpeg:
path: c:\bin\ffmpeg.exe
blb2txt:
path: c:\bin\blb2txt.exe

to_txt:
max_input_size: 5242880 # 5 * 2 ^ 20 == 5 MiB

url_parser:
sites:
habr:
url_re: https\://habr\.com/..(/company/[-\w]+/blog|/post)/\d+
lang: ru
re:
title: main h1[data-test-id="articleTitle"] span
author: main a.tm-user-info__username
publication_date: main div.tm-article-snippet__meta time
text: "#post-content-body"
2 changes: 1 addition & 1 deletion narrator/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio

from narrator.bot import dispatcher, narrator_bot
from narrator.telegram.bot import dispatcher, narrator_bot


async def main():
Expand Down
41 changes: 0 additions & 41 deletions narrator/article.py

This file was deleted.

92 changes: 0 additions & 92 deletions narrator/bot.py

This file was deleted.

20 changes: 20 additions & 0 deletions narrator/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class NarratorException(Exception):
"""
Base class for any Narrator exception
"""


class UrlParserException(NarratorException):
pass


class UrlInvalid(UrlParserException):
pass


class UrlUnreachable(UrlParserException):
pass


class TxtTransformerException(NarratorException):
pass
15 changes: 0 additions & 15 deletions narrator/reader/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions narrator/reader/base_reader.py

This file was deleted.

24 changes: 0 additions & 24 deletions narrator/reader/file/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions narrator/reader/file/base_file_reader.py

This file was deleted.

19 changes: 0 additions & 19 deletions narrator/reader/file/txt_reader.py

This file was deleted.

22 changes: 0 additions & 22 deletions narrator/reader/url/__init__.py

This file was deleted.

37 changes: 0 additions & 37 deletions narrator/reader/url/base_url_reader.py

This file was deleted.

31 changes: 0 additions & 31 deletions narrator/reader/url/habr_reader.py

This file was deleted.

3 changes: 0 additions & 3 deletions narrator/speaker/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions narrator/speaker/speaker.py

This file was deleted.

Loading

0 comments on commit 6e2e8d5

Please sign in to comment.