Skip to content

Instantly share code, notes, and snippets.

@badrazizi
Last active May 1, 2024 20:53
Show Gist options
  • Save badrazizi/7aaa85b0de59eea50cdd13e50a90b8bc to your computer and use it in GitHub Desktop.
Save badrazizi/7aaa85b0de59eea50cdd13e50a90b8bc to your computer and use it in GitHub Desktop.
javascripts Extract OK.RU Video Links
/**
*
* 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)
});
}
@hoangvu12
Copy link

The API works but the video not worked as expected. Thanks for sharing anyway.

@TDanks2000
Copy link

the link that is returned just returns a single number and status 400

@wawahuy
Copy link

wawahuy commented Nov 29, 2022

great

@nachat-ayoub
Copy link

nachat-ayoub commented May 1, 2024

works but it get the lowest quality. if anyone interested you can search for "Aniyomi-extensions" or "Cloudstream-3" on github and after opening the repo search for 'okru' or just 'ok' to find the folder extractors that has the ok.ru extractor file where the functionality is stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment