How to get .stream_hls_url of any video? - dailymotion-api

For example http://www.dailymotion.com/video/x61t5f7
HLS video url for video id "x61t5f7" :
http://proxy-079.dc3.dailymotion.com/sec(f4590cdd8be1b6d27cdbb3816c862f1b)/video/327/638/365836723_mp4_h264_aac.m3u8
How to extract this stream_hls_url? Any sample program is there it will be helpful.
The code which we tried is as below,
https://api.dailymotion.com/video/x6bdwlu?fields=id,title,stream_hls_url
We are getting error response as below,
we are getting error response like below, {"error":{"more_info":"https://developer.dailymotion.com/‌​api#error-codes","co‌​de":403,"message":"I‌​nsufficient rights for the fields' parameter of route GET /video/' with value `stream_hls_url'. Required roles: can-read-video-streams, can-read-my-video-streams","type":"access_forbidden"}}

You should try this api
https://www.dailymotion.com/player/metadata/video/<VIDEO_ID>?embedder=
There is a "qualities" object which have a url, get a .m3u8 file from this url. This file contain all HLS Video urls of different qualities.

Related

How to get users's photo using Microsoft Graph?

I have sent a request to Microsoft Graph, to get the photo from the user.
It looks like this --GET https://graph.microsoft.com/v1.0/users/USER_ID/photo/$value
I get, as a response, binary format of an image, and as doc suggests I made blob object,
like this.
Type od data(from image) that I recieve, I set to be ng.HttpPromise.
I get url, that I set for image src (in html), but photo isn't showing, and I don't have any Error popped up.
To get a user's photo using Graph, use: https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/photo/$value.
From the sample shared(see below) I can see a minor mistake:
Once the response completes, you need to call data.blob() which returns a promise containing the blob, which you can then pass to createObjectUrl after resolution.
this.videoEventServie.getPersonPhoto(contact).then(data => {
return data.blob();
}).then(function(currentBlob){
var src= URL.createObjectURL(currentBlob);
myImage.photoUrl = src;
});
Please see this answer: Using JavaScript to display a Blob for additional context.

IPTV: I'm can't get Stream URL

I'm creating a list with channel IPTV (Brazilian channels) for i use in my house.
I'm tryng to get a stream of an channel from url Using URLHelper, but not success.
URL With Stream
Before using URLHelper to get stream:
rtmp://31.204.151.253/live?wmsAuthSign=c2VydmVyX3RpbWU9MS8xMi8yMDE3IDY6MDc6MTUgUE0maGFzaF92YWx1ZT1Kd1YrL3g5elRML0FtSUVsek1TRk1RPT0mdmFsaWRtaW51dGVzPTIw<playpath>master77_1 <swfUrl>http://www.tv-msn.com/player/player.swf <pageUrl>http://tv-msn.com/TNT.php
Now, before editions to write in M3u List
rtmp://31.204.151.253/live/ playpath=master77_1 swfUrl=http://www.tv-msn.com/player/player.swf pageUrl=http://tv-msn.com/TNT.php - Not worket
And before, i writed a token (is in sfwUrl)
rtmp://31.204.151.253/live/ playpath=master77_1 swfUrl=http://www.tv-msn.com/player/player.swf pageUrl=http://tv-msn.com/TNT.php token=estoudevolta
And the stream URL aren't working, but in URL with stream working.
How to put to work??

Resolving two types of YouTube channel URLs in API v3

I'm taking a youtube url as user input.
The logic I have is as follows:
if(URL === link_to_video) then get video
else if( URL == link_to_channel) then get all_videos_of_channel.
I am doing this via JavaScript and using the YouTube API v3.
The problem is, it seems youtube has two types of URLs to youtube channels.
/channel/, eg:
www.youtube.com/channel/UCaHNFIob5Ixv74f5on3lvIw
/user/,
eg: www.youtube.com/user/CalvinHarrisVEVO
both the above links will take you to the same channel, but my current uploader code supports only /user/CalvinHarrisVEVO.
is there any way to make both the URLs behave similarly in terms of obtaining the channel videos?
One solution would be to parse the url and then apply this logic:
if there is `channel` in the url link
call the APIv3 with the **id** of the channel
Ressource : youtube.channels.list
else if there is 'user'
call the APIv3 with the **forUsername** of the channel
Ressource : youtube.channels.list
Check : https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list

