forked from pt-plugins/PT-Plugin-Plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from wegood9/dev
Dev
- Loading branch information
Showing
17 changed files
with
699 additions
and
151 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"name": "Kufirc", | ||
"url": "https://kufirc.com/", | ||
"icon": "https://kufirc.com/favicon.ico", | ||
"host": "kufirc.com", | ||
"schema": "kufirc", | ||
"tags": ["成人"], | ||
"collaborator": "haowenwu", | ||
"levelRequirements": [ | ||
{ | ||
"level": 1, | ||
"name": "Pályakezdö", | ||
"interval": "1", | ||
"uploaded": "10 GB", | ||
"ratio": "1.0" | ||
}, | ||
{ | ||
"level": 2, | ||
"name": "Perverz", | ||
"interval": "4", | ||
"uploaded": "25 GB", | ||
"ratio": "1.05" | ||
}, | ||
{ | ||
"level": 3, | ||
"name": "Szexmester", | ||
"interval": "13", | ||
"uploaded": "1 TB", | ||
"ratio": "1.05" | ||
}, | ||
{ | ||
"level": 4, | ||
"name": "Veterán", | ||
"interval": "26", | ||
"uploaded": "10 TB", | ||
"ratio": "1.05" | ||
}, | ||
{ | ||
"level": 5, | ||
"name": "Legenda", | ||
"interval": "50", | ||
"uploaded": "30 TB", | ||
"ratio": "2.05" | ||
} | ||
], | ||
"searchEntry": [], | ||
"searchEntryConfig": { | ||
"page": "/torrents.php", | ||
"queryString": "title=$key$", | ||
"resultType": "html", | ||
"parseScriptFile": "getSearchResult.js" | ||
}, | ||
"selectors": { | ||
"userBaseInfo": { | ||
"page": "/index.php", | ||
"fields": { | ||
"id": { | ||
"selector": ["a[href*=user]"], | ||
"attribute": "href", | ||
"filters": ["query.match(/\\d+/)[0]"] | ||
}, | ||
"name": { | ||
"selector": ".username" | ||
}, | ||
"bonus": { | ||
"selector": [".stat:eq(0)"] | ||
}, | ||
"uploaded": { | ||
"selector": [".stat:eq(1)"], | ||
"filters":["query.text().sizeToNumber()"] | ||
}, | ||
"downloaded": { | ||
"selector": [".stat:eq(3)"], | ||
"filters":["query.text().sizeToNumber()"] | ||
}, | ||
"seeding": { | ||
"selector": ["#nav_seeding_r"] | ||
}, | ||
"leeching": { | ||
"selector": ["#nav_leeching"], | ||
"filters": ["query.match(/\\d+/)[0]"] | ||
} | ||
} | ||
}, | ||
"userExtendInfo": { | ||
"page": "/user.php?id=$user.id$", | ||
"fields": { | ||
"levelName": { | ||
"selector": [".rank"] | ||
}, | ||
"uploads": { | ||
"selector": [".stats:eq(3) > li:eq(8)"], | ||
"filters": ["query.match(/\\d+/)[0]"] | ||
}, | ||
"joinTime": { | ||
"selector": [".time:eq(1)"], | ||
"attribute": "title", | ||
"filters": ["dateTime(query).valueOf()"] | ||
} | ||
} | ||
}, | ||
"userSeedingTorrents": { | ||
"page": "/torrents.php?type=seeding&userid=$user.id$", | ||
"fields": { | ||
"seedingSize": { | ||
"selector": [".head:eq(1)"], | ||
"filters": ["query.text().match(/Size: (.*)/)[1].sizeToNumber()"] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
(function (options, Searcher) { | ||
class Parser { | ||
constructor() { | ||
this.haveData = false; | ||
this.categories = {}; | ||
if (/Login/.test(options.responseText)) { | ||
options.status = ESearchResultParseStatus.needLogin; | ||
return; | ||
} | ||
options.isLogged = true; | ||
this.haveData = true; | ||
} | ||
|
||
getResult() { | ||
if (!this.haveData) { | ||
return []; | ||
} | ||
let site = options.site; | ||
let rows = options.page.find('#torrent_table > tbody > .torrent'); | ||
if (rows.length == 0) { | ||
options.status = ESearchResultParseStatus.torrentTableIsEmpty; | ||
return []; | ||
} | ||
let results = []; | ||
|
||
try { | ||
for (let index = 0; index < rows.length; index++) { | ||
const row = rows.eq(index); | ||
|
||
let title_elem = row.find('a[onmouseover*=return]').first(); | ||
if (title_elem.length == 0) { | ||
continue; | ||
} | ||
let download_elem = row.find('a[href*=download]').first(); | ||
|
||
let data = { | ||
category: { "name": row.find('td').first().find('div').first().attr('title') }, | ||
title: title_elem.text(), | ||
link: `${site.url}${title_elem.attr('href')}`, | ||
url: `${site.url}${download_elem.attr('href')}`, | ||
size: row.find('td').eq(5).text(), | ||
completed: row.find('td').eq(6).text(), | ||
seeders: row.find('td').eq(7).text(), | ||
leechers: row.find('td').eq(8).text(), | ||
author: row.find('td').eq(9).text(), | ||
time: row.find('.time').first().attr('title'), | ||
tags: row.find('img[alt=Freeleech]').length ? [{ name: 'Free', color: 'blue' }] : [], | ||
site: site, | ||
entryName: options.entry.name | ||
}; | ||
results.push(data); | ||
} | ||
if (results.length == 0) { | ||
options.status = ESearchResultParseStatus.noTorrents; | ||
} | ||
} catch (error) { | ||
options.status = ESearchResultParseStatus.parseError; | ||
options.errorMsg = error.stack; | ||
} | ||
return results; | ||
} | ||
} | ||
|
||
let parser = new Parser(options); | ||
options.results = parser.getResult(); | ||
console.log(options.results); | ||
})(options, Searcher); | ||
|
This file contains 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
Oops, something went wrong.