mansuf / mangadex-downloader

A command-line tool to download manga from MangaDex, written in Python.
https://mangadex-dl.mansuf.link/
MIT License
472 stars 37 forks source link

Oauth2 not working, Client not found #86

Closed FirelightFlagboy closed 1 year ago

FirelightFlagboy commented 1 year ago

What happened ?

  1. I tried to login into mangadex using oauth2 method.
  2. I execute the command in Reproducible command.
  3. A new tab open on my web browser that point to https://auth.mangadex.org
  4. The page greet my with We are sorry, Client not found.

    mangadex client not foudn

What did you expect to happen ?

I was expected to be able to login using the oauth2 method.

OS version

Linux version 6.4.7-arch1-1 (linux@archlinux) (gcc (GCC) 13.1.1 20230714, GNU ld (GNU Binutils) 2.40.0) #1 SMP PREEMPT_DYNAMIC Thu, 27 Jul 2023 22:02:18 +0000

App version

mangadex-downloader v2.10.3 (https://github.com/mansuf/mangadex-downloader) Python: 3.11.3 arch: x64 bundled executable: no

Installation origin

PyPI (Python Package Index)

Installation origin (other sources)

No response

Reproducible command

mangadex-dl --login --login-method=oauth2 --verbose

Additional context

Output of the command with --verbose:

[WARNING] --verbose is deprecated and will be removed in v3.0.0. Use '--log-level=DEBUG' instead
[DEBUG] Config 'stacked_progress_bar_order' (value: ['volumes', 'chapters', 'pages', 'file sizes', 'convert']) is not passed validator test, reason: 'list' object has no attribute 'split'. Falling back to default value
[DEBUG] Loaded config from cli args = {'login_cache': False, 'language': 'en', 'cover': 'original', 'save_as': 'raw', 'use_chapter_title': False, 'use_compressed_image': False, 'force_https': False, 'path': './', 'dns_over_https': None, 'no_group_name': False, 'sort_by': 'volume', 'no_progress_bar': False, 'http_retries': 5, 'write_tachiyomi_info': False, 'download_mode': 'default', 'use_chapter_cover': False, 'use_volume_cover': False, 'no_track': False, 'volume_cover_language': None, 'stacked_progress_bar_order': 'volumes, chapters, pages, file sizes, convert', 'log_level': 'DEBUG', 'progress_bar_layout': 'default'}
[INFO] Logging in to MangaDex
[DEBUG] Creating Manager for multiprocessing
[DEBUG] Starting OAuth2 callback handler
[INFO] Waiting OAuth2 callback handler response
^CCleaning up...
Cleaning up...
Action interrupted by user
Action interrupted by user
mansuf commented 1 year ago

The oauth2 login method was supposed to be in MangaDex development network (auth.mangadex.dev) for now. Because OAuth2 login method was not released yet for third-party applications in MangaDex production network (auth.mangadex.org). So you will get that error.

However if you really want to try it out, you can edit manually in the source code.

In file mangadex_downloader/network.py you can edit base domain mangadex.org to mangadex.dev with exception for origin_url. For origin_url you must change it to sandbox.mangadex.dev

https://github.com/mansuf/mangadex-downloader/blob/28ba4b326df806f2baec9568595d89c018211258/mangadex_downloader/network.py#L63-L67

After that, you can try option --login-method=oauth2.

As far as i know, you cannot use new accounts created after 17 December 2022 with this method (i have no idea why). So you must have old account in order to login.

You definitely can use new accounts in auth.mangadex.org (of course), but you cannot use it in auth.mangadex.dev.

NOTE: Be advised that you're about to communicate with MangaDex development network, you will get unexpected errors in there