LBBO / netflix-migrate

A command-line tool to migrate data to and from Netflix profiles
MIT License
266 stars 32 forks source link

beta cookie version does't work #55

Closed gilimotil closed 1 year ago

gilimotil commented 3 years ago

I tried to import to my new netflix account and got this exception:

image

LBBO commented 3 years ago

Hey @gilimotil,

thanks for reporting your issue! I took the liberty of censoring your screenshot to remove some potentially sensitive data. Remember, anyone with this cookie could be able to login to your account!

Once I have an update regarding the actual bug, I'll let you know.

LBBO commented 3 years ago

Ok @gilimotil , I'm not sure what is causing this issue. It looks like your command isn't being parsed as intended (note that netflix-migrate asked for your profile name, even though you provided it correctly. Additionally, the unrecognized commands are all strings that can be found in the cookie). However, I can't see anything wrong with your command (I even checked before censoring the screenshot and it looked fine).

Are you sure double quotes work in your cmd? Maybe try something like cd "C:\Program Files" and see if it works. After a quick Google search, I found this superuser article that seems to cover a similar (if not identical) issue: https://superuser.com/questions/1059582/double-quotes-not-working-on-windows-command-line

gilimotil commented 3 years ago

ok, I fix the quotes issue but still got an exception: I don't know what is inactive account, I think my account is active, I can watch all the shows on netflix

image

LBBO commented 3 years ago

I see you're now importing from a file. Did the export work? The "Inactive Account" error essentially means that authentication failed. It is still left over from the old email and password authentication and no longer has the same meaning.

Is the cookie you are using up to date? If it's a few hours old, maybe try and extract it again. Also, please make sure it contains both a NetflixId and a SecureNetflixId.

gilimotil commented 3 years ago

the export worked with the regular version, not the beta, so I have a valid JSON file on my computer. The cookie is new, never had a cookie from the old mail... I tried refresh the browser and exctract new cookie many times, still got the same exception

gilimotil commented 3 years ago

I tried export with the beta version and got the same exception... Maybe I am doing something wrong, take the wrong cookie or something like that..

I take the cookie from: Network tab -> All -> request called "browse" (first request) -> Headers -> RequestHeader -> cookie

gilimotil commented 3 years ago

Did you find why I got the exception? Thanks, Gili Motil

‫ב-2 בפבר׳ 2021, בשעה 20:06, ‏‏Michael David Kuckuk ‏notifications@github.com כתב/ה:‬

 I see you're now importing from a file. Did the export work? The "Inactive Account" error essentially means that authentication failed. It is still left over from the old email and password authentication and no longer has the same meaning.

Is the cookie you are using up to date? If it's a few hours old, maybe try and extract it again. Also, please make sure it contains both a NetflixId and a SecureNetflixId.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LBBO commented 3 years ago

No, not yet, I'm sorry. The error might be related to node, it might be related to your location...

Do you have any JavaScript programming experience and could help me gather some additional information? I'd be interested in testing some "custom requests" with your cookie to see if the cookie works at all and I'm also curious about some details about Netflix' response that causes the authorization to fail. I expect it to be their standard login page for when a user entered incorrect credentials, who knows -- your local Netflix version might be different than mine in that regard.

If you'd be willing to help, we could hop on a voice chat (i.e. Jitsi, but feel free to suggest something else) and we could have a go at figuring this out together.

LBBO commented 3 years ago

I just published a new beta version of node-netflix2 (a package that provides a JS interface for the Netflix API). If you re-execute the command, you should now find an errorResponsePage.html file in your current directory. Please open it in your browser and upload a screenshot of it (unless it contains any sensitive data, of course).

For reference, when I enter an outdated cookie, my response page looks like this (zoomed to fit the entire page):

image

I'd expect you to see the same sort of page, perhaps with your locale or something. If your result is significantly different, that might be what's causing your error.

gilimotil commented 3 years ago

I have some JavaScript experience but I don't have IDE at my home computer. Only ay my work place but I don't have access to the internet there...

We can make a zoom meeting, I don't have a problem..

‫ב-4 בפבר׳ 2021, בשעה 18:01, ‏‏Michael David Kuckuk ‏notifications@github.com כתב/ה:‬

 I just published a new beta version of node-netflix2 (a package that provides a JS interface for the Netflix API). If you re-execute the command, you should now find an errorResponsePage.html file in your current directory. Please open it in your browser and upload a screenshot of it (unless it contains any sensitive data, of course).

For reference, when I enter an outdated cookie, my response page looks like this (zoomed to fit the entire page):

I'd expect you to see the same sort of page, perhaps with your locale or something. If your result is significantly different, that might be what's causing your error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LBBO commented 3 years ago

We won't need a full-blown IDE; a simple VS Code setup with node should do. You can contact me at mdk@kuckuk.com so that we can arrange the exact details of our meeting, but any actual discussion of the issue should continue to take place on this issue. That way, other users will be able to benefit from our discussion.

