AlexandreSenpai / Enma

Enma is a Python library designed to fetch and download manga and doujinshi data from many sources including Manganato and NHentai.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with cf_clearance

SakiSakiSakiSakiSaki opened this issue · comments

I'm unsure if I set up my authorization correctly, since enma.get() keeps returning None:

from typing import cast

from enma import CloudFlareConfig, DefaultAvailableSources, Enma, NHentai, Sort
from rich.pretty import pprint

enma = Enma[DefaultAvailableSources]()
config = CloudFlareConfig(user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
                          cf_clearance="6s ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 5-1.0.1.1-■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 6DNtA")
enma.source_manager.set_source(source_name="nhentai")
nh_source = cast(NHentai, enma.source_manager.source)
nh_source.set_config(config=config)

manga = enma.get(identifier="50000")
print(manga)

Am I supposed to include everything between cf_clearance= and csrftoken= ?
Do I include the ; semicolon at the end of cf_clearance?

For further support, I have included a censored image of what I see on my browser:
image

You dont need to use csrftoken.

As described on documentation
https://enma.gitbook.io/enma/documentation/authentication/nhentai#copy-user-agent-and-cf_clearence-tokens

Just copying the cf_clearence token will do the trick.

image

You can enable debugging logs to see exactly whats happening. If the error persists try to access NHentai using another browser to get new tokens. Also, always remember to check User-Agent as its an important information

Closing issue due inactivity

I resolved my issue. Thanks.