Agora cloud recording returns 404 - agora.io

I am trying to use rest apis for cloud recording from agora
Acquire api working fine
Start api working fine
but query api is returning me
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfwoTqpfJ2tw6vZBJQTihhScR-c4d2ArswXWeE_HpqcfMyVkJzU6WQFVcZT7nOO5DiZpQjPfNd4XpjqVsZH5FrepttBahXeyhmDPqjnbp2eftzQgsBIqDbREHAyS6O2q3bo3JzQMdir1NaCCkQIfXvXwB7Ogtkes2nflOX1Q9ykt-4IcqJvrEU41ilSkR5U-zV3PfpuN5rN3clMJCOI1Ya_VwqqK-KEjlLV_9BAeeaiQnlaEJtCpu88_xHLtKeFIeXVKtrBdAEOfychQI2NYSo8w",
"sid": "99fe567c724ccc1aa4cbff997f2ea035",
"code": 404
}
My start request was
{
"uid": uid,
"cname": Cname,
"token" : RTCToken,
"clientRequest": {
"storageConfig": {
"secretKey": SECRET_KEY,
"region": REGION,
"accessKey": ACCESS_KEY,
"bucket": BUCKET,
"vendor": VENDOR,
},
"recordingConfig": {
"audioProfile": 0,
"channelType": 0,
"maxIdleTime": 30,
"transcodingConfig": {
"width": 640,
"height": 360,
"fps": 15,
"bitrate": 600,
"mixedVideoLayout": 2,
"backgroundColor": "#fff000",
},
},
},
}

Related

Why lastfm api returns the wrong image?

When I get track.search or user.getLovedTracks response, they have an image, but if I saw on any of the provided links then there will be a white image with a star, although if I go to my loved tracks page in lastfm the images will be correct.
For the example.
At lastfm:
https://i.stack.imgur.com/OKc5e.png
link to image: https://lastfm.freetls.fastly.net/i/u/64s/9c7a96efcdfa4e03cc8e1b65daac5281.jpg
At my service:
https://i.stack.imgur.com/dpIhj.png
link to image in request response: https://lastfm.freetls.fastly.net/i/u/64s/2a96cbd8b46e442fc41c2b86b821562f.png
The api returns a whole array of links to images, but they are all incorrect
https://i.stack.imgur.com/Uiwrl.png
If you send a request with the track.getInfo method will response like:
{
"track": {
"name": "Без ключа",
"url": "https://www.last.fm/music/Pharaoh/_/%D0%91%D0%B5%D0%B7+%D0%BA%D0%BB%D1%8E%D1%87%D0%B0",
"duration": "159000",
"streamable": {
"#text": "0",
"fulltrack": "0"
},
"listeners": "10491",
"playcount": "78974",
"artist": {
"name": "Pharaoh",
"mbid": "a6ed750a-7293-4e08-ba03-832373eb136b",
"url": "https://www.last.fm/music/Pharaoh"
},
"album": {
"artist": "Pharaoh",
"title": "Правило",
"url": "https://www.last.fm/music/Pharaoh/%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D0%BE",
"image": [{
"#text": "https://lastfm.freetls.fastly.net/i/u/34s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "small"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/64s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "medium"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/174s/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "large"
}, {
"#text": "https://lastfm.freetls.fastly.net/i/u/300x300/6e92fe0cff920f671ee5eb4e2f0f4e59.png",
"size": "extralarge"
}]
},
"toptags": {
"tag": []
}
}
}
and the links in the album image will be correct

How can I map data from json file in recat native

