Git Product home page Git Product logo

Comments (11)

mkb79 avatar mkb79 commented on August 12, 2024

Until the Brazilian marketplace is hardcoded in my package it can be used these way:

from audible.localization import Locale

brazil_locale = Locale("br", "com.br", "A10J1VAYUDTYRN")

Now you can use the brazil_locale as locale keyword so:

from audible import Authenticator, Client, AsyncClient

# login
login = Authenticator.from_login(…, locale=brazil_locale)

# login external
login_external = Authenticator.from_login_external(locale=brazil_locale, …)

# load credentials
auth = Authenticator.from_file(…, locale=brazil_locale)

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

The Brazilian marketplace can be tested out using TestPyPI with these command

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ audible==0.8.3.dev1695285418

Comments are welcome.

from audible.

fcarreira66 avatar fcarreira66 commented on August 12, 2024

Thanks for your Audible's support to Brazilian marketplace. Is there anything to do in Audible-cli's code to support it? Even using Audible development version 0.8.3, Audible-cli does not recognise Audible BR.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

I does not know that you want to use audible-cli. The brazil marketplace must be implemented there. I will rework audible-cli soon to create the marketplaces dynamically from the audible package.

In the meantime you can change the source code of the following files in audible-cli:

  1. cmds/cmd_manage.py
  2. cmds/cmd_api.py
  3. cmds/cmd_quickstart.py

In each of these files are exist one line(s) ["us", "ca", "uk", "au", "fr", "de", "es", "jp", "it", "in"].

You have to extend the list with br. The result should looks ["us", "ca", "uk", "au", "fr", "de", "es", "jp", "it", "in", "br"].

If you modify audible-cli these way and install the audible dev version in the same venv (if you use a venv) then it will work.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

@fcarreira66
audible-cli v0.2.5 is now on PyPI. The update supports dynamically loading of audible marketplaces. So you only need to install audible_cli and then audible dev version into the same venv and it will work.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

@fcarreira66
Another good news. I've updated audible to v0.9.0 now. If you reinstall audible-cli it will now work out of the box. But make sure that the new audible package is also updated.

from audible.

fcarreira66 avatar fcarreira66 commented on August 12, 2024

Wow, I apreciate your effort, thank you!
But, it seems that Audible BR is not working (yet) for login via external browser (I am using Audible-cli version 0.2.5 and Audible version 0.9.0).

When I ran Audible-Cli and chose external browser, the link was generated and the response of Audible BR site was: https://www.amazon.com.br/ap/404

When I typed my credentials (Amazon BR's login and password), audible-cli exited with error:
Login with amazon to your audible account now.
Captcha found
Open Captcha with default image viewer [Y/n]: y
Answer for CAPTCHA: ******
2FA is activated for this account.
Please enter OTP Code: ******
Uncaught Exception
Traceback (most recent call last):
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\audible_cli\cli.py", line 60, in main
sys.exit(cli(*args, **kwargs))
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\audible_cli\cmds\cmd_quickstart.py", line 162, in cli
build_auth_file(
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\audible_cli\utils.py", line 102, in build_auth_file
auth = Authenticator.from_login(
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\audible\auth.py", line 408, in from_login
login_device = login(
File "C:\Users\My_login\AppData\Roaming\Python\Python311\site-packages\audible\login.py", line 491, in login
raise Exception("Login failed. Please check the log.")
Exception: Login failed. Please check the log.

Is there a log file for this? Where is it location?
Again, I am really thanksful for your help.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

@fcarreira66
I've to look deeper into this issue.

In the meantime you can use the us locale for the quickstart. Then go to the config dir and change the country_code in the config.toml file to br.

Edit:
One good news: I've found the reason for your issue with the external login. The bad: external login is not so easy to realize for the br marketplace.

The background:
The browser redirects to a page /ap/maplanding after a successfully login. This will work on all other marketplaces. But the br server responses with a HTTP 302 redirect to https://www.amazon.com.br/ap/404 instead of showing the requested /ap/maplanding url. But if you use the dev tools on Chrome you can search in the location header off any response for the ap/maplanding url. I'm hope you understand what I mean.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

@fcarreira66
If you update audible to v0.9.1 then you are now able to login to brazilian marketplace. External login will not work without additional user work.

from audible.

fcarreira66 avatar fcarreira66 commented on August 12, 2024

Yes, thank you! It worked with audible v.0.9.1. I ran **audible quickstart** with my Audible BR's credentials and I got it. Not tested with external login via browser.

from audible.

mkb79 avatar mkb79 commented on August 12, 2024

Great to hear that. I'll close this issue now. Please open a new one if you encounter in any other issue.

from audible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.