pull/185/head
FongMi 2 years ago
parent 2356046575
commit ce7d2a7ae1
  1. 2
      app/src/main/java/com/fongmi/android/tv/api/ApiConfig.java
  2. 12
      pyramid/src/main/python/base/spider.py

@ -240,7 +240,7 @@ public class ApiConfig {
public void setRecent(Site site) {
boolean js = site.getApi().contains(".js");
boolean py = site.getApi().startsWith("py_");
boolean py = site.getApi().contains(".py");
boolean csp = site.getApi().startsWith("csp_");
if (js) jsLoader.setRecent(site.getKey());
else if (py) pyLoader.setRecent(site.getKey());

@ -80,18 +80,18 @@ class Spider(metaclass=ABCMeta):
clean = re.sub('[\U0001F600-\U0001F64F\U0001F300-\U0001F5FF\U0001F680-\U0001F6FF\U0001F1E0-\U0001F1FF]', '', src)
return clean
def fetch(self, url, cookies=None, headers=None, timeout=5, verify=True):
rsp = requests.get(url, cookies=cookies, headers=headers, timeout=timeout, verify=verify)
def fetch(self, url, cookies=None, headers=None, timeout=5, verify=True, stream=False):
rsp = requests.get(url, cookies=cookies, headers=headers, timeout=timeout, verify=verify, stream=stream)
rsp.encoding = 'utf-8'
return rsp
def post(self, url, data, cookies=None, headers=None, timeout=5, verify=True):
rsp = requests.post(url, data=data, cookies=cookies, headers=headers, timeout=timeout, verify=verify)
def post(self, url, data, cookies=None, headers=None, timeout=5, verify=True, stream=False):
rsp = requests.post(url, data=data, cookies=cookies, headers=headers, timeout=timeout, verify=verify, stream=stream)
rsp.encoding = 'utf-8'
return rsp
def postJson(self, url, json, cookies=None, headers=None, timeout=5, verify=True):
rsp = requests.post(url, json=json, cookies=cookies, headers=headers, timeout=timeout, verify=verify)
def postJson(self, url, json, cookies=None, headers=None, timeout=5, verify=True, stream=False):
rsp = requests.post(url, json=json, cookies=cookies, headers=headers, timeout=timeout, verify=verify, stream=stream)
rsp.encoding = 'utf-8'
return rsp

Loading…
Cancel
Save