I am trying to fish data with images but how can I do two map inside each othe I need only the first image from every item
here is the JSON file
`
"items": Array [
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/5staYrHq4jR1NiBfRR2XWr",
},
"followers": Object {
"href": null,
"total": 433,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/5staYrHq4jR1NiBfRR2XWr",
"id": "5staYrHq4jR1NiBfRR2XWr",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab6761610000e5eb038f9071ec89962e7ad16b77",
"width": 640,
},
Object {
"height": 320,
"url": "https://i.scdn.co/image/ab67616100005174038f9071ec89962e7ad16b77",
"width": 320,
},
Object {
"height": 160,
"url": "https://i.scdn.co/image/ab6761610000f178038f9071ec89962e7ad16b77",
"width": 160,
},
],
"name": "DOXX",
"popularity": 6,
"type": "artist",
"uri": "spotify:artist:5staYrHq4jR1NiBfRR2XWr",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/1MVFEpYdHtdV3k8Bgs79Pl",
},
"followers": Object {
"href": null,
"total": 404,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/1MVFEpYdHtdV3k8Bgs79Pl",
"id": "1MVFEpYdHtdV3k8Bgs79Pl",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab6761610000e5ebd1578a57ff89ac9aeed23863",
"width": 640,
},
Object {
"height": 320,
"url": "https://i.scdn.co/image/ab67616100005174d1578a57ff89ac9aeed23863",
"width": 320,
},
Object {
"height": 160,
"url": "https://i.scdn.co/image/ab6761610000f178d1578a57ff89ac9aeed23863",
"width": 160,
},
],
"name": "DOXY",
"popularity": 14,
"type": "artist",
"uri": "spotify:artist:1MVFEpYdHtdV3k8Bgs79Pl",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/1HliyC4gHWRHHFy3CjR3Bp",
},
"followers": Object {
"href": null,
"total": 2,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/1HliyC4gHWRHHFy3CjR3Bp",
"id": "1HliyC4gHWRHHFy3CjR3Bp",
"images": Array [],
"name": "Doxy601",
"popularity": 5,
"type": "artist",
"uri": "spotify:artist:1HliyC4gHWRHHFy3CjR3Bp",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/7d8a8D8ZfVdYsuAcMk4Kxy",
},
"followers": Object {
"href": null,
"total": 97,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/7d8a8D8ZfVdYsuAcMk4Kxy",
"id": "7d8a8D8ZfVdYsuAcMk4Kxy",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b2736862f6dfd64d0c65d70c4623",
"width": 640,
},
Object {
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e026862f6dfd64d0c65d70c4623",
"width": 300,
},
Object {
"height": 64,
"url": "https://i.scdn.co/image/ab67616d000048516862f6dfd64d0c65d70c4623",
"width": 64,
},
],
"name": "Miles Davis & Milt Jackson",
"popularity": 5,
"type": "artist",
"uri": "spotify:artist:7d8a8D8ZfVdYsuAcMk4Kxy",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/6NrhhuvYUPDmZ7RiZAWQih",
},
"followers": Object {
"href": null,
"total": 546,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/6NrhhuvYUPDmZ7RiZAWQih",
"id": "6NrhhuvYUPDmZ7RiZAWQih",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab6761610000e5ebe2cae73d43e39e83aebc2bf5",
"width": 640,
},
Object {
"height": 320,
"url": "https://i.scdn.co/image/ab67616100005174e2cae73d43e39e83aebc2bf5",
"width": 320,
},
Object {
"height": 160,
"url": "https://i.scdn.co/image/ab6761610000f178e2cae73d43e39e83aebc2bf5",
"width": 160,
},
],
"name": "DOX",
"popularity": 25,
"type": "artist",
"uri": "spotify:artist:6NrhhuvYUPDmZ7RiZAWQih",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/6792Ts7YzD8dhGkgSHPNEL",
},
"followers": Object {
"href": null,
"total": 125,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/6792Ts7YzD8dhGkgSHPNEL",
"id": "6792Ts7YzD8dhGkgSHPNEL",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b273e2318a139e0f022870baac23",
"width": 640,
},
Object {
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e02e2318a139e0f022870baac23",
"width": 300,
},
Object {
"height": 64,
"url": "https://i.scdn.co/image/ab67616d00004851e2318a139e0f022870baac23",
"width": 64,
},
],
"name": "Miles Davis And Milt Jackson Sextet",
"popularity": 1,
"type": "artist",
"uri": "spotify:artist:6792Ts7YzD8dhGkgSHPNEL",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/2b69LpXVfEagXEJpHjj3vW",
},
"followers": Object {
"href": null,
"total": 10,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/2b69LpXVfEagXEJpHjj3vW",
"id": "2b69LpXVfEagXEJpHjj3vW",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab6761610000e5eb634c7182d6152094085cf475",
"width": 640,
},
Object {
"height": 320,
"url": "https://i.scdn.co/image/ab67616100005174634c7182d6152094085cf475",
"width": 320,
},
Object {
"height": 160,
"url": "https://i.scdn.co/image/ab6761610000f178634c7182d6152094085cf475",
"width": 160,
},
],
"name": "XODUS MMXXI",
"popularity": 12,
"type": "artist",
"uri": "spotify:artist:2b69LpXVfEagXEJpHjj3vW",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/1IhDCe20UkuG9o00cnhvS8",
},
"followers": Object {
"href": null,
"total": 106,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/1IhDCe20UkuG9o00cnhvS8",
"id": "1IhDCe20UkuG9o00cnhvS8",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b273802c20b22f713bf4ca551ea9",
"width": 640,
},
Object {
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e02802c20b22f713bf4ca551ea9",
"width": 300,
},
Object {
"height": 64,
"url": "https://i.scdn.co/image/ab67616d00004851802c20b22f713bf4ca551ea9",
"width": 64,
},
],
"name": "Doxi",
"popularity": 11,
"type": "artist",
"uri": "spotify:artist:1IhDCe20UkuG9o00cnhvS8",
},
Object {
"external_urls": Object {
"spotify": "https://open.spotify.com/artist/0joBZjd7WSxAGlRC2pvaJM",
},
"followers": Object {
"href": null,
"total": 0,
},
"genres": Array [],
"href": "https://api.spotify.com/v1/artists/0joBZjd7WSxAGlRC2pvaJM",
"id": "0joBZjd7WSxAGlRC2pvaJM",
"images": Array [
Object {
"height": 640,
"url": "https://i.scdn.co/image/ab67616d0000b27375b17d2e3f94ae1bddd65046",
"width": 640,
},
Object {
"height": 300,
"url": "https://i.scdn.co/image/ab67616d00001e0275b17d2e3f94ae1bddd65046",
"width": 300,
},
Object {
"height": 64,
"url": "https://i.scdn.co/image/ab67616d0000485175b17d2e3f94ae1bddd65046",
"width": 64,
},
],
"name": "Prod.Dozy",
"popularity": 1,
"type": "artist",
"uri": "spotify:artist:0joBZjd7WSxAGlRC2pvaJM",
},
`
I did this to map data {items.map((data,i)=>({data.name}))}
I do this and it works but I want also to get the first image for each item can I do two maps inside each other ??
but how I can get these data with the first image for every item
You can load multiple items from an array using just one map.
To get the first image of every item you'll have to access the first item from the image array [0] and from that image you'll need the url to fill the source property of an <Image/> component (from React Native). You'll also need to supply the width and height to the style property like so:
{items.map((data) => ( <>
<Image style={{width: `${data.images[0].width}`, height: `${data.images[0].height}` }} source={require(`${data.images[0].url}`)}/>
<div>{data.name}</div> </>))}
I also wrapped Image and div in a React fragment: <></>

