Some Questions about my use of get

Hello All

This is a kind of long winded ask but I am trying to understand the LBRY SDK
and the resources I have found have left me with many questions

I was hoping to provide my test API call to get and the results and my understanding
of said results and hopefully someone more knowledgeable than me can correct me
where I am wrong, confirm where I am correct and fill in the blanks where I am
clueless

Please and Thanks in advance

Request:

params_for_download = {
“uri”: “Test-Video#67”,
“download_directory”:f"{os.getcwd()}",
“save_file”:True

}

response2 = requests.post(“http://localhost:5279”, json={“method”: “get”, “params”: params_for_download}).json()

Results:

response2[‘result’][‘added_on’] is:
1642602879
I assume this is an epoch of when the vid was uploaded

response2[‘result’][‘blobs_completed’] is:
1
I assume videos are split up into chunks or blobs and this is how many are on the blockchain

response2[‘result’][‘blobs_in_stream’] is:
1
I assume this is how many chunks or blobs said video is made up of

response2[‘result’][‘blobs_remaining’] is:
0
I assume this is how many blobs or chunks of video still need to get to the blockchain does this mean that lets say you uploaded a big video via sdk would the video blobs get staged somewhere where they get finished uploading after the command completes? how does this work

response2[‘result’][‘channel_claim_id’] is:
8be45e4ba05bd6961619489f6408a0dc62f4e650
I assume this is the Unique ID of the channel the video is on for example the thing you would feed to a publish call to get the video to appear on a specific channel

response2[‘result’][‘channel_name’] is:
@Tiff_Tech_Test_Channel
I assume this is just the name of said channel in fact pretty sure thats right :stuck_out_tongue:

response2[‘result’][‘claim_id’] is:
67fc2a4ac6e4a55d240ab0e6c0447d0d15474755
I assumne this is the claim ID for the video on LBRY that was queryed

response2[‘result’][‘claim_name’] is:
Test-Video
This is the name of the video but is it the title that appears to the end user or some backend name for it I need to know how this is different from other name/title type results

response2[‘result’][‘completed’] is:
True
Im not sure what this indicates is completed. The download of the video I notice the get command seems to set up some sort of local stream of the video and I just want to download it without serving it up locally is this possible

response2[‘result’][‘confirmations’] is:
154219
What is this?

response2[‘result’][‘content_fee’] is:
None
I assume this means no payment of LBC is required for viewing this video

response2[‘result’][‘download_directory’] is:
C:\Users\tiff.LOCAL\eclipse-workspace\YouTube\src
This is the directory I told it to download to and it did

response2[‘result’][‘download_path’] is:
C:\Users\tiff.LOCAL\eclipse-workspace\YouTube\src\test_fixed.mp4
full path of the downloaded file I notice it remembered the full file name from original upload even though the lbry title is different

response2[‘result’][‘file_name’] is:
test_fixed.mp4
file name

response2[‘result’][‘height’] is:
943988
What is this since there is a differnt result later on involving height and width

response2[‘result’][‘is_fully_reflected’] is:
True
What is this

response2[‘result’][‘key’] is:
a2beddfcb609e8037a876880fa85ff2b
what is this?

response2[‘result’][‘mime_type’] is:
video/mp4
This is the mime type i dont know exactly what that means but I get the gist

response2[‘result’][‘nout’] is:
0
What is this? Blockchain stuff?

response2[‘result’][‘outpoint’] is:
873c48a0955829b4d42232dabbd2e4bb80b4ed70973424f78ab813905f44a47e:0
What is this? Blockchain stuff?

response2[‘result’][‘points_paid’] is:
0.0
What is this? Like how much has been paid for paid viewing if so does that include tips

response2[‘result’][‘protobuf’] is:
0150e6f462dca008649f48191696d65ba04b5ee48ba56125e70adbf7e53b82de499f4eccd898840e663da242ffdc4440680a8d3a63635862406057abdd1390dcfb12e118016a212a24eae08ca406a7f2ff6996ab4e0a90010a83010a30ef32737eb6d9c4a25a070b31cac0ae4681f5847ba75e27c1870d2e80156e6096d7a989c0580a6c1c8f4f0578111dcbfc120e746573745f66697865642e6d703418c9cf3c2209766964656f2f6d70343230d1012a624ed195698f1c49925169b50af50e39764a4e13dec6110f5a0e863c1a13101941924462cd7f865d55cca68e355a0808800a10d0051805420a5465737420566964656f4a215465737420566964656f2055706c6f616420746f204c425259207669612053444b
what is this?

response2[‘result’][‘purchase_receipt’] is:
None
What is this?

response2[‘result’][‘reflector_progress’] is:
0
What is this?

response2[‘result’][‘sd_hash’] is:
d1012a624ed195698f1c49925169b50af50e39764a4e13dec6110f5a0e863c1a13101941924462cd7f865d55cca68e35
What is this?

response2[‘result’][‘status’] is:
running
What is this? Does it mean the local stream this seems to set up is running? or something else and can i prevent the whole local streaming thing I just want to download and or get the info about the video

response2[‘result’][‘stopped’] is:
False
What is this? Local stream related? Something else?

response2[‘result’][‘stream_hash’] is:
d1491721db837d854fc71a18d9c83dcb3ef260a8dd7342ba2145ff9709949ada5dd64c7996fb775b13ef6e5fc680de77
What is this?

response2[‘result’][‘stream_name’] is:
test_fixed.mp4
What is this and why is it differnt from the claim name?

response2[‘result’][‘streaming_url’] is:
http://localhost:5280/stream/d1012a624ed195698f1c49925169b50af50e39764a4e13dec6110f5a0e863c1a13101941924462cd7f865d55cca68e35
This is the local streaming url like i can go here and watch the video but I do not want this can this be skipped or stopped and cleaned up somehow directly after download or lookup is complete?

response2[‘result’][‘suggested_file_name’] is:
test_fixed.mp4
I assume this is the filename it will give the file if none is provided

response2[‘result’][‘timestamp’] is:
1618181187
What is this a timestamp for?

response2[‘result’][‘total_bytes’] is:
993232
I assume this is the size of the video but is it the size on the blockchain or on the local machine or something else?

response2[‘result’][‘total_bytes_lower_bound’] is:
993216
What is this?

response2[‘result’][‘txid’] is:
873c48a0955829b4d42232dabbd2e4bb80b4ed70973424f78ab813905f44a47e
What is this?

response2[‘result’][‘uploading_to_reflector’] is:
False
What is this?

response2[‘result’][‘written_bytes’] is:
993225
What is this?

response2[‘result’][‘metadata’][‘description’] is:
Test Video Upload to LBRY via SDK
This is the description that appears to end users on LBRY

response2[‘result’][‘metadata’][‘stream_type’] is:
video
This is the type of content yes?

response2[‘result’][‘metadata’][‘title’] is:
Test Video
So is this value the title people see on the platform how is it different from the other two things that have popped up? do certain ones of these have to be the same?

response2[‘result’][‘metadata’][‘source’][‘hash’] is:
ef32737eb6d9c4a25a070b31cac0ae4681f5847ba75e27c1870d2e80156e6096d7a989c0580a6c1c8f4f0578111dcbfc
What is this?

response2[‘result’][‘metadata’][‘source’][‘media_type’] is:
video/mp4
How is this different form the mime type result providede before would they ever not match?

response2[‘result’][‘metadata’][‘source’][‘name’] is:
test_fixed.mp4
This is the original filename that was uploaded I suppose the filename is preserved when uploading

response2[‘result’][‘metadata’][‘source’][‘sd_hash’] is:
d1012a624ed195698f1c49925169b50af50e39764a4e13dec6110f5a0e863c1a13101941924462cd7f865d55cca68e35
What is this?

response2[‘result’][‘metadata’][‘source’][‘size’] is:
993225
This is the size i assume original size of the file that was uploaded or actual size on the local machine hard to tell

response2[‘result’][‘metadata’][‘video’][‘duration’] is:
5
Duration of video in seconds I assume

response2[‘result’][‘metadata’][‘video’][‘height’] is:
720
Height of video in pixels

response2[‘result’][‘metadata’][‘video’][‘width’] is:
1280
Width of the video in pixels

Here are ones which I think I knew the answer to, bit rough but should have some info. You may also want to check whitepaper to get better general understanding of the LBRY. https://lbry.tech/spec
And if you aren’t familiar with blockchain, this may be useful to check first: Ever wonder how Bitcoin (and other cryptocurrencies) actually work?


response2[‘result’][‘blobs_completed’] is:

How many blobs you have downloaded of the file.
Note that blockchain doesn’t store any data of the actual file, it just stores metadata + key/instruction for how to find the actual data from the P2P data network.


response2[‘result’][‘blobs_remaining’] is:

How many blobs from the file you are still missing.

And for how the uploading kind of works(app does this for you)

  1. You make encrypted blobs from the actual file
  2. You collect hashes of those blobs + encryption keys to a “manifest_blob” file
  3. You send metadata of the actual file and hash of the “manifest_blob”(sd_hash) in the blockchain.
    — How the actual data is handled ----
  4. You announce to the P2P data network that the data associated with the sd_hash can be found from your node. And schedule it to be announced again after 12h (See LBRY whitepaper + kademlia protocol whitepaper(there is link in LBRY whitepaper to that) , for more details)
  5. Upload blobs to Odysee’s reflector server, so it will be accessible even when you don’t host it.

response2[‘result’][‘claim_name’]:

Name is like an URL to the content in LBRY. Check this for more info
LBRY Specification - lbry.tech (whole white paper is great to get the general concept of LBRY)
How does LBRY naming work? Why don't you just assign names the same way as internet domains?


response2[‘result’][‘completed’] is:

Not 100% sure, but I think this means “fully downloaded” and that the actual file was created.
If you want to download just the video as an file, you can use file_delete https://lbry.tech/api/sdk#file_delete to delete the hosting data(blobs) afterwards.(Note that LBRY desktop uses the stream created from the blobs for video content)


response2[‘result’][‘confirmations’] is:

Basically how many blocks ago the transaction containing the claim was confirmed to blockchain,
https://explorer.lbry.com <— LBRY’s block explorer


response2[‘result’][‘height’] is:

Can’t remember exactly, either the block height the claim was created at, or the one where it was last updated. Quite sure that it’s last updated one


response2[‘result’][‘is_fully_reflected’] is:

Again not sure, but I think this means that the reflector server(fixed hosting server run by Odysee or LBRY, not sure which one) has all the blobs for the file. https://lbry.tech/spec#data


response2[‘result’][‘key’] is:

I think this is the key for decrypting the downloaded blobs. (See above link to spec for more info)


response2[‘result’][‘nout’] is:
response2[‘result’][‘outpoint’] is:

Outpoint: The txid(transaction id) of the transaction where the claim was created(or last updated, not sure which one)
Nout: number of the output in the transaction.
Paste txid to the block-explorer, to see bit more https://explorer.lbry.com/


response2[‘result’][‘points_paid’] is:

No idea what this is. But don’t think it has anything to do with how much content has received LBC. (It’s impossible to perfectly detect supports from tips)


response2[‘result’][‘purchase_receipt’] is:

If you had bought the content, this would show info about the purchase transaction.


response2[‘result’][‘reflector_progress’] is:

No idea, but probably some number of how many blobs of that file you have to upload for the reflector server, or how many blobs reflector is missing. Or something else.


response2[‘result’][‘sd_hash’] is:

I think it’s what is called “stream hash” in here https://lbry.tech/spec#streams
Used to make sure that data you downloaded is what you wanted to download.


response2[‘result’][‘status’] is:

Status of the download. Because you had the command set to store file and/or you have configured lbrynet to create the actual file, the get command will download the whole file.
Otherwise it will only download manifest_blob


response2[‘result’][‘stopped’] is:

Guessing again, probably another download status.


Not sure what all these fields with stream_… mean. Maybe these are values stored in manifest_blob


response2[‘result’][‘streaming_url’] is:

If you don’t do saving of the actual file, this could be used make lbrynet to download blobs as needed. Not sure what you mean with cleaning, you can use file_delete to delete the files you don’t want.


response2[‘result’][‘timestamp’] is:

I think this is timestamp the claim was last updated, or created. Not sure which one.


response2[‘result’][‘total_bytes’] is:

Something to do with the size of the file. Don’t think this being related to the data stored in blockchain.


Metadata contains the basic info of the publish. Stuff in metadata can be changed later.
Title is just a piece of text, that is usually used with the thumbnail in apps.
Name is basically the URL or handle in blockchain associated with metadata of the actual file
Title can be changed later, name can’t be changed later.

[‘metadata’][‘source’][‘hash’]: sha384sum of the actual file, I think.

response2[‘result’][‘metadata’][‘source’][‘size’]: size of the file associated with the claim.(Value here isn’t enforced)