π This repo name is fully encapsulated.
This is a universal wrapper/scraper for the javlibrary.com that runs on Nodejs.
npm i ken113/javlibrary-api
The first thing is bypass Cloudflare's anti-bot page, all the content access need with session.
import jav from 'javlibrary-api';
jav.config(
{
headers: {
'User-Agent': 'required'
'Cookie': 'required'
}
}
);
(
async() => {
var res = await jav.getVideoDetail('javliida3q');
console.log(res);
}
)();
There are a lot of samples π€ If you're trying to figure out how to use an API, look there first!
npm run sample -- ./sample/search.js
Run the command generate a session file:
npm run session
There has a example how to keep a fresh session:
import time
import cfscrape
import schedule
def job():
tokens, user_agent = cfscrape.get_cookie_string('http://www.javlibrary.com/') # noqa
with open('../session.txt', 'w') as file:
file.write('{}+{} \r\n'.format(tokens, user_agent))
job()
schedule.every(30).minutes.do(job)
while 1:
schedule.run_pending()
time.sleep(1)
Use the session file:
var jav = require('../index');
var fs = require('fs');
var path = require('path');
module.exports = () => {
var session = fs.readFileSync(path.resolve(__dirname, '../session.txt'), { encoding: 'utf-8' });
var [cookie, userAgent] = session.split('+');
jav.config(
{
headers: {
'User-Agent': userAgent.trim(),
'Cookie': cookie.trim()
}
}
);
return jav;
};
- getBestRated(options) β
object
|undefined
Get the best rated items
- getBestReviews(options) β
object
|undefined
Get the best review items
- getMostFavStars() β
object
|undefined
Get the most favorited items
- getMostWanted(options) β
object
|undefined
Get the most wanted items
- getNewComments(options) β
object
|undefined
Get the newest commented items
- getNewEntries(options) β
object
|undefined
Get the newest entries items
- getNewReleases(options) β
object
|undefined
Get the newest released items
- getPopularVideo() β
object
|undefined
Get the most popular items
- getVideoComments(id) β
object
|undefined
Get the comments by item id
- getVideoDetail(id) β
object
|undefined
Get the detail by item id
- getVideoReviews(id) β
object
|undefined
Get the reviews by item id
- listByDirector(options) β
object
|undefined
Get items by director id
- listByLabel(options) β
object
|undefined
Get items by label id
- listByMaker(options) β
object
|undefined
Get items by maker id
- listByStar(options) β
object
|undefined
Get items by star id
- listByTag(options) β
object
|undefined
Get items by tag id
- search(keywords) β
object
|undefined
Get the detail by item id
Get the best rated items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.order | number |
0 is order by DESC, 1 is order by ASC. |
options.page | number |
The page index. |
Get the best review items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.order | number |
0 is order by DESC, 1 is order by ASC. |
Get the most favorited items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Get the most wanted items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.order | number |
0 is order by DESC, 1 is order by ASC. |
options.page | number |
The page index. |
Get the newest commented items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.page | number |
The page index. |
Get the newest entries items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.page | number |
The page index. |
options.order | number |
0 is order by DESC, 1 is order by ASC. |
Get the newest released items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.page | number |
The page index. |
options.order | number |
0 is order by DESC, 1 is order by ASC. |
Get the most popular items
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Get the comments by item id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
id | string |
ID of the item |
Get the detail by item id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
id | string |
ID of the item |
Get the reviews by item id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
id | string |
ID of the item |
Get items by director id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.id | number |
The director id. |
options.page | number |
The page index. |
Get items by label id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.id | number |
The label id. |
options.page | number |
The page index. |
Get items by maker id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.id | number |
The maker id. |
options.page | number |
The page index. |
Get items by star id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.id | number |
The star id. |
options.page | number |
The page index. |
Get items by tag id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
options | object |
The pagination info. |
options.id | number |
The tag id. |
options.page | number |
The page index. |
Get the detail by item id
Kind: global function
Returns: object
| undefined
- A object the if successful. If failure not returned.
Param | Type | Description |
---|---|---|
keywords | string |
Number plate. |