ShizCalev commented 3 years ago

Are you using a cookie taken from chrome? I noticed there is a difference as chrome doesn't sanitize " 's, resulting in cookies grabbed from it closing the param earlier than intended vs cookies taken from firefox with sanitizes " 's as %22

LBBO commented 3 years ago

That actually depends on how you extract the cookie from Chrome (for me, at least). The way you should do it is by manually selecting the entire string with your mouse and pressing Ctrl + C. For me, this consistently gives me the correct cookie without any quotes.

If, instead, you right-click the cookie and click on "Copy Value", Chrome will decode the cookie and will turn %22 back into ".

I'll make sure to clarify how to extract the cookie in the README.

mcdado commented 3 years ago

Thank you very much, I managed to make it work by coping out the cookie from the headers in the Network panel. But does the v2 version only import ratings or also viewing history and my list?

lcdss commented 3 years ago

I successfully exported two profiles from my Netflix account this last weekend using the branch cookie-login. For a moment I thought the profile export feature isn't working, since both profiles had the same data, but was my mistake by using the same cookie for both profiles.

Thanks @LBBO for building this tool.

LBBO commented 3 years ago

@mcdado Sadly, I haven't been able to make importing viewing history work. The data can already be exported (i.e. downloaded) but the import seems to be far more difficult. Since you have the data, though, you should hopefully be able to just import it if and when the feature is added. For more information on this feature, please refer to #31.

@lcdss I'm glad you were able to resolve the issue and the tool was able to help you!

@gilimotil Is there any update on your problems? If you don't say otherwise, I'll consider them resolved in a few days / weeks / whenever I do some housekeeping 😅

Chewbacca222222 commented 3 years ago

I'm still getting the issue first mentioned, I've tried both importing and exporting using the standard and the cookie edition and the only thing that has worked so far is the export of the standard (non-cookie edition). I've attached the output below of the commands and I've followed the instructions in the readme (make sure there are no quote marks e.t.c). Thanks in advance and awesome package btw!!!

npx netflix-migrate --cookie "[[MY_COOKIE_DATA]]" --import netflixData.json
Profile name. Please pay special attention to spelling!: [[PROFILE]]
Using new Netflix2 class!
Logging into Netflix using Cookies
Error: Inactive account
    at Netflix.__getContextData (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:555:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Netflix.__getContextDataFromUrls (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:594:7)
    at async Netflix.login (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:76:9)
    at async main (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix-migrate\main.js:24:3)
The exact response HTML file was saved to C:\Users\joebloggs\Desktop\Netflix migrate 2\errorResponsePage.html
Error: There was a problem fetching user data. For more information, see previous log statements.
    at Netflix.__getContextData (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:584:13)
    at async Netflix.__getContextDataFromUrls (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:594:7)
    at async Netflix.login (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:76:9)
    at async main (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix-migrate\main.js:24:3)
Error: Something went wrong. For more information, see previous log statements.
    at Netflix.login (C:\Users\joebloggs\Desktop\Netflix migrate 2\node_modules\netflix2\lib\netflix2.js:88:13)
'datestamp' is not recognized as an internal or external command,
operable program or batch file.
'version' is not recognized as an internal or external command,
operable program or batch file.
'consentId' is not recognized as an internal or external command,
operable program or batch file.
'interactionCount' is not recognized as an internal or external command,
operable program or batch file.
'landingPath' is not recognized as an internal or external command,
operable program or batch file.
groups: ‘=[[SECRET_VALUE]]’: no such user
'hosts' is not recognized as an internal or external command,
operable program or batch file.
'AwaitingReconsent' is not recognized as an internal or external command,
operable program or batch file.
'geolocation' is not recognized as an internal or external command,
operable program or batch file.
quophyie commented 3 years ago

I am having the exact same problem as @Chewbacca222222

danypacf commented 3 years ago

Account must be active.

Chewbacca222222 commented 3 years ago

Account must be active.

Both accounts were active, I tried on multiple occasions too.

Cyril035 commented 2 years ago

Hi there,

I try to use this beta version and same pb

image

By looking at the errorResponsePage.html, this is the error

image

LBBO commented 1 year ago

Hey everyone! Sorry for not helping out with this issue for so long, I was just really busy and, quite frankly, fed up with playing catchup with changes to Netflix's API or DOM structure or whatever every couple of months.

However, there's some good news! In case anyone hasn't heard, Netflix now officially supports account migration, including viewing history! For more details, see their official documentation. Since that feature implements exactly what this project was aiming to do, I will officially archive this repository now (see #73). Feel free to reach out if you have any further questions!

(Also, on a side note @Cyril035: your cookie doesn't look right. That looks like a UUID but the cookie information should have been some huge string similar to key1=value1; key2=value2. Just in case you need to extract a cookie some time again 😉)