A complete nodejs API to extract streaming sites video direct URLs
Here is an Android Simple APP make with java to see the power of node-urlresolver-api
App integrated with:
A video player (exoplayer based)
Google Admob integrated
A download manager with pause/resume/delete/open support
Here is the apk file download link
Here is the repository contains code of the App
------------------------------------- Forgive my english I’m still learning. Thanks -------------------------------
A complete nodejs API to extract streaming sites video direct URLs:
For the supported servers go to /servers.
To install this API on your server you only need to
have nodejs 10.x+ installed.
Next, install all dependencies with npm command
$ git clone https://github.com/lscofield/node-urlresolver-api
$ cd node-urlresolver-api
$ npm install
$ node app.js
$ npm install -g pm2
$ pm2 start app.js
$ pm2 stop 0
NOTE: You can use any programing language to extract direct url, I use Java (Android)
// Example video
String video_url = "https://www.bitporno.com/v/GE9XI6GIQW";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/bitporno";
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(video_url))
.data("auth", encodeBase64(authJSON))
.data("mode", "remote")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://www.bitporno.com/v/GE9XI6GIQW";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/bitporno";
// Getting video page source code
Document document = Jsoup.connect(video_url)
.timeout(TIMEOUT_HERE)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://clipwatching.com/nr00zqhanv9y";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/clipwatching";
// Getting video page source code
Document document = Jsoup.connect(video_url)
.timeout(TIMEOUT_HERE)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://cloudvideo.tv/embed-u3zub1spilit.html";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/cloudvideo";
// Getting video page source code
Document document = Jsoup.connect(video_url)
.timeout(TIMEOUT_HERE)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://supervideo.tv/jiwjxtsq8t0l";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/supervideo";
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(video_url))
.data("auth", encodeBase64(authJSON))
.data("mode", "remote")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://supervideo.tv/jiwjxtsq8t0l";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/bitporno";
// Getting video page source code
Document document = Jsoup.connect(video_url)
.timeout(TIMEOUT_HERE)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://upstream.to/embed-h0tyapx4s21c.html";
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/upstream";
// Getting video page source code
Document document = Jsoup.connect(video_url)
.timeout(TIMEOUT_HERE)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}
// Example video
String video_url = "https://uptostream.com/qiwfyxphnres";
String video_id = video_url.split("/")[3];
String uptostreamAPI = "https://uptostream.com/api/streaming/source/get?token=null&file_code="+video_id;
String mp4 = null;
String authJSON = "{\"auth\":\"\",\"skk\":\"your_app_key_from_config_file\"}";
String apiurl = "http://yourdomain_or_ip_address/api/v1/uptostream";
// Getting video page source code
Document document = Jsoup.connect(uptostreamAPI)
.timeout(TIMEOUT_HERE)
.referrer(video_url)
.userAgent("Mozilla")
.parser(Parser.htmlParser()).get();
// Getting direct url through api
String obj = Jsoup.connect(apiurl)
.timeout(TIMEOUT_HERE)
.data("source", encodeBase64(document.toString()))
.data("auth", encodeBase64(authJSON))
.data("mode", "local")
.method(Connection.Method.POST)
.ignoreContentType(true)
.execute().body();
if(obj != null && obj.contains("url")){
JSONObject json = new JSONObject(obj);
if (json.getString("status").equals("ok"))
mp4 = json.getString("url");
// Finally mp4 contains some of these values
// is null ==> Connection error
// is empty ==> no link fetched or apiserver error or video go down
// is direct video url (.mp4 or .m3u8) and you can play it directly in any video player
}