Can I get youtube video as mp3 sound in iOS ? - ios

as mentioned in the question
Can I get the youtube as sound file with any extension
I mean specifically with using JSON or any other way ?

One way to get songs from Youtube is to use their API, and search for your song. It will return a youtubeID url of video/song.
You can then stream this into an iOS app.
A handy framework to extract video url from youtube ID url, is LBYoutubePlayer which can be found here https://github.com/larcus94/LBYouTubeView
You would then need to extract the audio from the video.
Technically, that could all work. Not sure if it goes beyond Youtube's terms and services though.

Related

How do music service pages retrieve YouTube video URL?

Music sites like Playmoss and Submissionhub manage to retrieve the YouTube video file URL from the standard player watch URL. When a user pasts a YouTube URL like this into their service, the get the video file URL like this and save them in their system. This is necessary to later reproduce the media files with an external audio player like SoundManager2.
I learned that it's possible to retrieve the info from command line but that's impossible to do so from embedded YouTube videos.
Any idea how the mentioned sites manage to do that?
It is impossible (and illegal) to retrieve YouTube video URL. Music sites like the mentioned in the question seem to play YouTube files controlling the embedded videos. This can be done using Javascript as described here.

Youtube ios player helper can't play video

I am using this library https://github.com/youtube/youtube-ios-player-helper
in my project. The player works well if I use the video Id given by the sample (M7lc1UVf-VE). If I use the video Id from r random video on youtube it shows:
An error occurred, please try again later. Learn More
Do I need to enable a youtube data API or something like that???
cause I see another IOS Youtube helper needs to do so.
https://github.com/youtube/yt-direct-lite-iOS
Thanks.
add this in your playerVars #"origin" :#"http://www.youtube.com" it will work.
If you only want to play youtube video, no API access is needed.
I work on with this library without any error, did you replace "M7lc1UVf-VE" with the correct video id?

Get streaming URL from any YouTube video

I know about how to play video in device. But Here I just want to know that is it possible to get streaming URL from any YouTube Video? Then how can I do it, I tried to search on google but I can not able to find my solution.
Generally I does not want to play direct stream from video, actually I want to save this URL (stream) in my buffer memory OR whatever temporary file and whenever user click on particular button then particular URL Stream is play.
Al Last I got YouTube APIs + iPhone = Cool mobile apps. But I am not sure that it's helpful in my case or not ? If anybody who worked on this API then please suggest me, Otherwise How can I get streaming URL.
Your suggestion will be appreciated.
Thanks in advance.
http://www.youtube.com/get_video_info?&video_id={VIDEO_ID}
This will not work on all files, some will display the message "This+video+contains+content+from.....". But many will work.
Is it possible to get streaming URL from any YouTube Video? - No, it is not possible without hurting the terms of service of youtube. Google has built the business model of youtube around the advertisements all over youtube, in-video banners and video ads and they want your user to see their ads. This is the reason they completely hide the video stream and would ban your app if you anyway access and stream it directly.
The only consented way to play youtube videos on iOS is to embed it into an iframe of a web view.

How to play just the audio of YouTube Video?

In my app I have played a youtube video by embedding it, but how can i only play the audio of the video? I tried using AVAudioPlayer and use the videos url as the file path but it didnt work, any help?
No it is not possible, only one workaround is just to use a hidden UIWebView and play in that.
Youtube forbids playing audio only! here is the message from youtube
Your API Client will not, and You will not encourage or create functionality for Your users or other third parties to: "separate, isolate, or modify the audio or video components of any YouTube audiovisual content made available through the YouTube API"
-Kuan Yong, YouTube API Team

How to play video in streaming by using iOS GoogleDrive SDK?

I want to play video in streaming by using iOS GoogleDrive SDK.
GoogleDrive App in iOS app store can play video in streaming by YouTube.
I have seen this post:
http://apiblog.youtube.com/2009/02/youtube-apis-iphone-cool-mobile-apps.html
According to the post, the key of play video is the YouTube source link.
The link lists GoogleDrive's all of file properties:
https://developers.google.com/drive/v2/reference/files
All file's properties were tried to instead of the YouTube source link, but that doesn't work.
Could anyone tell me how to get the correct link to play video by YouTube?
Thank you very much.
You can the URL in the embedLink field to get a streaming player for the video.

Resources