cannot access the download url

Questions and discussion concerning archiving

cannot access the download url

Postby idejuan » Wed May 30, 2012 12:20 pm

Hello,

I am obtaining the url to download my video using the "moderator_token".

The url seems well formed, something like this: https://staging.tokbox.com/hl/archive/u ... 8222b63f78

when I access this web, I get the following error: <Errors><error code="403"><notAuthorized message="Invalid credentials passed"/></error></Errors>

In the instructions "Downloading archive videos" here http://www.tokbox.com/opentok/api/tools ... glang=ruby

it does not say that authentication is needed in order to download the url... unless you use the RESTful web service

how do I pass the credentials? is this not a url that anybody could use? how can I create a url that anybody can download?

thanks for your help
Was this post helpful? (0)
idejuan
 
Posts: 10
Joined: Wed May 30, 2012 12:12 pm
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Wed May 30, 2012 4:14 pm

When you pass in the that url, you still have to send http headers "x-tb-token-auth" with the value of a moderator token. After that you will get the download link where you can goto in your browser to download the flv.

John
Was this post helpful? (1)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby idejuan » Thu May 31, 2012 12:41 am

thank you John for your help, now I got it right!

Ignacio
Was this post helpful? (0)
idejuan
 
Posts: 10
Joined: Wed May 30, 2012 12:12 pm
Thumbs Up: 0

Re: cannot access the download url

Postby spreeze » Fri Jul 27, 2012 12:27 am

jtsai wrote:When you pass in the that url, you still have to send http headers "x-tb-token-auth" with the value of a moderator token. After that you will get the download link where you can goto in your browser to download the flv.

John

I have got the download link https://s3.amazonaws.com/tokbox.com.sta ... KO7NEZ4N3Q
and the flv do can be download in browser.
but when I download it with java code 403 error occurs "Server returned HTTP response code: 403 for URL:...."
My code is as following
URL url = new URL("https://s3.amazonaws.com/tokbox.com.staging/1551561/fd0ca7ff-5099-4075-98b0-32b69767d3c0/3a13add0-116a-4c93-b8a6-51690a010809.flv?Signature=NcgxSzxi5VfQ%2FE%2Fy4LKPwGWp6GE%3D&Expires=1343295276&AWSAccessKeyId=AKIAI7IKEYKO7NEZ4N3Q");
URLConnection c = url.openConnection();
InputStream is = c.getInputStream();
Was this post helpful? (0)
spreeze
 
Posts: 3
Joined: Fri Jul 27, 2012 12:11 am
Thumbs Up: 0

Re: cannot download flv on server side with java

Postby spreeze » Fri Jul 27, 2012 12:33 am

I have got the download link https://s3.amazonaws.com/tokbox.com.sta ... KO7NEZ4N3Q
and the flv do can be download in browser.
but when I download it with java code 403 error occurs "Server returned HTTP response code: 403 for URL:...."
My code is as following
URL url = new URL("https://s3.amazonaws.com/tokbox.com.staging/1551561/fd0ca7ff-5099-4075-98b0-32b69767d3c0/3a13add0-116a-4c93-b8a6-51690a010809.flv?Signature=NcgxSzxi5VfQ%2FE%2Fy4LKPwGWp6GE%3D&Expires=1343295276&AWSAccessKeyId=AKIAI7IKEYKO7NEZ4N3Q");
URLConnection c = url.openConnection();
InputStream is = c.getInputStream();
Was this post helpful? (0)
spreeze
 
Posts: 3
Joined: Fri Jul 27, 2012 12:11 am
Thumbs Up: 0

Re: cannot access the download url

Postby spreeze » Mon Jul 30, 2012 2:54 am

resovled as following

public static void main(String args[]) throws Exception {

InputStream is = getStream("https://s3.amazonaws.com/tokbox.com.staging/1551561/5119425e-7560-4c30-92c6-83cc200245f6/f59a457d-f0e4-4d9d-a6c7-f9e907ea58ca.flv?Signature=uIpH45%2Fmu6v9ucpm7IcbHrCCmk4%3D&Expires=1343639722&AWSAccessKeyId=AKIAI7IKEYKO7NEZ4N3Q");
File file=new File("d:/test.flv");
OutputStream os=null;
try{
os=new FileOutputStream(file);
byte buffer[]=new byte[4*1024];
int len = 0;
while((len = is.read(buffer)) != -1)
{
os.write(buffer,0,len);

}
os.flush();
}
catch(Exception e){
e.printStackTrace();
}
finally{
try{
os.close();
}
catch(Exception e){
e.printStackTrace();
}
}


}
Was this post helpful? (0)
spreeze
 
Posts: 3
Joined: Fri Jul 27, 2012 12:11 am
Thumbs Up: 0

