#17 Login From FastLBRY

Open
opened 2 years ago by jyamihud · 2 comments

Currently to login you need to use the LBRY Desktop which shares the login information with any other SDK running on the system. For one, it seems like a security hazard. But anyways. There should be features to login. How to do it? IDK... somebody needs to hack it together.

Currently to login you need to use the LBRY Desktop which shares the login information with any other SDK running on the system. For one, it seems like a security hazard. But anyways. There should be features to login. How to do it? IDK... somebody needs to hack it together.

Somebody sent me this:

import requests

#Crete "new" user
newStuff = requests.post("https://api.odysee.com/user/new").json()
auth_token = newStuff["data"]["auth_token"]

#Associate user with your account
signInStuff = requests.post("https://api.odysee.com/user/signin", data={"auth_token":auth_token, "email":my_email, "password": my_password}).json()


sync_hash = requests.post("http://localhost:5279/?m=sync_hash", json={"jsonrpc":"2.0","method":"sync_hash","params":{}, "id": 1}).json()["result"]

dontknow1 = requests.post("https://api.lbry.com/sync/get", data={"auth_token":auth_token,"hash":sync_hash}).json()

# Password probably needs to be wallet encryption password, I think default is same as Odysee password or empty
dontknow2 = requests.post("http://localhost:5279/?m=sync_apply", json={"jsonrpc": "2.0", "method": "sync_apply", "params": {"password": "", "blocking": "true", "data": dontknow1["data"]["data"]}}).json()

I think, if this works, it could be used to make a Login

Somebody sent me this: ``` import requests #Crete "new" user newStuff = requests.post("https://api.odysee.com/user/new").json() auth_token = newStuff["data"]["auth_token"] #Associate user with your account signInStuff = requests.post("https://api.odysee.com/user/signin", data={"auth_token":auth_token, "email":my_email, "password": my_password}).json() sync_hash = requests.post("http://localhost:5279/?m=sync_hash", json={"jsonrpc":"2.0","method":"sync_hash","params":{}, "id": 1}).json()["result"] dontknow1 = requests.post("https://api.lbry.com/sync/get", data={"auth_token":auth_token,"hash":sync_hash}).json() # Password probably needs to be wallet encryption password, I think default is same as Odysee password or empty dontknow2 = requests.post("http://localhost:5279/?m=sync_apply", json={"jsonrpc": "2.0", "method": "sync_apply", "params": {"password": "", "blocking": "true", "data": dontknow1["data"]["data"]}}).json() ``` I think, if this works, it could be used to make a Login

That script completely works. There needs to be some documentation written for fastlbry now on how to use it. In this comment I will tell you what I did though: I created the python file with the code and added the variables for my account this is something like how it looks:

import requests

auth_token = "..."
my_email = "..."
# The user could have a super secure password so you need to make sure that you can properly put it into this string.
my_password = "..."
#Crete new user
newStuff = requests.post("https://api.odysee.com/user/new").json()
auth_token = newStuff["data"]["auth_token"]

#Associate user with your account
signInStuff = requests.post("https://api.odysee.com/user/signin", data={"auth_token":auth_token, "email":my_email, "password": my_password}).json()

sync_hash = requests.post("http://localhost:5279/?m=sync_hash", json={"jsonrpc":"2.0","method":"sync_hash","params":{}, "id": 1}).json()["result"]

dontknow1 = requests.post("https://api.lbry.com/sync/get", data={"auth_token":auth_token,"hash":sync_hash}).json()

print(dontknow1)
# Password probably needs to be wallet encryption password, I think default is same as Odysee password or empty
dontknow2 = requests.post("http://localhost:5279/?m=sync_apply", json={"jsonrpc": "2.0", "method": "sync_apply", "params": {"password": "", "blocking": "true", "data": dontknow1["data"]["data"]}}).json()

print(dontknow2)

The print stuff is completely not necessary. Then I went to my file where the new info was and surprisingly all my account info was there it was ME for sure. I could see blocked users and other settings I had on odysee.

Running fastlbry and doing stuff with lbry SDK now work flawlessly. This is a excellent python script.

That script completely works. There needs to be some documentation written for fastlbry now on how to use it. In this comment I will tell you what I did though: I created the python file with the code and added the variables for my account this is something like how it looks: ```py import requests auth_token = "..." my_email = "..." # The user could have a super secure password so you need to make sure that you can properly put it into this string. my_password = "..." #Crete new user newStuff = requests.post("https://api.odysee.com/user/new").json() auth_token = newStuff["data"]["auth_token"] #Associate user with your account signInStuff = requests.post("https://api.odysee.com/user/signin", data={"auth_token":auth_token, "email":my_email, "password": my_password}).json() sync_hash = requests.post("http://localhost:5279/?m=sync_hash", json={"jsonrpc":"2.0","method":"sync_hash","params":{}, "id": 1}).json()["result"] dontknow1 = requests.post("https://api.lbry.com/sync/get", data={"auth_token":auth_token,"hash":sync_hash}).json() print(dontknow1) # Password probably needs to be wallet encryption password, I think default is same as Odysee password or empty dontknow2 = requests.post("http://localhost:5279/?m=sync_apply", json={"jsonrpc": "2.0", "method": "sync_apply", "params": {"password": "", "blocking": "true", "data": dontknow1["data"]["data"]}}).json() print(dontknow2) ``` The print stuff is completely not necessary. Then I went to my file where the new info was and surprisingly all my account info was there it was ME for sure. I could see blocked users and other settings I had on odysee. Running fastlbry and doing stuff with lbry SDK now work flawlessly. This is a excellent python script.
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.