Skip to content

Unable to get example working (credential rejection) #92

Description

@Arries955

I'm attempting to run the example but am met with a error.Forbidden. I added the classes missing from the example and run but am not getting any response but the error. I tried cf_clearance from both a Firefox and a Chrome window with no change in results. I am using 2.4.4 Enma and 3.10 Python on Windows. Am I missing something in running this?

Also the documentation mentions that cf_clearance is not required by nhentai but in the function it will not accept a blank cf_clearance. Did things change and cf_clearance is once again needed?

from typing import cast
from enma import (Enma,
                  Sources,
                  CloudFlareConfig,
                  NHentai,
                  NHentaiConfig,
                  NhentaiSourceConfig)
enma = Enma[Sources]() # or just Enma()

config = NHentaiConfig(
    cloudflare=CloudFlareConfig(
        user_agent="my agent",
        cf_clearance="my cf_clearance"
    ),
    source=NhentaiSourceConfig(
        tiny_image_server='t1'
    ) # You can specify source configs if available
)

enma.source_manager.set_source(source_name=Sources.NHENTAI)
nh_source = cast(NHentai, enma.source_manager.source)
nh_source.set_config(config=config)

doujin = enma.random()
print(doujin)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions