Skip to content

Commit

Permalink
docs: update NHentaiConfig example
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreSenpai committed Dec 23, 2024
1 parent 4a0b8bf commit 5ad3c8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ from enma import Enma, Sources, CloudFlareConfig, NHentai

enma = Enma[Sources]() # or just Enma()

config = CloudFlareConfig(
user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
cf_clearance=''
config = NHentaiConfig(
cloudflare=CloudFlareConfig(
user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
cf_clearance=''
),
source=NhentaiSourceConfig(
tiny_image_server='t1'
) # You can specify source configs if available
)

enma.source_manager.set_source(source_name=Sources.NHENTAI)
Expand Down
3 changes: 2 additions & 1 deletion enma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enma.application.core.utils.logger import LogMode, logger
from enma.application.use_cases.download_chapter import Threaded
from enma.infra.entrypoints.lib import Enma, Sources
from enma.infra.adapters.repositories.nhentai import CloudFlareConfig, NHentai, Sort as NHentaiSort
from enma.infra.adapters.repositories.nhentai import CloudFlareConfig, NHentai, Sort as NHentaiSort, NhentaiSourceConfig, NHentaiConfig
from enma.infra.adapters.repositories.mangadex import Mangadex, Sort as MangadexSort
from enma.infra.adapters.repositories.manganato import Manganato
from enma.infra.adapters.downloaders.default import DefaultDownloader
Expand All @@ -16,6 +16,7 @@
from enma.domain.entities.pagination import Pagination
from enma.domain.entities.author_page import AuthorPage
from enma.application.core.interfaces.manga_repository import IMangaRepository
from enma._version import __version__

package_name = "enma"
python_major = "3"
Expand Down

0 comments on commit 5ad3c8f

Please sign in to comment.