/**
*
* ok.ru links work with header User-Agent Gecko
* 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
* i tried chrome and webkit both does not work
*
*/
const $ = require('jquery');
// Extract OK.RU Links
function OKRU(link, callback) {
link = "https://ok.ru/dk?cmd=videoPlayerMetadata&mid=" + link.substr(link.lastIndexOf('/') + 1);
$.post(link)
.done(function(data, status) {
if (data.error) {
callback(data.error);
return;
}
callback(data.videos);
})
.fail(function(data, status) {
callback(status)
});
}
0 Comments