Skip to content

Commit e5daa30

Browse files
committed
Expose function to get ncore url for torrent
1 parent 76ddbaf commit e5daa30

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

ncoreparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
from .data import SearchParamType, SearchParamWhere, ParamSeq, ParamSort
55
from .error import NcoreDownloadError, NcoreParserError, NcoreCredentialError, NcoreConnectionError
66
from .util import Size
7-
from .torrent import Torrent
7+
from .torrent import Torrent, get_torrent_page_url
88
from .types import SearchResult

ncoreparser/torrent.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
from ncoreparser.util import Size
55

66

7+
def get_torrent_page_url(torrent_id: str) -> str:
8+
return URLs.DETAIL_PATTERN.value.format(id=torrent_id)
9+
10+
711
class Torrent:
812
# pylint: disable=too-many-arguments, too-many-positional-arguments
913
def __init__(
@@ -19,7 +23,7 @@ def __init__(
1923
"seed": seed,
2024
"leech": leech,
2125
"download": URLs.DOWNLOAD_LINK.value.format(id=id, key=key),
22-
"url": URLs.DETAIL_PATTERN.value.format(id=id),
26+
"url": get_torrent_page_url(torrent_id=id),
2327
}
2428
self._details.update(params)
2529

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55

66
[project]
77
name = "ncoreparser"
8-
version = "4.0.0"
8+
version = "4.0.1"
99
description = "Package to download from ncore.pro"
1010
authors = [
1111
{ name="Aron Radics", email="aron.radics.jozsef@gmail.com" }

0 commit comments

Comments
 (0)