There is site which gets direct link to youtube server as for example if we visit the link
http://vimow.com/watch?v=TLM6e_slo7Q-Play-Xbox-in-a-WEB-BROWSER?---Inside-Gaming-Daily
now if we view the page source will notice that there is the following link in video src
https://r5---sn-npo7enel.c.docs.google.com/videoplayback?mt=1410551258&expire=1410572981&ratebypass=yes&key=yt5&signature=C3FB417A7FB4C61600553152F9FFB57E473C762B.8F451B015AF741FFE45777DB5CEF424E452D433F&fexp=914095%2C927622%2C931983%2C932404%2C934030%2C946023%2C947209%2C948205%2C953600%2C953801%2C955400&upn=nnZKYWtq7gU&pfa=20s&initcwndbps=12869000&id=o-AMzBGT7otDdEr3LZCZRZA1hv1-ovI_PTghQHLJWtmAGq&ipbits=0&source=youtube&ms=au&pm_type=static&pbr=yes&mm=31&ip=128.199.133.159&sver=3&mv=m&sparams=id%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmm%2Cms%2Cmv%2Cpbr%2Cpfa%2Cpm_type%2Cratebypass%2Csource%2Cupn%2Cexpire&itag=18
my question is that how they are getting that link from youtube ?
i searched youtube api but did not find any solution.
I've messaged you about your query. Check once. Since its not allowed as in terms of YouTube ToS, I can't disclose the method publically.
got o youtube choose your video and click share after that click include (or something like that i can see it in french soo..) it will genereate a link like this one embed it in your page :
<iframe width="560" height="315" src="//www.youtube.com/embed/YoB8t0B4jx4" frameborder="0" allowfullscreen></iframe>
or you can just make it (the iframe adding the url of the video look at src of the iframe abouve
I have got the solution for this problem.
Youtube videos are hosted in google's server.
So we need to find the root link to the video and we can just stream the video using any HTML player.
This is example of a link
https://r3---sn-npo7enee.c.docs.google.com/videoplayback?ms=au&source=youtube&mv=m&ip=128.199.175.59&initcwndbps=15683750&id=o-AOiPqW3plUekS9E0iFfUXJ6M6iuK8dAdvw0rtzBvFIMf&key=yt5&mm=31&ipbits=0&mt=1411445657&itag=18&sver=3&fexp=927622,930666,931983,932404,934030,936216,946023,947209,949408,952302,953801&upn=W8Os8snP-z8&sparams=id,initcwndbps,ip,ipbits,itag,mm,ms,mv,ratebypass,source,upn,expire&expire=1411467316&ratebypass=yes&signature=0F620B35EBCD3796509B9F72DC0EA15384721857.734B6A96DB834E600CEFBEF9305AA30E3F051A66
So i hope after getting this link you can easily stream a youtube video.
You can use youtube downloader which fetches the link using CURL.
A good script on github
https://github.com/jeckman/YouTube-Downloader
Using the script if you input the video id portion of any youtube video.
Example: youtube(dot)com/watch?v=Fw-BM-Mqgeg
It uses curl to fetch the video link and u can use the link to stream video in your site.
These movies are placed on Google Drive, and the link comes from there. See:
http://drive.google.com
For sharing details see:
https://support.google.com/drive/answer/2494822?hl=en&ref_topic=2525251
So, no, they're not from Youtube. There are API's for Google drive:
https://developers.google.com/drive/
For PHP see:
https://developers.google.com/drive/web/quickstart/quickstart-php
You'll have to familiarize yourself with this API before you can use it. The documentation by Google is far more than I could provide here.
The link you provided is a link in Google Drive. It has nothing to do with YouTube.
On another hand, if you're looking to embed YouTube videos in your website, then this will help you: https://developers.google.com/youtube/youtube_player_demo
If you want to stream a video while it occurs ("live streaming" or live coverage), then you need to use a special server which supports live streaming:
You can use the YouTube Live API: https://developers.google.com/youtube/v3/live/
You can use LiveSteam: http://new.livestream.com/
and there's many other streaming services
Keep in mind that you need a videocam which supports streaming services, or you should link the videocam to your computer. It depends on the streaming service you're using.
Related
I am using YouTube Data API(v3) for accessing data of youtube.
I search a lot how can I play a video in PHP using this API, but I couldn't find anything.
I know there is a way to play YouTube videos.
Embed a video
Using iFrame
However, YouTube is blocked in region I live, which means I can't use any method from them.
Are there any workarounds?
For instance, playit.pk can play videos even if region is blocked.
UPDATE
how can playit.pk access YouTube video URL like.
https://r2---sn-npo7en7d.c.doc-0-0-sj.sj.googleusercontent.com/videoplayback?upn=yS-T9e4J_3o&id=15589d4018f319ea&mime=video/mp4&mm=31&mn=sn-npo7en7d&ms=au&mt=1444897255&mv=m&ip=2400:6180:0:d0::27:f001&key=yt6&initcwndbps=13453750&ipbits=0&ratebypass=yes&sver=3&signature=A365AA3ADA506748AE53F0493B34E4B4AE807DCC.9F8EB21E86E4F5682BFFD44768102434DA58341B&fexp=9405958,9408710,9413271,9414764,9416126,9416359,9417707,9418204,9418400,9418809,9418997,9419837,9420351,9421923,9422553&nh=IgpwcjAxLnNpbjAzKgkxMjcuMC4wLjE&expire=1444918985&sparams=dur,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,nh,pl,ratebypass,requiressl,source,upn,expire&source=youtube&dur=408.090&itag=18&pl=48&requiressl=yes&lmt=1434858572379608
If I found this kind of url I can play video very easily.
Can i access that kind of URL using api v3 if not then how can they do that.
Have php script that generates stream urls from youtube video id.
Here is link I am using:
http://www.youtube.com/get_video_info?el=detailpage&asv=3&video_id={video_id}
I get url_encoded_fmt_stream_mapfrom this link and decode it to get urls. If video is using cipher signature then I decode it and generate working urls.
It works for all cases except regional restriction. My server is located in US and can't get video stream blocked in US.
For example:
This video https://www.youtube.com/watch?v=DrCI35uAqiw is blocked in US so I am getting this error from get_video_info :
reason=This+video+contains+content+from+Wediacorp%2C+who+has+blocked+it+in+your+country+on+copyright+grounds.&errordetail=0&errorcode=150&status=fail
If you have any solutions please share.
Thanks,
Shota.
Disclaimer :
You really should only use this method for accessing your own
video file content (like if Youtube holds a backup copy). If you just
take any multiple videos, you risk closing this option for all of us.
Morality rant over...
Instead of: http://www.youtube.com/get_video_info?el=detailpage&asv=3&video_id=video_id
Try this instead: http://www.youtube.com/get_video_info?&video_id=DrCI35uAqiw
Is there a way to get the direct download link of a vimeo video using PHP vimeo API?
I tried this stackoverflow answer, but moogaloop's links don't work. It has be more than a year since Vimeo updated their API.
Is there any way to get a direct link/downloading videos through API/PHP.
For Vimeo PRO Account:
You can get the direct link for any video or all videos in your account. To get the download link for all videos you have to call the following API with your access token.
GET https://api.vimeo.com/me/videos
or you can get the download link for a single video by calling the following API
https://api.vimeo.com/me/videos/{video_id}
In responses, you can find download['link']
For more information go to
Vimeo API Documentation
What I want to do is, to show uploaded videos list of my youtube channel to website's visitors.
Something like that. (Image take from youtube channel, I want to show exactly this way)
Don't want to create iframe. Can I fetch data from channels exact page with PHP or something else? I have no idea if it's possible with youtube api. Any suggestions?
Yes you can. The videos on a channel are essentially a user's so using the YouTube GData API you can make a call to http://gdata.youtube.com/feeds/api/videos?author=ahmednuaman (my videos for example).
I am working on a video listing website which uses JW Player and its plugins. Embed code of the video can be placed anywhere in the web but we need to track which video plays in which site and its count of views and plays.
We are using Google Analytics Pro plugin for JW Player to track the traffic. But is there any way for me to track the report to
See all the sites that the player is embedded on to see how many people played the video from that site
How many plays are done for each video from from these sites
Exactly which videos are played
Currently we are using following code inside JW Player
s1.addVariable('gapro.accountid', 'UA-21590286-1');
//alert(this.data.captions[this.slide])
s1.addVariable("gapro.trackstarts","true");
s1.addVariable("gapro.trackpercentage","true");
s1.addVariable("gapro.tracktime","true");
s1.addVariable("gapro.idstring","||Channel Name||-||Story Name||");
Following is a sample embed code for playing a video..
Thanks in advance for the support.
Best Regards
Deepu S Nath
The JW GA plug-in should report which site is hosting the player in the Hostname parameter.
1/ Check that when you play a video on your player embedded on a site, a GIF request is sent to google-analytics.com :
http://www.google-analytics.com/__utm.gif?
utmwv=4.9.2&utms=2&utmn=1209321314&
utmhn=www.longtailvideo.com&utmt=event&
utme=5(Video%20Plays*http%3A%2F%2Fcontent.longtailvideo.com%2Fvideos%2Fbunny.flv*
http%3A%2F%2Fwww.longtailvideo.com%2Faddons%2Fplugins%2F107%2Fget-examples.html%3Faddon%3D107%26vid%3D292%26q%3D)
(I have truncated the request which should be much longer).
2/ Confirm that the utmhn value reported is the hostname of the site where the player is hosted. It looks like the JW player plug in reports the Video Play as an Event where the Category is Play, Action is the file source URL and Label is the URL where the video is played.
3/ In Google Analytics, look for a report displaying Event Labels by Hostnames (or create it using a custom report). You should use a filter to view only Event Label = "Video Plays".
This should show you how many plays you had from each site. You can use similar reports to view which video were player from each site (using Event Action).
On a final note, I do not think that the JW player is tracking 'Load' events - when the player is loaded, so you won't see if a player was loaded but no video played. You can confirm by checking if a GIF request is sent when the player is loaded.
I just found that there is no direct solution for my requirement using the google pro plugin.. Instead we implemented a custom solution as follows..
Created a custom Tracker which uses the google analytics APIs directly instead of "Google Analytics Pro" plugin. For that I have Utilized the JWplayer API to interact with the video player and get the video related data and it was be passed to the Google Analytics API. Later in the Google Analytics account, created a custom report with the required metrics and dimensions.. This helped me to get all the tracking details and create the required report. :) I really appreciate the support I got from Antoine which helped me to understand some basics and move towards a solution.
I just checked your site and found that the embed code consists of iFrame and this is the reason why you are unable to track the hostname at which the embed video gets played.As you are using iframes in the embed video code, you wont be able to track the site details were the video is embedded. You always get storybridge.tv as the site url. (iFrame do not support cross domain interaction)
To avoid this problem we have to use tag (Similar to old Youtube Embed Code) which will help the plugin to get the details of the site at which video is played.