mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 11:29:38 +08:00
upadte BD2020 link, use order generation, supress error
This commit is contained in:
@@ -34,7 +34,7 @@ NEWZMZ_SEARCH = "https://newzmz.com/subres/index/getres.html?keyword={}"
|
|||||||
NEWZMZ_RESOURCE = "https://ysfx.tv/view/{}"
|
NEWZMZ_RESOURCE = "https://ysfx.tv/view/{}"
|
||||||
|
|
||||||
# BD2020
|
# BD2020
|
||||||
BD2020_SEARCH = "https://www.bd2020.com/search.jspx?q={}"
|
BD2020_SEARCH = "https://v.bd2020.me/search.jspx?q={}"
|
||||||
|
|
||||||
# XL720
|
# XL720
|
||||||
XL720_SEARCH = "https://www.xl720.com/?s={}"
|
XL720_SEARCH = "https://www.xl720.com/?s={}"
|
||||||
|
|||||||
@@ -527,6 +527,8 @@ class ResourceMongoResource(ResourceResource, Mongo):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def search_resource(self, keyword: str) -> dict:
|
def search_resource(self, keyword: str) -> dict:
|
||||||
|
order = os.getenv("ORDER") or 'YYeTsOffline,ZimuxiaOnline,NewzmzOnline,ZhuixinfanOnline,XL720,BD2020'.split(",")
|
||||||
|
order.pop(0)
|
||||||
final = []
|
final = []
|
||||||
returned = {}
|
returned = {}
|
||||||
|
|
||||||
@@ -569,12 +571,12 @@ class ResourceMongoResource(ResourceResource, Mongo):
|
|||||||
returned = dict(data=final)
|
returned = dict(data=final)
|
||||||
returned["extra"] = []
|
returned["extra"] = []
|
||||||
else:
|
else:
|
||||||
# TODO how to generate code using ORDER here
|
extra = []
|
||||||
extra = self.fansub_search(ZimuxiaOnline.__name__, keyword) or \
|
with contextlib.suppress(requests.exceptions.RequestException):
|
||||||
self.fansub_search(NewzmzOnline.__name__, keyword) or \
|
for name in order:
|
||||||
self.fansub_search(ZhuixinfanOnline.__name__, keyword) or \
|
extra = self.fansub_search(name, keyword)
|
||||||
self.fansub_search(XL720.__name__, keyword) or \
|
if extra:
|
||||||
self.fansub_search(BD2020.__name__, keyword)
|
break
|
||||||
|
|
||||||
returned["data"] = []
|
returned["data"] = []
|
||||||
returned["extra"] = extra
|
returned["extra"] = extra
|
||||||
|
|||||||
Reference in New Issue
Block a user