Skip to content

Commit

Permalink
fix(download): 私有PT站点,点击下载不成功
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyanling committed Jan 8, 2024
1 parent 2500ff7 commit fd13847
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/utils/torrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from app.utils.http_utils import RequestUtils
from app.utils.types import MediaType
from config import Config

from app.sites_config import SitesConfig

class Torrent:
_torrent_temp_path = None
Expand Down Expand Up @@ -456,12 +456,12 @@ def maybe_torrent_url(link):
def format_enclosure(link):
"""
格式化一个链接
如果是磁力链接则直接返回
如果是磁力链接或者为私有PT站点则直接返回
如果不是磁力链接看是否是种子链接,如果是则下载种子后转换为磁力链接
"""
if not StringUtils.is_string_and_not_empty(link):
return None
if Torrent.is_magnet(link):
if Torrent.is_magnet(link) or SitesConfig().get_site_config_info(link):
return link
if not Torrent.maybe_torrent_url(link):
return None
Expand Down

0 comments on commit fd13847

Please sign in to comment.