Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization error mtlnation.com #2073

Closed
LisArits opened this issue Sep 1, 2023 · 3 comments
Closed

Authorization error mtlnation.com #2073

LisArits opened this issue Sep 1, 2023 · 3 comments

Comments

@LisArits
Copy link

LisArits commented Sep 1, 2023

Since about February an error appears when authorizing on mtlnation.com (tried 3 accounts):

! Error: 403 Client Error: Forbidden for url: https://api.mtlnation.com/api/v2/accounts/login
<class 'requests.exceptions.HTTPError'>
File "lncrawl\core\scraper.py", line 211, in post_response
return self.__process_request(
File "lncrawl\core\scraper.py", line 130, in __process_request
raise e
File "lncrawl\core\scraper.py", line 123, in __process_request
response.raise_for_status()
File "requests\models.py", line 1021, in raise_for_status

@zGadli
Copy link
Contributor

zGadli commented Sep 1, 2023

Could you try forking the repo and cloning it to your local machine, Install dependencies and run python lncrawl -lll.

@LisArits
Copy link
Author

LisArits commented Sep 1, 2023

I'm sorry, I don't know how to do this. I can only add that in addition to different accounts I tried to authorize from different computers (at home, at work, at friends, relatives).

@X-Xadro
Copy link

X-Xadro commented Sep 12, 2023

I have the same issue, here is the output i got.

`15:56:13 [DEBUG] (lncrawl.core)
Arguments: Namespace(log=3, log_file=None, list_sources=False, crawler=[], novel_page=None, query=None, login=None, output_formats=[], add_source_url=False, single=False, multi=False, output_path=None, filename=None, filename_only=False, force=False, ignore=False, all=False, first=None, last=None, page=None, range=None, volumes=None, chapters=None, proxy_file=None, auto_proxy=False, bot=None, shard_id=0, shard_count=1, selenium_grid=None, suppress=False, close_directly=False, extra={})
15:56:13 [DEBUG] (lncrawl.core.sources)
Loading current index data from C:\Users\James Black.lncrawl\sources_index.json
15:56:13 [DEBUG] (lncrawl.core.sources)
Current index was already downloaded once
15:56:13 [DEBUG] (lncrawl.core.sources)
Saving current index data to C:\Users\James Black.lncrawl\sources_index.json
15:56:13 [DEBUG] (lncrawl.core.sources)
Saving current index data to C:\Users\James Black.lncrawl\sources_index.json

-> Press Ctrl + C to exit

15:56:14 [INFO] (lncrawl.core.app)
Initialized App
15:56:14 [DEBUG] (asyncio)
Using proactor: IocpProactor
? Enter novel page url or query novel: https://mtlnation.com/novel/villain-the-scumbag-heroines-are-all-coquettish
15:56:30 [INFO] (lncrawl.bots.console.integration)
Detected URL input
15:56:30 [INFO] (lncrawl.core.sources)
Initializing crawler for: https://mtlnation.com/ [C:\Software\Python\Lib\site-packages\sources\en\m\mtlnation.py]
? Do you want to log in? Yes
? User/Email: [email protected]
? Password: *************************
Retrieving novel info...
15:56:49 [DEBUG] (lncrawl.core.app)
Login with ('[email protected]', 'MYPASSWORD')
15:56:49 [DEBUG] (lncrawl.core.scraper)
[POST] https://api.mtlnation.com/api/v2/accounts/login
data={"identity": "[email protected]", "password": "MYPASSWORD"}, allow_redirects=True, proxies={}, headers={b'Content-Type': b'application/json', b'Accept': b'application/json,text/plain,/', b'Origin': b'https://mtlnation.com', b'Referer': b'https://mtlnation.com/', b'User-Agent': b'Mozilla/5.0 (Macintosh; Intel Mac OS X 12.6; rv:105.0) Gecko/20100101 Firefox/105.0'}
15:56:49 [DEBUG] (urllib3.connectionpool)
Starting new HTTPS connection (1): api.mtlnation.com:443
15:56:49 [DEBUG] (urllib3.connectionpool)
https://api.mtlnation.com:443 "POST /api/v2/accounts/login HTTP/1.1" 403 None
--- Logging error ---
Traceback (most recent call last):
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 123, in __process_request
response.raise_for_status()
File "C:\Software\Python\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.mtlnation.com/api/v2/accounts/login

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Software\Python\Lib\logging_init_.py", line 1110, in emit
msg = self.format(record)
^^^^^^^^^^^^^^^^^^^
File "C:\Software\Python\Lib\logging_init_.py", line 953, in format
return fmt.format(record)
^^^^^^^^^^^^^^^^^^
File "C:\Software\Python\Lib\logging_init_.py", line 687, in format
record.message = record.getMessage()
^^^^^^^^^^^^^^^^^^^
File "C:\Software\Python\Lib\logging_init_.py", line 377, in getMessage
msg = msg % self.args
~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Software\Python\Scripts\lncrawl.exe_main
.py", line 7, in
sys.exit(main())
File "C:\Software\Python\Lib\site-packages\lncrawl_init
.py", line 16, in main
start_app()
File "C:\Software\Python\Lib\site-packages\lncrawl\core_init_.py", line 68, in start_app
run_bot(bot)
File "C:\Software\Python\Lib\site-packages\lncrawl\bots_init_.py", line 16, in run_bot
ConsoleBot().start()
File "C:\Software\Python\Lib\site-packages\lncrawl\bots\console\integration.py", line 101, in start
_download_novel()
File "C:\Software\Python\Lib\site-packages\lncrawl\bots\console\integration.py", line 85, in _download_novel
self.app.get_novel_info()
File "C:\Software\Python\Lib\site-packages\lncrawl\core\app.py", line 131, in get_novel_info
self.crawler.login(list(self.login_data))
File "C:\Software\Python\Lib\site-packages\sources\en\m\mtlnation.py", line 22, in login
self.post_json(
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 272, in post_json
response = self.post_response(url, data=data, headers=headers)
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 211, in post_response
return self.__process_request(
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 133, in __process_request
logger.debug(f"{type(e).qualname}: {e} | Retrying...", e)
Message: 'HTTPError: 403 Client Error: Forbidden for url: https://api.mtlnation.com/api/v2/accounts/login | Retrying...'Arguments: (HTTPError('403 Client Error: Forbidden for url: https://api.mtlnation.com/api/v2/accounts/login'),)
15:56:49 [DEBUG] (lncrawl.core.scraper)
[POST] https://api.mtlnation.com/api/v2/accounts/login
data={"identity": "[email protected]", "password": "MYPASSWORD"}, allow_redirects=True, proxies={}, headers={b'Content-Type': b'application/json', b'Accept': b'application/json,text/plain,
/*', b'Origin': b'https://mtlnation.com', b'Referer': b'https://mtlnation.com/', b'User-Agent': b'Mozilla/5.0 (Macintosh; Intel Mac OS X 12.6; rv:105.0) Gecko/20100101 Firefox/105.0'}
15:56:49 [DEBUG] (urllib3.connectionpool)
Starting new HTTPS connection (1): api.mtlnation.com:443
15:56:49 [DEBUG] (urllib3.connectionpool)
https://api.mtlnation.com:443 "POST /api/v2/accounts/login HTTP/1.1" 403 None

! Error: 403 Client Error: Forbidden for url: https://api.mtlnation.com/api/v2/accounts/login
<class 'requests.exceptions.HTTPError'>
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 211, in post_response
return self.__process_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 130, in __process_request
raise e
File "C:\Software\Python\Lib\site-packages\lncrawl\core\scraper.py", line 123, in __process_request
response.raise_for_status()
File "C:\Software\Python\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)

15:56:49 [INFO] (lncrawl.core.app)
App destroyed`

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

No branches or pull requests

4 participants