I am trying to play youtube video in my application. everything works fine. but when i am trying to watch video that contains content from youtube. it fails.
I researched found one think that you should encrypt and decrypt signature and add this to the URL?
I dont know how to decrypt signature
in IOS?
http://www.youtube.com/get_video_info?video_id=uuZE_IRwLNI&el=vevo&ps=default&eurl=&gl=US&hl=en
stream
{
"fallback_host" = "tc.v12.cache7.googlevideo.com";
itag = 22;
quality = hd720;
s = "8E6E5D13EB65FB653B173B94CB0BCC3A20853F5EDE8.5E2E87DF33EEDE165FEA90109D3C7D5DADA06B6BB60";
type = "video/mp4; codecs=\"avc1.64001F, mp4a.40.2\"";
url = "http://r7---sn-cvh7zn7r.googlevideo.com/videoplayback?pcm2fr=yes&sver=3&expire=1393773646&itag=22&id=bae644fc84702cd2&upn=SjZd81MudQs&sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cpcm2fr%2Cratebypass%2Csource%2Cupn%2Cexpire&ms=au&gcr=in&mt=1393747698&source=youtube&ratebypass=yes&ipbits=0&fexp=935620%2C919120%2C912523%2C932288%2C914084%2C916626%2C937417%2C937416%2C913434%2C932289%2C936910%2C936913%2C902907&mv=m&key=yt5&ip=103.250.162.79";
}
When i use url
its not playing. is there any solution?
The XCDYouTubeKit library does this with a very simple API for you to use.
Disclaimer: I’m the author of XCDYouTubeKit.
A little shameless self promotion, I spent the last few weeks figuring out how the alternative JavaScript and perl versions of software did this, initially used JavaScriptCore to accomplish it, but decided I wanted a pure obj-C sample, so I made one myself. There is exhaustive commenting on how it all works in the main file.
https://github.com/lechium/yourTube/blob/master/yourTube/KBYourTube.m
Will return
This should be able to fully supplant any way you are currently getting details about a video for download / playback purposes and takes care of the signature deciphering for you. You could also pretty easily modify the code to JUST use it for signature deciphering (but you would need to take care to use the proper timestamp value when using get_video_info).
You can't just use
get_video_info
data alone, you also need to download the main video page in order to see whichhtml5player-XXXXX.js
javascript file is loaded. This will dictate which permutations are needed. See http://www.jwz.org/hacks/youtubedown (written in Perl) as an example -- skip to the section that says "This is not crypto or a hash, just a character-rearrangement cipher. Total security through obscurity. Total dick move.", which is a sentiment I heartily concur with.