YouTube v3 API (.NET) - Get URI of newly posted video resource?

After scouring the v3 API documentation (and using the API explorer), I am not able to determine how to obtain the URI of a newly uploaded video resource (or any video resource).
I am aware that the video's ID is readily available and it is trivial to construct a URI from the ID. For example, I have this extension method:
public static Uri GetUri(this Video video)
{
var uriBuilder = new UriBuilder
{
Scheme = Uri.UriSchemeHttp,
Host = "youtu.be",
Path = video.Id,
};
return uriBuilder.Uri;
}
However, it seems strange that the video resource would not include a few different URLs (regular, shortened and embed-able come to mind).
I also recognize I am probably over thinking this because the only volatile part of the URL is the video ID. I guess I could always put the host name in a config file :)
Thoughts and comments are appreciated.
Regards,
You can get the video ID from the upload response once your request is executed.
YouTube API samples have a great upload example for this.
Once you have the video id, you can construct the full URL as
youtube.com/watch?v={video_id}
youtu.be/{video_id}

YouTube API V3 recordingDetails object missing in the response

I have tried this YouTube API v3 call from curl today:
http://www.googleapis.com/youtube/v3/videos?id=ZCJgvabihQ8&key=apiKey&part=snippet,recordingDetails
Everything else is fine, but I didn't find the recordingDetails object in the response json:
{
"kind":"youtube#videoListResponse",
"etag":"\"oLweQuB9Vh7wAB9a0AIHg_K-wsM/EuRsJ-sxI3qstP1T58S5Qnb_NIg\"",
"items":[
{
"id":"ZCJgvabihQ8",
"kind":"youtube#video",
"etag":"\"oLweQuB9Vh7wAB9a0AIHg_K-wsM/CYNTRL05S4okPzkUfE5LbrRKt9g\"",
"snippet":{
"publishedAt":"2013-01-25T13:36:19.000Z",
"channelId":"UCpVm7bg6pXKo1Pr6k5kxG9A",
"title":"Weird Nature: Pink Dolphins?",
"description":"Up to 9 feet long and weighing up to 300 pounds, pink river dolphins are the largest freshwater dolphins in the world.",
"thumbnails":{
"default":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/default.jpg"
},
"medium":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/mqdefault.jpg"
},
"high":{
"url":"https://i.ytimg.com/vi/ZCJgvabihQ8/hqdefault.jpg"
}
},
"categoryId":"24"
}
}
]
}
Is there anything I missed? Many thanks.
recordingDetails is not public for all videos, so if a video doesn't have these attributes available, nothing will be returned. By not returning anything, YouTube saves bandwidth and the response time can be faster.
Original reponse:
This looks like a legitimate bug...
recordingDetails is listed as an option on the videos resource
overview page, but not listed as a valid part in the video list method
here: https://developers.google.com/youtube/v3/docs/videos/list
Normally when you try using an invalid part you get a "400 Bad
Request" error, but recordingDetails still returns a 200 response, so
it looks like it really is supposed to be returned...
You should submit a bug report here:
https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Defect%20Report)
recordingDetails will only be returned for videos that explicitly have either the geolocation or the recording time set.
(Not all videos set recording time; it's a distinct piece of metadata from publication time.)
You can do a list call to retrieve a list of videos based on a location and locationRadius.
Then, with the returned list you can do a videos call including all video IDs in the id parameter of the query. You can then specify recordingDetails as "part" and it will work.
This is how Youtube does it here:
https://github.com/youtube/geo-search-tool

Resources