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