How I print a value from response (React Native)?

How do I print the URI value from this response?
Response = {"assets": [{"fileName": "rn_image_picker_lib_temp73410.jpg", "fileSize": 208402, "height": 1280, "type": "image/jpeg", "uri": "file:///data/user/0/com.react/cache/rn_image_picker_lib_temp73410.jpg", "width": 1028}]}
You can achieve it doing like this:
let Response = {
"assets": [
{
"fileName": "rn_image_picker_lib_temp73410.jpg",
"fileSize": 208402,
"height": 1280,
"type": "image/jpeg",
"uri": "file:///data/user/0/com.react/cache/rn_image_picker_lib_temp73410.jpg",
"width": 1028
}
]
}
Response.assets[0].uri

Query Wiktionary only returns few words

I'm trying to get all spanish nouns from Wiktionary. I only need the titles, not the meaning of each word. Following other similar posts, I tried this query:
https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Spanish_nouns&cmprop=title
But it only returns the 10 first:
{
"batchcomplete": "",
"continue": {
"cmcontinue": "page|4142414345524f0a4142414345524f|1173240",
"continue": "-||"
},
"query": {
"categorymembers": [{
"ns": 0,
"title": "aaleniano"
},
{
"ns": 0,
"title": "ab."
},
{
"ns": 0,
"title": "ababa"
},
{
"ns": 0,
"title": "abab\u00e1bite"
},
{
"ns": 0,
"title": "ababol"
},
{
"ns": 0,
"title": "abac\u00e1"
},
{
"ns": 0,
"title": "abacalera"
},
{
"ns": 0,
"title": "abacalero"
},
{
"ns": 0,
"title": "abacera"
},
{
"ns": 0,
"title": "abacer\u00eda"
}
]
}
}
What should I do to get all the noun title's from A to Z?
You have to forward the value of cmcontinue to the next call as query parameter, in your case it would be cmcontinue=page|4142414345524f0a4142414345524f|1173240 :
https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Spanish_nouns&cmprop=title&cmcontinue=page|4142414345524f0a4142414345524f|1173240
Check the api result
Also, from this doc, you can set cmlimit=max in order to get the maximum result you can get for a single call. So the first call would be :
https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Spanish_nouns&cmprop=title&cmlimit=max
Then, using cmcontinue:
https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Spanish_nouns&cmprop=title&cmlimit=max&cmcontinue=page|41434943414c41445552410a41434943414c4144555241|4536720

