each host add-on has to be in one file, and it module.exports
a function that return an object
module.exports = (lib, settings) => {
return {
checkLive: async function (url) {},
convertToEmbed: function(url) {},
getLink: async function(url) {}
}
}
Input:
-
libs
: our provided libs (more in detail below) -
settings
:object
platform
:string
, one of {nodejs
,android
,ios
}- any other data add-on required
Output: object
checkLive
:function
- input:
string
- output:
Promise
.then
:callback function
- input:
false
when link dies,html string
when link lives
- input:
.catch
:error
- input:
convertToEmbed
:function
- input:
string
- output:
string
- input:
getLink
:function
- input:
string
- output:
Promise
.then
:callback function
- input:
object
- host:
object
url
:string
name
:string
- result:
array of objects
label
:string
, one of {SD
,HD
,360p
,480p
,720p
,NOR
} (useNOR
when dont have any information)file
:string
(url)size
:string
(returnNOR
if can't getsize
)
- host:
- input:
.catch
:error
when get links error
- input:
We recommend you to use class, and in this class, we're gonna have method checkLive
, convertToEmbed
, getLink
module.exports = (lib, settings) => new CloneMe({ lib, settings });
each host add-on has to be in one file, and it module.exports
a function that return a Promise
module.exports = async (libs, movieInfo, settings) => {
// your code here
return array;
}
Input:
-
libs
: our provided libs (more in detail below) -
movieInfo
:object
type
:string
, one of {movie
,tv
,anime
}title
:string
year
:number
season
:number
episode
:number
-
settings
:object
platform
:string
, one of {nodejs
,android
,ios
}- any other data add-on required
Output: Promise
.then
:callback function
- input:
array of objects
provider
:object
url
:string
name
:string
result
:object
file
:string
label
:string
type
:string
, one of {embed
,direct
}
- input:
.catch
:error
Format: object
cheerio : require('cheerio-without-node-native'),
jsdom : require("jsdom"),
httpRequest : custom module,
cryptoJs : require("crypto-js"),
_ : require('lodash'),
axios : require('axios'),
stringHelper : custo module,
request : require('request'),
base64 : require('base-64')
We provide many libraries to call http request, for your most convenient. But we highly recommend you to use our custom module httpRequest
. Other libraries might not be included in the future releases.
List of supported http libraries
-
axios
-
fetch (you can use right out of the box)
-
request (you should avoid using this one, since it doesn't support Promise and not available on other enviroment).
-
httpRequest
:object
request
:fetch
(httpRrequest.request
is identical tofetch
)getHTML
:function
input
:url
:string
headers
:headers objects
output
:Promise
.then
:callback function
- input:
string
(text or html of reponse)
- input:
.catch
:error
getJSON
:function
- input:
url
:string
headers
:headers objects
- output:
Promise
.then
:callback function
- input:
object
(json object of reponse)
- input:
.catch
:error
- input:
get
:function
- input:
url
:string
headers
:headers objects
- output:
Promise
.then
:callback function
- input:
object
data
:string
orobject
(html or json)headers
:headers object
- input:
.catch
:error
- input:
post
:function
- input:
url
:string
headers
:headers objects
bodyString
:string
- note that you have to match with
content-type
headers
- note that you have to match with
- output:
Promise
.then
:callback function
- input:
object
data
:string
orobject
(html or json)headers
:headers object
- input:
.catch
:error
- input:
getHeader
:function
- input:
url
:string
- output:
Promise
.then
:callback function
- input:
headers object
- input:
.catch
:error
- input:
getRedirectUrl
:function
- input:
url
:string
- output:
Promise
.then
:callback function
- input:
url
- input:
.catch
:error
- input:
getCloudflare
: likeget
, but pass cloudflarepostCloudflare
: likepost
, but paass cloudflareisLinkDie
:function
- input:
url
:string
- output:
Promise
.then
:callback function
- input:
string size
- input:
.catch
:error
- input:
-
stringHelper
:object