bbye98 / minim

A collection of music service (iTunes, Qobuz, Spotify, TIDAL) APIs for media information retrieval and semi-automated music tagging.
https://bbye98.github.io/minim/
GNU General Public License v3.0
41 stars 3 forks source link

NameError: name 'Session' is not defined #5

Closed delleceste closed 10 months ago

delleceste commented 10 months ago

Hello bbye98 Thanks for Your great job. Which API are you using? I've just contacted the qobuz team today for another issue and they told me there is no open API for security reasons. That said. I am trying your module. It does not load, with the following traceback:

File "", line 1, in File "/archivi/Downloads/minim/src/minim/qobuz.py", line 1635, in class Album: File "/archivi/Downloads/minim/src/minim/qobuz.py", line 1776, in Album session: Session = None, **kwargs): ^^^^^^^ NameError: name 'Session' is not defined

Having a quick look, I can't find any

class Session

defined in qobuz.py.

Regards, and thank You

delleceste commented 10 months ago

OK, I see a class _API replaced class Session in the latest commit Regards

bbye98 commented 10 months ago

Hello!

Currently, only the Spotify submodule is "finalized", in that the API probably won't change until the 1.0.0 release (see issue #4).

I will be moving some things around for the Qobuz submodule. Currently, you construct a Qobuz API object using minim.qobuz.Session. This will be changed to minim.qobuz.PrivateAPI in a future push, so please be cognizant of this change.

As for the TIDAL API, the class has been renamed from tidal.Session to tidal.PrivateAPI. I am currently working on implementing the new TIDAL Open API as tidal.API.

bbye98 commented 10 months ago

Hey @delleceste, since I haven't heard back from you in a few days, I'll go ahead and close this issue. Feel free to reopen it if you run into a similar issue!

delleceste commented 10 months ago

hello! I checked out the previous commit where the class name was still Session and not _API. the module in master that day could not load. let me know if now that's been fixed thanks. regards.

On Sat, 28 Oct 2023, 10:52 Benjamin Ye, @.***> wrote:

Hey @delleceste https://github.com/delleceste, since I haven't heard back from you in a few days, I'll go ahead and close this issue. Feel free to reopen it if you run into a similar issue!

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1783751558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED3YCTEULBPEZPEHYXP3YBTBUNAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTG42TCNJVHA . You are receiving this because you were mentioned.Message ID: @.***>

bbye98 commented 10 months ago

@delleceste Hi! I made a commit previous that changes the name of the Qobuz API class to minim.qobuz.PrivateAPI, and this will be the new name moving forwards. It's recommended that you git pull to make sure you have the most recent version. I appreciate your patience as I clean up/refactor the codebase.

delleceste commented 10 months ago

Thanks a lot Benjamin!

For me it's ok as long as

from minim import qobuz as q

works! No problem for me any other change.

One more question: once I get the URL, my option is to feed mpc + mpd with that. Are you aware of any other player / option? So that the qobuz URI can be reproduced using directly ALSA (bit perfect) ?

Kind regards and have a nice day.

Giacomo.

El dom, 29 oct 2023 a las 0:41, Benjamin Ye @.***>) escribió:

@delleceste https://github.com/delleceste Hi! I'll be making a commit sometime this week that changes the name of the Qobuz API class to minim.qobuz.PrivateAPI, and this will be the new name moving forwards. I will tag you in another comment when this happens, and it's recommended that you git pull then to make sure you have the most recent version. I appreciate your patience as I clean up/refactor the codebase.

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1783935515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED34QBMLPPYGV2BYONCDYBWC2JAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTHEZTKNJRGU . You are receiving this because you were mentioned.Message ID: @.***>

-- Giacomo S. http://www.giacomos.it

Sincrotrone Trieste S.C.p.A. di interesse nazionale Strada Statale 14 - km 163,5 in AREA Science Park 34149 Basovizza, Trieste ITALY

040 3758073 328 3237959

bbye98 commented 10 months ago

Unfortunately, I'm not familiar with the inner workings of mpc or the Music Player Daemon (MPD). Sorry!

delleceste commented 10 months ago

thanks Benjamin. I'm evaluating the development of a Linux GUI based on Qt Python and minim... let me know if you are interested in the project. by the way, is there a way to restore an authenticated session ? authenticating takes quite a while... is that normal? Best regards. sincerely Giacomo

On Tue, 31 Oct 2023, 00:52 Benjamin Ye, @.***> wrote:

Unfortunately, I'm not familiar with the inner workings of mpc or the Music Player Daemon (MPD). Sorry!

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1786222126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED36O5J2QILTFL7RXAN3YCA4U5AVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBWGIZDEMJSGY . You are receiving this because you were mentioned.Message ID: @.***>

bbye98 commented 10 months ago

Access token storage is in the plans. I just haven't gotten around to the Qobuz submodule yet. Follow issue #4 for updates.

delleceste commented 10 months ago

good. thank you. one more question, are you sure the public APIs are going to be available in the future? just a few days ago I asked qobuz team about public APIs and they replied there are not, because of security issues. my suspect is that what we have is just an unofficial API... cross fingers!

regards Giacomo

On Fri, 3 Nov 2023, 09:44 Benjamin Ye, @.***> wrote:

Access token storage is in the plans. I just haven't gotten around to the Qobuz submodule yet. Follow issue #4 https://github.com/bbye98/minim/issues/4 for updates.

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1792058722, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED3YKAEXNLSR4D2OW6TTYCSVIXAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSGA2TQNZSGI . You are receiving this because you were mentioned.Message ID: @.***>

bbye98 commented 10 months ago

Qobuz does not have an open/public API, and they have not announced any plans to release one.

minim.qobuz implements the private Qobuz API that is used by their web player to retrieve Qobuz catalog information. It is "official" by all means, but Qobuz will not offer any support to developers building on it since it is technically not open to the public.

delleceste commented 10 months ago

hello! thanks for your information. this means you sniffed the traffic to build minim... didn't you?

On Fri, 3 Nov 2023, 18:30 Benjamin Ye, @.***> wrote:

Qobuz does not have an open/public API, and they have not announced any plans to release one.

minim.qobuz implements the private Qobuz API that is used by their web player to retrieve Qobuz catalog information. It is "official" by all means, but they will not offer any support to developers building on it since it is technically not open to the public.

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1792856102, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED36JRTF5SK5JJZPGXATYCUS3NAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHA2TMMJQGI . You are receiving this because you were mentioned.Message ID: @.***>

bbye98 commented 10 months ago

Yes, this is covered in the documentation for minim.Qobuz. Until Qobuz implements a public API, minim and other Qobuz API implementations on GitHub are the only ways to get Qobuz catalog information easily.

delleceste commented 10 months ago

great job! they will not do that, as far as I understand... kind regards

On Fri, 3 Nov 2023, 18:35 Benjamin Ye, @.***> wrote:

Yes, this is covered in the documentation for minim.Qobuz. Until Qobuz implements a public API, minim and other Qobuz API implementations on GitHub are the only ways to get Qobuz catalog information easily.

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1792863335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED36N4N523CFBY75CMI3YCUTPBAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJSHA3DGMZTGU . You are receiving this because you were mentioned.Message ID: @.***>

bbye98 commented 10 months ago

I've added support for authentication token caching for the private Qobuz API in commit a1dec5d. Try it out and let me know if it works!

delleceste commented 10 months ago

Thanks Benjamin!! I'll get back to You soon! Sincerely

El dom, 5 nov 2023 a las 9:57, Benjamin Ye @.***>) escribió:

I've added support for authentication token caching for the private Qobuz API in commit a1dec5d https://github.com/bbye98/minim/commit/a1dec5dcefb09ef7cc43a0af4fa39352a3197df6. Try it out and let me know if it works!

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1793677336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED33BIGAMRERNQRL7K7LYC5IGNAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGY3TOMZTGY . You are receiving this because you were mentioned.Message ID: @.***>

-- Giacomo S. http://www.giacomos.it

Sincrotrone Trieste S.C.p.A. di interesse nazionale Strada Statale 14 - km 163,5 in AREA Science Park 34149 Basovizza, Trieste ITALY

040 3758073 328 3237959

delleceste commented 10 months ago

Hello dear Benjamin! Actually, it works! You removed the Qobuz guide with examples that was useful ;-) Regards Giacomo

El lun, 6 nov 2023 a las 9:42, Giacomo @.***>) escribió:

Thanks Benjamin!! I'll get back to You soon! Sincerely

El dom, 5 nov 2023 a las 9:57, Benjamin Ye @.***>) escribió:

I've added support for authentication token caching for the private Qobuz API in commit a1dec5d https://github.com/bbye98/minim/commit/a1dec5dcefb09ef7cc43a0af4fa39352a3197df6. Try it out and let me know if it works!

— Reply to this email directly, view it on GitHub https://github.com/bbye98/minim/issues/5#issuecomment-1793677336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJED33BIGAMRERNQRL7K7LYC5IGNAVCNFSM6AAAAAA6PI5SRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGY3TOMZTGY . You are receiving this because you were mentioned.Message ID: @.***>

-- Giacomo S. http://www.giacomos.it

Sincrotrone Trieste S.C.p.A. di interesse nazionale Strada Statale 14 - km 163,5 in AREA Science Park 34149 Basovizza, Trieste ITALY

040 3758073 328 3237959

-- Giacomo S. http://www.giacomos.it

Sincrotrone Trieste S.C.p.A. di interesse nazionale Strada Statale 14 - km 163,5 in AREA Science Park 34149 Basovizza, Trieste ITALY

040 3758073 328 3237959