Re: cannot access the download url

Postby janine » Mon Jul 30, 2012 7:33 am

Thanks for letting us know!
Was this post helpful? (0)
janine
 
Posts: 1698
Joined: Thu May 05, 2011 7:10 pm
Thumbs Up: 20

Re: cannot access the download url

Postby rimple » Sun Oct 21, 2012 11:02 pm

Hey Spreeze,

i want help from you.
when i try to access this "https://api.opentok.com/hl/archive/getmanifest/" + archiveid.ToString()" to get video got an error
"Archive 3fd324e8-e313-4034-a84e-1a6e9b0768ce not found" in production.
so can you please reply asap..?
Was this post helpful? (0)
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Mon Oct 22, 2012 10:29 am

rimple wrote:Hey Spreeze,

i want help from you.
when i try to access this "https://api.opentok.com/hl/archive/getmanifest/" + archiveid.ToString()" to get video got an error
"Archive 3fd324e8-e313-4034-a84e-1a6e9b0768ce not found" in production.
so can you please reply asap..?


Hi there

Could you make sure that the token you are using is valid? You should make sure that it is a moderator token and that the api key matches the one you created the archive with.

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Tue Oct 23, 2012 4:54 am

hi John
i would like to know that in my test application video functionality work fine..but in production environment not works proper..
and also like to know that our production support azure...so can you please let me know that there is any problem with azure for opentok or not?
We have follow this https://github.com/opentok/Opentok-.NET-SDK#generating-tokens sdk for video recording..
so can you please give us some guidence/help..asap... :cry:
Was this post helpful? (0)
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Thu Oct 25, 2012 9:59 am

I don't think any of us have experience with azure. However, it seems like your azure is not making the correct POST request. You can see how to give the right request from here: http://www.tokbox.com/opentok/api/tools ... t_api.html

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Fri Oct 26, 2012 1:12 am

hi john
i would like to know you that some time functionality works fine but more times it not works fine...so didn't get that why this occure...
when try to access the download url after stop recording got error "Manifiest<Errors><error code="404"><itemNotFound message="Archive 53cf05e5-e0cd-4c2a-b4b7-cdba0e010b17 not found"/></error></Errors>" in my application's production environment but which work fine in my local pc..

so can you please help us to solve this problem asap...?

Thanks
Was this post helpful? (0)
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Fri Oct 26, 2012 3:49 pm

Can you give me the token generated by azure that is causing this problem?

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Sun Oct 28, 2012 9:13 pm

Hi John

I got this error Manifiest<Errors><error code="404"><itemNotFound message="Archive 392fcf92-be76-4d44-be56-7ffd2cc535f5 not found"/></error></Errors> for session id = "1_MX4xMjQxNTAwMn4xMTEuOTAuMTcxLjg0flN1biBPY3QgMjggMjE6MDY6MzIgUERUIDIwMTJ-MC4yMjQ0NjYxNX4"
token = "T1==cGFydG5lcl9pZD0xMjQxNTAwMiZzZGtfdmVyc2lvbj10YmRvdG5ldCZzaWc9MDNlMmI0NDczMjRhZWUyZmI4YTliZDMwODUzYWVkZDljMDIzZWUxNTpyb2xlPW1vZGVyYXRvciZzZXNzaW9uX2lkPTFfTVg0eE1qUXhOVEF3TW40eE1URXVPVEF1TVRjeExqZzBmbE4xYmlCUFkzUWdNamdnTWpFNk1EWTZNeklnVUVSVUlESXdNVEotTUM0eU1qUTBOall4Tlg0JmNyZWF0ZV90aW1lPTEzNTE0ODM1OTMmbm9uY2U9MzQzNjA4"

and also I would like to know you that we generate new session id and toke for each and every recording...

Thanks
Was this post helpful? (0)
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Mon Oct 29, 2012 10:48 am

How exactly are you getting the manifest?

I can get it from my rest client using the same credentials you have. Also, you don't need a session id to get a manifest.

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Mon Oct 29, 2012 11:12 pm

Hi John

Here I attached three files.
First one OpenTokSDK_Code text file shows that we have used this code to create session and token for video recording.
Second one Code.png file. The code in red colored box shows that we have used this code to create token and session id for video recording.
Third one is Error.png file. which shows the code to get manifest and in we have used archive id not session id to get manifest and the red colored box where we got error of archive not found.
I would like to mention again that in our local this code works proper but in our live environment of our application this throws the error of archive not found.
Again I would like to know that we used production environment of opentok.

So, please give me any hint to solve this problem asap...?

Thanks
Was this post helpful? (0)
Attachments
OpenTokSDK_Code.txt
This txt file shows the code of Open Tok .NET SDK that we used.
(6.55 KiB) Downloaded 242 times
Code.png
The content of this attachment shows the code that we have used to create token and session id for video recording.
Error.png
The content of this attachment shows the code that we have used to get manifest. The red colored box shows that here we get the error of archived not found.
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Tue Oct 30, 2012 1:53 pm

Rimple, that code looks good. I still think your production server configurations are off. Let me explain to you how to do it manually, and you can make sure that your server is doing the same thing.

1. Use Google Chrome
2. Download Advnaced Rest Client Application
3. Goto the application
4. Use the URL: https://api.opentok.com/hl/archive/getm ... 809bb7bd9d
5. Set the method to POST
6. Use the "Form" tab for the header
7. Put in "x-tb-token-auth" on the left side
8. Put in your token on the right side
9. Click "Send Request"
10. View the manifest

Hope this helps

John
Was this post helpful? (0)
Attachments
Screen Shot 2012-10-30 at 1.53.00 PM.png
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Wed Oct 31, 2012 2:17 am

Hi John

Thanks for your reply. By following the steps that you have mentioned we got manifest. It's really nice.
Here, I attached Manifest.png which shows that generating manifest from archive and token id.
Error.png file which shows our c# code to get manifest. The green colored box shows the code that we added according to your steps mentioned in your post (hopping that doing this we can slove our problem but not yet... :cry: )and
red colored box code where we got error of archive not found.

So, I would like to know you that still we got error of archive not found in live production of our application.

Thanks
Was this post helpful? (0)
Attachments
Manifest.PNG
Error.png
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Wed Oct 31, 2012 9:55 am

Ok Rimple

The best way to do this is to see what the differences between production and your testing environment are giving.

Do these:
1. Go to http://requestb.in/
2. Click "Create a RequestBin"
3. You will get an URL. Change your code to point to that URL instead of "api.opentok.com/hl/...."
4. Send the request from both environments you have (run your code with that url, then refresh the page on requestb.in)
5. Inspect both the header and body of the requests and see the difference

Let me know what you find

John
Was this post helpful? (0)
Attachments
Screen Shot 2012-10-31 at 9.54.55 AM.png
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Wed Oct 31, 2012 10:57 pm

Hi John

Here i attached some files. By following the steps that you mentioned i got the results but didn't understand about this so here i attached that.
File Body_local and Headers_local which shows the results that i got from my local application(from my pc) and also know that we dont
get "Get" method in local environment. Files Body_live and Headers_live which shows the results that i got from my live environment.
(In both case my tok box is in production environment)
File Error.png shows the change that you have mentioned in step no 3 (Change your code to point to that URL instead of "api.opentok.com/hl/....").


Thanks.
Was this post helpful? (0)
Attachments
Error.png
Body_local.png
This file shows the body section of that request for our local environment and in this i dont get "Get" method.
Headers_local.png
This file shows the headers section of that request for our local environment.
Body_live.png
This file shows the body section of that request for our live environment.
Headers_live.png
This file shows the headers section of that request for our live environment.
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Fri Nov 02, 2012 4:14 pm

Hi Rimple. I honestly do not know what is wrong with your production environment. I've shown you how to get the manifest manually. Also from the request bin, it seems like your servers are giving basically the same requests. Are you sure your production code is exactly the same as your testing environment?

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Sat Nov 03, 2012 1:12 am

Hi John

Yes, our production and testing code both are same.
I have run my application (both locally and live) in chrome and I have found Request and Response (from chrome developer tool)
for both (local and live) that attached here.
File Local.png which shows the result of the request and response in which red colored box in response header shows the Server: Microsoft-IIS/7.5.
File Live.png which shows the result of the request and response in which red colored box in response header shows the Server: Microsoft-IIS/7.0.


Thanks
Was this post helpful? (0)
Attachments
Local.png
File which shows the result of the request and response in which red colored box in response header shows the Server: Microsoft-IIS/7.5.
Live.png
File which shows the result of the request and response in which red colored box in response header shows the Server: Microsoft-IIS/7.0.
Last edited by rimple on Sat Nov 03, 2012 1:12 am, edited 1 time in total.
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0

Re: cannot access the download url

Postby jtsai » Mon Nov 05, 2012 12:41 pm

Maybe you should try upgrading your server to 7.5 and see if that works?

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195

Re: cannot access the download url

Postby rimple » Tue Nov 06, 2012 3:51 am

Hi John

I would like to know you that our application is uploaded using windows azure so that create application pool and all automatically on server
we don't have to create on live server so we can't do anything on server.

Thanks
Was this post helpful? (0)
rimple
 
Posts: 41
Joined: Wed Oct 17, 2012 4:21 am
Thumbs Up: 0


Return to [Beta] Archiving



Who is online

Users browsing this forum: No registered users and 1 guest

cron