-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lilingfengdev
committed
Jun 10, 2024
1 parent
b706e9a
commit bc639f9
Showing
5 changed files
with
86 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import typing | ||
|
||
from plugin.engine.base import SearchResult | ||
from plugin.engine.bing import Bing | ||
|
||
|
||
class Klpbbs(Bing): | ||
|
||
def search(self, keywords) -> typing.List[SearchResult]: | ||
return super()._search(keywords, site="klpbbs.com")[:3] # 一般来将,前五个才有价值 # 更加fw,3个 |
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,10 @@ | ||
import typing | ||
|
||
from plugin.engine.base import SearchResult | ||
from plugin.engine.bing import Bing | ||
|
||
|
||
class Minebbs(Bing): | ||
|
||
def search(self, keywords) -> typing.List[SearchResult]: | ||
return super()._search(keywords, site="minebbs.com")[:4] # 一般来将,前五个才有价值 # 四个吧 |
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,28 @@ | ||
import typing | ||
|
||
from plugin.engine.base import SearchEngine, SearchResult | ||
from plugin.utils.translate import translate, EN | ||
import requests | ||
import json | ||
|
||
|
||
class SpigotResult(SearchResult): | ||
def __init__(self, url, title, summary, count): | ||
super().__init__(url, title, summary) | ||
self.count = count | ||
|
||
|
||
class Spigot(SearchEngine): | ||
def search(self, keywords) -> typing.List[SearchResult]: | ||
key = translate(keywords, EN) | ||
data = json.loads(requests.get( | ||
f"https://fof1092.de/Plugins/SSE/resourceSearchV2.php?SearchText={key}").content) | ||
result = [] | ||
for plug in data: | ||
result.append( | ||
SpigotResult(url=plug["url"], title=plug["name"], summary=plug["tag"], count=plug["download"]["count"])) | ||
result.sort(key=lambda obj: obj.count,reverse=True) | ||
result = result[:16] | ||
for plug in result: | ||
plug.summary = translate(plug.summary) | ||
return result |