Last active
May 8, 2025 18:23
-
-
Save badrazizi/7aaa85b0de59eea50cdd13e50a90b8bc to your computer and use it in GitHub Desktop.
javascripts Extract OK.RU Video Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* 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) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.