Decode bitcoin transaction vin address

I'm building a graph of blockchain transactions and have a problem to extract source address for a transaction (output addresses are easy,bundled in the getrawtransaction result).
for example this transaction https://www.blockchain.com/btc/tx/8d787db12e04630a10191772f068fae43d30fbb93e6198e7efa636ce03f16222?show_adv=true
the getrawtransaction has an output of
{
"result": {
"txid": "8d787db12e04630a10191772f068fae43d30fbb93e6198e7efa636ce03f16222",
"hash": "7a0a667bf96d65a11eeab8ec17e232c5afdbe724b6e5e60697790bde3037c2c8",
"version": 2,
"size": 248,
"vsize": 166,
"weight": 662,
"locktime": 597359,
"vin": [
{
"txid": "2a1dda8fb17cdcefb26a377492aff6076bd03a93f742d595df1d0ff4951a4305",
"vout": 0,
"scriptSig": {
"asm": "00140d9cad5ccd91bf6ed56ec6bcb7762ec52ecb7b8d",
"hex": "1600140d9cad5ccd91bf6ed56ec6bcb7762ec52ecb7b8d"
},
"txinwitness": [
"3045022100f2900ede33aab8838464cfb127a962960c29cd97ba62e830c69a38621514d2980220706aa5c28d6e1a134f74b99e6280b357dc1f20ae00f4fcca12ab4ccfab5ceac701",
"033b18a261c30edaf859dc523700f3a6085a413ab51b4f63ca84d26073e8e7c709"
],
"sequence": 4294967294
}
],
"vout": [
{
"value": 0.16957303,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 d45c146bdb6ad9c61f3300341e2524e8e64394ac OP_EQUAL",
"hex": "a914d45c146bdb6ad9c61f3300341e2524e8e64394ac87",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"3M3sV2VBqPXzZHkbdBXo9dMpEw7xxHCFow"
]
}
},
{
"value": 0.07866618,
"n": 1,
"scriptPubKey": {
"asm": "OP_HASH160 69f37417a9fb77744ec258ac2ff22e99266ac354 OP_EQUAL",
"hex": "a91469f37417a9fb77744ec258ac2ff22e99266ac35487",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"3BMEX8XxUxyEKfRDAJmSMhyd3Y7QWh7PQV"
]
}
}
],
"hex": "0200000000010105431a95f40f1ddf95d542f7933ad06b07f6af9274376ab2efdc7cb18fda1d2a00000000171600140d9cad5ccd91bf6ed56ec6bcb7762ec52ecb7b8dfeffffff0277bf02010000000017a914d45c146bdb6ad9c61f3300341e2524e8e64394ac87fa0878000000000017a91469f37417a9fb77744ec258ac2ff22e99266ac3548702483045022100f2900ede33aab8838464cfb127a962960c29cd97ba62e830c69a38621514d2980220706aa5c28d6e1a134f74b99e6280b357dc1f20ae00f4fcca12ab4ccfab5ceac70121033b18a261c30edaf859dc523700f3a6085a413ab51b4f63ca84d26073e8e7c7096f1d0900",
"blockhash": "00000000000000000002726a175241b0f200c561daf30c668d8652cf3b949343",
"confirmations": 18,
"time": 1569914555,
"blocktime": 1569914555
},
"error": null,
"id": null
}
the source address per blockchain explorer is 36UuEDoDQX5JppSVnpaccV5DCKiquRyPxB. Was not able to derive it from any of the vin fields.
You can decode scriptSig to get the address.
There is a RPC call in bitcoin core that can help you achieve this: decodescript.