mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 08:26:53 +08:00
Merge pull request #3604 from InfinityPacer/feature/module
This commit is contained in:
@@ -120,7 +120,7 @@ class PluginHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.PLUGIN_STATISTIC_SHARE:
|
if not settings.PLUGIN_STATISTIC_SHARE:
|
||||||
return {}
|
return {}
|
||||||
res = RequestUtils(timeout=10).get_res(self._install_statistic)
|
res = RequestUtils(proxies=settings.PROXY, timeout=10).get_res(self._install_statistic)
|
||||||
if res and res.status_code == 200:
|
if res and res.status_code == 200:
|
||||||
return res.json()
|
return res.json()
|
||||||
return {}
|
return {}
|
||||||
@@ -134,7 +134,7 @@ class PluginHelper(metaclass=Singleton):
|
|||||||
if not pid:
|
if not pid:
|
||||||
return False
|
return False
|
||||||
install_reg_url = self._install_reg.format(pid=pid)
|
install_reg_url = self._install_reg.format(pid=pid)
|
||||||
res = RequestUtils(timeout=5).get_res(install_reg_url)
|
res = RequestUtils(proxies=settings.PROXY, timeout=5).get_res(install_reg_url)
|
||||||
if res and res.status_code == 200:
|
if res and res.status_code == 200:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@@ -148,7 +148,8 @@ class PluginHelper(metaclass=Singleton):
|
|||||||
plugins = self.systemconfig.get(SystemConfigKey.UserInstalledPlugins)
|
plugins = self.systemconfig.get(SystemConfigKey.UserInstalledPlugins)
|
||||||
if not plugins:
|
if not plugins:
|
||||||
return False
|
return False
|
||||||
res = RequestUtils(content_type="application/json",
|
res = RequestUtils(proxies=settings.PROXY,
|
||||||
|
content_type="application/json",
|
||||||
timeout=5).post(self._install_report,
|
timeout=5).post(self._install_report,
|
||||||
json={"plugins": [{"plugin_id": plugin} for plugin in plugins]})
|
json={"plugins": [{"plugin_id": plugin} for plugin in plugins]})
|
||||||
return True if res else False
|
return True if res else False
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
||||||
return []
|
return []
|
||||||
res = RequestUtils(timeout=15).get_res(self._sub_statistic, params={
|
res = RequestUtils(proxies=settings.PROXY, timeout=15).get_res(self._sub_statistic, params={
|
||||||
"stype": stype,
|
"stype": stype,
|
||||||
"page": page,
|
"page": page,
|
||||||
"count": count
|
"count": count
|
||||||
@@ -59,7 +59,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
||||||
return False
|
return False
|
||||||
res = RequestUtils(timeout=5, headers={
|
res = RequestUtils(proxies=settings.PROXY, timeout=5, headers={
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}).post_res(self._sub_reg, json=sub)
|
}).post_res(self._sub_reg, json=sub)
|
||||||
if res and res.status_code == 200:
|
if res and res.status_code == 200:
|
||||||
@@ -72,7 +72,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
||||||
return False
|
return False
|
||||||
res = RequestUtils(timeout=5, headers={
|
res = RequestUtils(proxies=settings.PROXY, timeout=5, headers={
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}).post_res(self._sub_done, json=sub)
|
}).post_res(self._sub_done, json=sub)
|
||||||
if res and res.status_code == 200:
|
if res and res.status_code == 200:
|
||||||
@@ -104,7 +104,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
subscribes = SubscribeOper().list()
|
subscribes = SubscribeOper().list()
|
||||||
if not subscribes:
|
if not subscribes:
|
||||||
return True
|
return True
|
||||||
res = RequestUtils(content_type="application/json",
|
res = RequestUtils(proxies=settings.PROXY, content_type="application/json",
|
||||||
timeout=10).post(self._sub_report,
|
timeout=10).post(self._sub_report,
|
||||||
json={
|
json={
|
||||||
"subscribes": [
|
"subscribes": [
|
||||||
@@ -125,7 +125,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
return False, "订阅不存在"
|
return False, "订阅不存在"
|
||||||
subscribe_dict = subscribe.to_dict()
|
subscribe_dict = subscribe.to_dict()
|
||||||
subscribe_dict.pop("id")
|
subscribe_dict.pop("id")
|
||||||
res = RequestUtils(content_type="application/json",
|
res = RequestUtils(proxies=settings.PROXY, content_type="application/json",
|
||||||
timeout=10).post(self._sub_share,
|
timeout=10).post(self._sub_share,
|
||||||
json={
|
json={
|
||||||
"share_title": share_title,
|
"share_title": share_title,
|
||||||
@@ -146,7 +146,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
||||||
return False, "当前没有开启订阅数据共享功能"
|
return False, "当前没有开启订阅数据共享功能"
|
||||||
res = RequestUtils(timeout=5, headers={
|
res = RequestUtils(proxies=settings.PROXY, timeout=5, headers={
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}).get_res(self._sub_fork % share_id)
|
}).get_res(self._sub_fork % share_id)
|
||||||
if res is None:
|
if res is None:
|
||||||
@@ -163,7 +163,7 @@ class SubscribeHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
if not settings.SUBSCRIBE_STATISTIC_SHARE:
|
||||||
return []
|
return []
|
||||||
res = RequestUtils(timeout=15).get_res(self._sub_shares, params={
|
res = RequestUtils(proxies=settings.PROXY, timeout=15).get_res(self._sub_shares, params={
|
||||||
"name": name,
|
"name": name,
|
||||||
"page": page,
|
"page": page,
|
||||||
"count": count
|
"count": count
|
||||||
|
|||||||
Reference in New Issue
Block a user