Merge remote-tracking branch 'origin/main'

This commit is contained in:
jxxghp
2023-08-17 11:56:31 +08:00
6 changed files with 23 additions and 19 deletions

View File

@ -493,7 +493,7 @@ class MediaSyncDel(_PluginBase):
# 判断种子是否被删除完
self.handle_torrent(history_id=transferhis.id,
src=transferhis.src,
torrent_hash=history.download_hash)
torrent_hash=transferhis.download_hash)
except Exception as e:
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
del_source = True
@ -641,7 +641,7 @@ class MediaSyncDel(_PluginBase):
# 判断种子是否被删除完
self.handle_torrent(history_id=transferhis.id,
src=transferhis.src,
torrent_hash=history.download_hash)
torrent_hash=transferhis.download_hash)
except Exception as e:
logger.error("删除种子失败,尝试删除源文件:%s" % str(e))
del_source = True

View File

@ -242,7 +242,10 @@ class StringUtils:
return 'u2.dmhy.org'
_, netloc = StringUtils.get_url_netloc(url)
if netloc:
return ".".join(netloc.split(".")[-2:])
locs = netloc.split(".")
if len(locs) > 3:
return netloc
return ".".join(locs[-2:])
return ""
@staticmethod