noeRls / medal-downloader

Download all your public medal videos
MIT License
27 stars 4 forks source link

Fixed loadUserIdFromUsername function by changing get request to post… #24

Closed frius94 closed 1 year ago

frius94 commented 1 year ago

Fixed loadUserIdFromUsername function by changing get request to post request with credentials.
The function used to have an issue finding the username without the credentials with the GET request.
The new POST request takes the credentials and receives as a response which includes the userId.
You can test it with medal-downloader --username your_username --password your_password

noeRls commented 1 year ago

I think there is a way to load the user id without the password using https://medal.tv/api/users?username=pingui34. I will try it out this weekend.

noeRls commented 1 year ago

Hey @frius94 thanks for your contribution!

I am trying to reproduce the error you're trying to fix, what's your username?

I don't like that users have to enter their password to download their videos, it can lead to security issues. That's why I am looking at an other way of doing it. If there is no other way I will merge your cl :)

frius94 commented 1 year ago

Hi @noeRls . My username on Medal is: umut94

noeRls commented 1 year ago

Hey I can't reproduce the error.

From what I understand you have an error: "Invalid username: umut94" displayed, weather you're using your password or not right?

I have update the package with an other way of fetching the userId that doesn't involve regex parsing with "https://medal.tv/api/users?username=pingui34" endpoint, can you take a look if you still have the error?

frius94 commented 1 year ago

I tested your changes. It works with and without password, which is awesome. But using the --url parameter didn't work for me. How are you supposed to use the url? Like this?: https://medal.tv/api/users?username=pingui34 Or this: https://medal.tv/users/pingui34

noeRls commented 1 year ago

Great to hear that it works now!

The parameter for the --url should be something like: https://medal.tv/users/pingui34 This doesn't work for you?

noeRls commented 1 year ago

closing due to inactivity, feel free to re-open