2023.10.05 (03. ohli24 proxy setting)

This commit is contained in:
2023-10-05 21:41:56 +09:00
parent 00deec43cd
commit cee6442b5d

View File

@@ -481,6 +481,7 @@ class LogicOhli24(PluginModuleBase):
def get_series_info(self, code, wr_id, bo_table): def get_series_info(self, code, wr_id, bo_table):
code_type = "c" code_type = "c"
code = urllib.parse.quote(code)
try: try:
if ( if (
@@ -584,7 +585,7 @@ class LogicOhli24(PluginModuleBase):
+ li.xpath('.//a[@class="item-subject"]/@href')[0] + li.xpath('.//a[@class="item-subject"]/@href')[0]
) )
# logger.debug(f"link:: {link}") # logger.debug(f"link:: {link}")
date = li.xpath('.//div[@class="wr-date"]/text()')[0] _date = li.xpath('.//div[@class="wr-date"]/text()')[0]
m = hashlib.md5(title.encode("utf-8")) m = hashlib.md5(title.encode("utf-8"))
# _vi = hashlib.md5(title.encode('utf-8').hexdigest()) # _vi = hashlib.md5(title.encode('utf-8').hexdigest())
# logger.info(m.hexdigest()) # logger.info(m.hexdigest())
@@ -594,8 +595,8 @@ class LogicOhli24(PluginModuleBase):
"title": title, "title": title,
"link": link, "link": link,
"thumbnail": image, "thumbnail": image,
"date": date, "date": _date,
"day": date, "day": _date,
"_id": title, "_id": title,
"va": link, "va": link,
"_vi": _vi, "_vi": _vi,
@@ -850,12 +851,27 @@ class LogicOhli24(PluginModuleBase):
if LogicOhli24.session is None: if LogicOhli24.session is None:
LogicOhli24.session = requests.session() LogicOhli24.session = requests.session()
LogicOhli24.session.verify = False
# logger.debug('get_html :%s', url) # logger.debug('get_html :%s', url)
headers["Referer"] = "" if referer is None else referer # LogicOhli24.headers["Referer"] = "" if referer is None else referer
# logger.debug(f"referer:: {referer}")
if referer:
LogicOhli24.headers["Referer"] = referer
# logger.info(headers)
# logger.debug(f"LogicOhli24.headers:: {LogicOhli24.headers}")
proxies = {
"http": "http://192.168.0.2:3138",
"https": "http://192.168.0.2:3138",
}
page_content = LogicOhli24.session.get( page_content = LogicOhli24.session.get(
url, headers=headers, timeout=timeout url, headers=LogicOhli24.headers, timeout=timeout, proxies=proxies
) )
data = page_content.text response_data = page_content.text
# logger.debug(response_data)
return response_data
except Exception as e: except Exception as e:
logger.error("Exception:%s", e) logger.error("Exception:%s", e)
logger.error(traceback.format_exc()) logger.error(traceback.format_exc())
@@ -1170,7 +1186,8 @@ class Ohli24QueueEntity(FfmpegQueueEntity):
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) " "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36" "Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36"
"Mozilla/5.0 (Macintosh; Intel " "Mozilla/5.0 (Macintosh; Intel "
"Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 " "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/116.0.0.0 Safari/537.36"
"Whale/3.12.129.46 Safari/537.36", "Whale/3.12.129.46 Safari/537.36",
"X-Requested-With": "XMLHttpRequest", "X-Requested-With": "XMLHttpRequest",
} }
@@ -1202,6 +1219,12 @@ class Ohli24QueueEntity(FfmpegQueueEntity):
} }
self.url = stream_info[1].strip() self.url = stream_info[1].strip()
logger.info(self.url)
if "anibeast.com" in self.url:
self.headers["Referer"] = iframe_src
if "crazypatutu.com" in self.url:
self.headers["Referer"] = iframe_src
match = re.compile(r'NAME="(?P<quality>.*?)"').search(stream_info[0]) match = re.compile(r'NAME="(?P<quality>.*?)"').search(stream_info[0])
self.quality = "720P" self.quality = "720P"
if match is not None: if match is not None: