There’s also some pros and cons I forgot to mention in the last email: Option 1 will give you the maximum speed and minimum dependencies, disk storage and memory consumption.
But if spotify changes how the login machnism works, then you have to rewrite that part of login. However, I don’t think that’s going to be happen frequently. Option 2 will be BROKEN if spotify changes the layout of the page, i.e., there UI engineers think a new UI looks better or more friendly to their customers, which **I think happens frequently compared to redesign of underlying login method.** Option 3 would is the balance of the two. It doesn’t require u to install the whole chrome on your machine, doesn’t consume that much ram, and it won’t be broken as long as the filename of the JavaScript responsible for login isn’t changed. Get Outlook for iOS<https://aka.ms/o0ukef> ________________________________ From: Jiahao XU <jiahao...@outlook.com> Sent: Tuesday, July 21, 2020 7:03:49 PM To: Morbius <achar...@gmx.net>; libcurl development <curl-library@cool.haxx.se> Cc: Morbius <achar...@gmx.net> Subject: Re: How to use libcurl to login to Spotify ? IMHO, there’s two directions you can go: 1. Try to understand what the JavaScript is doing and reproduce it using libcurl; 2. Use selenium to control chrome to enter username and password and login. 3. Find a C/C++ library that can run JavaScript and run the JavaScript downloaded by libcurl that is related to login. Personally, I would go the first direction, and only goes for option 2 when I cannot understand that JavaScript related to login or it uses some features doesn’t exist in libcurl (I would highly doubt that). In case you don’t have enough time and depending on chrome isn’t a problem for you, option 2 is a simple yet an overkill solution you can take, with the side effect that chrome would consume a lot of disk space, memory and CPU. Get Outlook for iOS<https://aka.ms/o0ukef> ________________________________ From: curl-library <curl-library-boun...@cool.haxx.se> on behalf of Morbius via curl-library <curl-library@cool.haxx.se> Sent: Tuesday, July 21, 2020 6:10:48 PM To: libcurl development <curl-library@cool.haxx.se> Cc: Morbius <achar...@gmx.net> Subject: How to use libcurl to login to Spotify ? I have installed curl 7.72.0-DEV (x86_64-pc-win32) libcurl/7.72.0-DEV Schannel WinIDN. I work with MinGW C/C++ on Windows 7 and Windows 10. What I wish to do. I would like to use libcurl to login to the Spotify login page : https://accounts.spotify.com<https://accounts.spotify.com/> Through research, I have learned that others have used the following functions in similar situations : CURLOPT_USERNAME<https://curl.haxx.se/libcurl/c/CURLOPT_USERNAME.html> CURLOPT_PASSWORD<https://curl.haxx.se/libcurl/c/CURLOPT_PASSWORD.html> CURLOPT_USERPWD<https://curl.haxx.se/libcurl/c/CURLOPT_USERPWD.html> CURLOPT_POSTFIELDS However, I do not know how I could make use of them for the Spotify login page. What I have done so far. Not much really. I went to the Source Page and I observe the presence of a Javascript : https://accounts.scdn.co/js/index.149c7398ea10e98a3462.js Here, I am blocked. I don't know what to do next. I am still a beginner at libcurl and I wish to learn through practice. Could someone explain why Spotify requires a JS routine to perform the login, and provide some guidance so that I can move forward ?
------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html