1. user.sites.bin change for rss.m-team.cc
m-team
now use rss.m-team.cc/api/rss/......
for rss link
need to add rss.m-team.cc
in sites conf binary file
user_sites['conf']['rss.m-team.cc'] = {'FREE': ["//h1[@id='top']/b/font[@class='free']"], '2XFREE': [], 'HR': [], 'PEER_COUNT': ["//div[@id='peercount']/b[1]"]}
and in indexer, add mteam-apicc
to fit new domain
id: mteam-xpcc, name: 馒头(Porn), domain: https://xp.m-team.cc/ encoding: UTF-8, category: , torrents
id: mteam-kpcc, name: 馒头(KPCC), domain: https://kp.m-team.cc/ encoding: UTF-8, category: , torrents
id: mteam-kpinfo, name: 馒头, domain: https://kp.m-team.info/ encoding: UTF-8, category: , torrents
id: mteam-xpio, name: 馒头(XPIO), domain: https://xp.m-team.io/ encoding: UTF-8, category: , torrents
id: mteam-apicc, name: 馒头(API), domain: https://api.m-team.cc/ encoding: UTF-8, category: , torrents
2. fix regex for season split
python pep guides suggest
(?)
is deprecated
You can check the Python bug tacker Issue 39394, the warning was introduced in Python 3.6. The point is that the Python re now does not allow using inline modifiers not at the start of string
3. fix StringUtils.get_url_domain
to fit m-team new api
def get_url_domain(url):
"""
获取URL的域名部分,不含WWW和HTTP
"""
common_prefixes: list = ["www."]
site_prefixes: dict = {"m-team": ["api.", "rss.", "kp."]}
if not url:
return ""
_, netloc = StringUtils.get_url_netloc(url)
if netloc:
netloc_lower: str = netloc.lower()
# trim common prefix
for common_prefix in common_prefixes:
netloc_lower = netloc_lower.replace(common_prefix, "")
# remove site custom prefix
for site_key in site_prefixes.keys():
if site_key in netloc_lower:
for prefix in site_prefixes[site_key]:
netloc_lower = netloc_lower.replace(prefix, "")
return netloc_lower
return ""
4. fix int(rate)
to float(rate)
for m-team api change
sysrole._shareRate = float(result.get("shareRate"))
sysrole._shareRateLimit = float(result.get("shareRateLimit"))
sysrole._sortPoint = float(result.get("sortPoint"))