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

Error: Attempt to decode JSON with unexpected mimetype... #26

Open
cemratip opened this issue Sep 2, 2023 · 11 comments
Open

Error: Attempt to decode JSON with unexpected mimetype... #26

cemratip opened this issue Sep 2, 2023 · 11 comments

Comments

@cemratip
Copy link

cemratip commented Sep 2, 2023

I've copied the cookies in the exact same format as the example file.

I get the following error:
[ERR] - Failed to generate email. Reason: 0, main.py:48
message='Attempt to decode JSON with unexpected mimetype:
', url=URL('https://p68-maildomainws.icloud.com/v1/hme/ge
nerate?clientBuildNumber=2317Project38&clientMasteringNum
ber=2317B22&clientId=&dsid=')

Please help!

@cemratip
Copy link
Author

cemratip commented Sep 2, 2023

I've tried the v2 endpoint and that produces the same error.

@rtunazzz
Copy link
Owner

rtunazzz commented Sep 3, 2023

Hmm, it's still working on my end, on the v1 endpoint.. So as of right now, I can't reproduce the issue thus I can't fix. :(


My guess is they're slowly rolling out a new endpoint, with only some regions using it currently. You can try checking which endpoint it will use in your browser on https://www.icloud.com/icloudplus/, and updating it accordingly.

These are the endpoints my browser is using, just in case you'd want to compare:

    var mg = {
        hmeDelete: {
            path: "/v1/hme/delete",
            method: "POST"
        },
        hmeGet: {
            path: "/v2/hme/get",
            method: "POST"
        },
        hmeUpdate: {
            path: "/v1/hme/updateMetaData",
            method: "POST"
        },
        hmeList: {
            path: "/v2/hme/list",
            method: "GET"
        },
        hmeDeactivate: {
            path: "/v1/hme/deactivate",
            method: "POST"
        },
        hmeReactivate: {
            path: "/v1/hme/reactivate",
            method: "POST"
        },
        hmeGenerate: {
            path: "/v1/hme/generate",
            method: "POST"
        },
        hmeReserve: {
            path: "/v1/hme/reserve",
            method: "POST"
        },
        hmeUpdateForwardTo: {
            path: "/v1/hme/updateForwardTo",
            method: "POST"
        }
    };

@cemratip
Copy link
Author

cemratip commented Sep 3, 2023

Thanks for your reply.

What region are you in? If I use a VPN to connect to the same region as you or make a new iCloud account in that region then might it work?

@rtunazzz
Copy link
Owner

rtunazzz commented Sep 4, 2023

Sure thing. I'm based in EU..

Would be ideal if you could check the paths though, I'm sure others that have the same issue would also appreciate it ;)

@ezyyeah
Copy link

ezyyeah commented Oct 5, 2023

Same issue.
on v1: "[ERR] - Failed to generate email. Reason: Invalid global session"
Copied the cookies correctly ('Semicolon separated name=value pairs'), and there is no VPN in use.

on v2: "[ERR] - Failed to generate email. Reason: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://p68-maildomainws.icloud.com/v2/hme/generate?clientBuildNumber=2317Project38&clientMasteringNumber=2317B22&clientId=&dsid=')"

Im based in EU.

@rtunazzz
Copy link
Owner

rtunazzz commented Oct 6, 2023

Hi @ezyyeah, do you have an iCloud+ subscription? Haven't seen any other causes of the first error you're getting (Invalid global session) other than either expired cookies or account not having an iCloud+.


Regarding v2, the web is still using the old v1 endpoint on my end, so I can't do anything about that unless someone is able to provide the list of endpoints I mentioned in this issue earlier.

@georgiiic
Copy link

Hi ! I've tried to generate emails and I face the same problems as @ezyyeah... Has anyone find a solution? Or maybe another way to make it work?

Thanks in advance !

PS : Based in EU too

@rtunazzz
Copy link
Owner

Hi @georgiiic, just tested and unfortunately generating is still working for me fine, so not much I can do...

Do you have an active iCloud+ subscription?

@georgiiic
Copy link

Hi @rtunazzz ! Thanks for your response !
It finally worked but I am limited to 5 alias per day unfortunately. And yes I do have the cloud+ subscription.

@rtunazzz
Copy link
Owner

Oh great @georgiiic, what did you change to fix the problem? Would be helpful for others that may encounter the problem in the future :)

Btw I believe it should be limited to 5 every about 30 mins or so, at least that's how it used to be when I was generating mine.

@georgiiic
Copy link

Well first it seems that the cookies expire pretty quickly so changing it quite often is the way to go. Also use V1 since it still works fine and with V2 get the parsing error. :)

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

No branches or pull requests

4 participants