plexflow 0.0.79__py3-none-any.whl → 0.0.81__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plexflow/core/context/partials/candidates.py +7 -0
- plexflow/core/downloads/candidates/rank/__pycache__/ranking.cpython-312.pyc +0 -0
- plexflow/core/downloads/candidates/rank/__pycache__/utils.cpython-312.pyc +0 -0
- plexflow/core/downloads/candidates/rank/ranking.py +61 -0
- plexflow/core/downloads/candidates/rank/utils.py +4 -0
- plexflow/core/torrents/providers/tpb/__pycache__/utils.cpython-312.pyc +0 -0
- plexflow/core/torrents/results/__pycache__/torrent.cpython-312.pyc +0 -0
- plexflow/core/torrents/results/__pycache__/universal.cpython-312.pyc +0 -0
- plexflow/core/torrents/results/torrent.py +8 -0
- plexflow/spiders/tgx/pipelines/__pycache__/meta_pipeline.cpython-312.pyc +0 -0
- plexflow/utils/subtitle/search.py +1 -1
- plexflow/utils/torrent/extract/__pycache__/tgx.cpython-312.pyc +0 -0
- {plexflow-0.0.79.dist-info → plexflow-0.0.81.dist-info}/METADATA +1 -1
- {plexflow-0.0.79.dist-info → plexflow-0.0.81.dist-info}/RECORD +16 -12
- {plexflow-0.0.79.dist-info → plexflow-0.0.81.dist-info}/WHEEL +0 -0
- {plexflow-0.0.79.dist-info → plexflow-0.0.81.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,7 @@
|
|
1
1
|
from plexflow.core.context.partial_context import PartialContext
|
2
2
|
from plexflow.core.downloads.candidates.download_candidate import DownloadCandidate
|
3
3
|
from typing import List
|
4
|
+
from plexflow.core.downloads.candidates.rank.ranking import Ranked
|
4
5
|
|
5
6
|
class Candidates(PartialContext):
|
6
7
|
def __init__(self, **kwargs) -> None:
|
@@ -13,3 +14,9 @@ class Candidates(PartialContext):
|
|
13
14
|
if len(candidates) == 0:
|
14
15
|
return
|
15
16
|
self.set("download/candidates", candidates)
|
17
|
+
|
18
|
+
def update_ranked(self, ranked_candidates: Ranked):
|
19
|
+
self.set('download/ranked/candidates', ranked_candidates)
|
20
|
+
|
21
|
+
def ranked(self) -> Ranked:
|
22
|
+
return self.get('download/ranked/candidates')
|
@@ -0,0 +1,61 @@
|
|
1
|
+
from plexflow.core.downloads.candidates.download_candidate import DownloadCandidate
|
2
|
+
from typing import List
|
3
|
+
from plexflow.core.downloads.candidates.rank.utils import rank_candidate
|
4
|
+
|
5
|
+
class RankedCandidate:
|
6
|
+
def __init__(self, rank: float, candidate: DownloadCandidate):
|
7
|
+
self.rank: float = rank
|
8
|
+
self.candidate: DownloadCandidate = candidate
|
9
|
+
|
10
|
+
class Ranked:
|
11
|
+
def __init__(self):
|
12
|
+
self.ranked = {
|
13
|
+
'native': {
|
14
|
+
'nl': [],
|
15
|
+
'en': []
|
16
|
+
},
|
17
|
+
'encoder': {
|
18
|
+
'nl': [],
|
19
|
+
'en': []
|
20
|
+
},
|
21
|
+
'nosub': []
|
22
|
+
}
|
23
|
+
|
24
|
+
def append_native(self, candidate: DownloadCandidate, rank: float, language: str):
|
25
|
+
self.ranked['native'][language].append(RankedCandidate(rank, candidate))
|
26
|
+
|
27
|
+
def append_encoder(self, candidate: DownloadCandidate, rank: float, language: str):
|
28
|
+
self.ranked['encoder'][language].append(RankedCandidate(rank, candidate))
|
29
|
+
|
30
|
+
def append_nosub(self, candidate: DownloadCandidate, rank: float):
|
31
|
+
self.ranked['nosub'].append(RankedCandidate(rank, candidate))
|
32
|
+
|
33
|
+
def native_candidates(self, language: str):
|
34
|
+
return sorted(self.ranked['native'][language], key=lambda rc: rc.rank, reverse=True)
|
35
|
+
|
36
|
+
def encoder_candidates(self, language: str):
|
37
|
+
return sorted(self.ranked['encoder'][language], key=lambda rc: rc.rank, reverse=True)
|
38
|
+
|
39
|
+
def nosub_candidates(self):
|
40
|
+
return sorted(self.ranked['nosub'], key=lambda rc: rc.rank, reverse=True)
|
41
|
+
|
42
|
+
|
43
|
+
def rank_candidates(candidates: List[DownloadCandidate]):
|
44
|
+
ranked = Ranked()
|
45
|
+
|
46
|
+
for candidate in candidates:
|
47
|
+
seeds = candidate.max_seeds
|
48
|
+
size = candidate.max_size_bytes
|
49
|
+
|
50
|
+
rank = rank_candidate(seeds, size)
|
51
|
+
|
52
|
+
# TODO: support native subtitles
|
53
|
+
if candidate.has_dutch_subtitles:
|
54
|
+
# encoder dutch
|
55
|
+
ranked.append_encoder(candidate=candidate, rank=rank, language='nl')
|
56
|
+
elif candidate.has_english_subtitles:
|
57
|
+
ranked.append_encoder(candidate=candidate, rank=rank, language='en')
|
58
|
+
else:
|
59
|
+
ranked.append_nosub(candidate=candidate, rank=rank)
|
60
|
+
|
61
|
+
return ranked
|
Binary file
|
Binary file
|
Binary file
|
@@ -150,6 +150,14 @@ class Torrent(ABC):
|
|
150
150
|
parts = self.parsed_release_name
|
151
151
|
return parts.get("quality")
|
152
152
|
|
153
|
+
@property
|
154
|
+
def has_native_dutch_subtitles(self):
|
155
|
+
return False
|
156
|
+
|
157
|
+
@property
|
158
|
+
def has_native_english_subtitles(self):
|
159
|
+
return False
|
160
|
+
|
153
161
|
@property
|
154
162
|
def is_bad_quality(self):
|
155
163
|
parsed_title = self.parsed_release_name
|
Binary file
|
@@ -48,7 +48,7 @@ class SubtitleSearcher:
|
|
48
48
|
pattern : re.Pattern
|
49
49
|
a compiled regular expression pattern
|
50
50
|
"""
|
51
|
-
pattern = re.compile(rf'\b(text|subtitles?)\b(.*?)\b({hint_word})
|
51
|
+
pattern = re.compile(rf'\b(text|subs|subtitles?)\b(.*?)\b({hint_word})\.?\b', re.IGNORECASE | re.DOTALL | re.UNICODE)
|
52
52
|
return pattern
|
53
53
|
|
54
54
|
def search_subtitles(self, text):
|
Binary file
|
@@ -25,7 +25,7 @@ plexflow/core/context/partials/__pycache__/__init__.cpython-311.pyc,sha256=x_5HU
|
|
25
25
|
plexflow/core/context/partials/__pycache__/ids.cpython-311.pyc,sha256=wV7r4FAwonAshns-NGcowqGamtrM_Q_2NbiHQhOLkjg,2638
|
26
26
|
plexflow/core/context/partials/__pycache__/watchlist.cpython-311.pyc,sha256=k-0BM-AvH-zObpwY0XR8CYrT21kPEa0fmeBmf0wscE0,1466
|
27
27
|
plexflow/core/context/partials/cache.py,sha256=1QQ6yP69wqJiacuc2idhHsXpyUUCqavqgLk25wQB_tI,508
|
28
|
-
plexflow/core/context/partials/candidates.py,sha256=
|
28
|
+
plexflow/core/context/partials/candidates.py,sha256=oouE7whR-3trH5xKDxu4ozkf2Kkzkrgda28uwEQTk-M,823
|
29
29
|
plexflow/core/context/partials/context.py,sha256=pFzpAFxwCJdqPuhXJqhs6j4Xyvf0GQtzPRMmL4fcjEA,314
|
30
30
|
plexflow/core/context/partials/ids.py,sha256=QoQ6FbX1OIWrE-iuz-G6kSzBlTt1_I1jyfl2JgKge2o,913
|
31
31
|
plexflow/core/context/partials/movie.py,sha256=VXQ2SspFgGSRgDefg4VlHrH2fns3KRuKlU72ps6527o,3861
|
@@ -67,6 +67,10 @@ plexflow/core/downloads/candidates/__pycache__/download_candidate.cpython-312.py
|
|
67
67
|
plexflow/core/downloads/candidates/__pycache__/utils.cpython-312.pyc,sha256=Jwoj7R4TFzjoXc3uq_Wps3WitzFE9K_miKp9XuT_l8Y,2079
|
68
68
|
plexflow/core/downloads/candidates/download_candidate.py,sha256=KlW4GhAbp2hhDuoAphuFj3uweJE4LjwRvUNe-R7h-es,5819
|
69
69
|
plexflow/core/downloads/candidates/filtered.py,sha256=HgUY0S3aWAeHASHTjND9hyjCtGNLhUzLOL90G2CDxKg,1842
|
70
|
+
plexflow/core/downloads/candidates/rank/__pycache__/ranking.cpython-312.pyc,sha256=Wz8hGAtLZNT0ThAPwloLBek5wflI6DKFDhr5_b7TzPI,4045
|
71
|
+
plexflow/core/downloads/candidates/rank/__pycache__/utils.cpython-312.pyc,sha256=5Q6q1kw62WCWlPVFpXgXYt6oqf2gWHK_DHaZ-CBADwk,426
|
72
|
+
plexflow/core/downloads/candidates/rank/ranking.py,sha256=NJPpNxZ1z-VT5LkDCaamV0Zqj4IKlbkrZwEojMOI0lc,2181
|
73
|
+
plexflow/core/downloads/candidates/rank/utils.py,sha256=R4Ai4KmZRONo9vd2rf32DdGxVkANHYFwSjrO5WVjX9U,100
|
70
74
|
plexflow/core/downloads/candidates/utils.py,sha256=ahI6bvk7CHT_O0BEXsd7FtC180Swlt9Phj6_op1mhYA,1777
|
71
75
|
plexflow/core/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
72
76
|
plexflow/core/env/env.py,sha256=8cK49WiKD_H3B9K0QiMu7pkXTld40ojRB3sK7noQM44,953
|
@@ -494,7 +498,7 @@ plexflow/core/torrents/providers/tpb/__pycache__/__init__.cpython-312.pyc,sha256
|
|
494
498
|
plexflow/core/torrents/providers/tpb/__pycache__/tpb.cpython-311.pyc,sha256=e_38p1LN_QMIlb92ffVan46SkaPTaMVYFpys7BzPEaY,1688
|
495
499
|
plexflow/core/torrents/providers/tpb/__pycache__/tpb.cpython-312.pyc,sha256=MAp1JprHh9oeFLKRNGOqyytN12g0ZdUSdF6TwJ9MDCs,1504
|
496
500
|
plexflow/core/torrents/providers/tpb/__pycache__/utils.cpython-311.pyc,sha256=YwB71cMUDX6MxUduWoFXRQXsP_LIRqK4rAVrJMX4v38,6704
|
497
|
-
plexflow/core/torrents/providers/tpb/__pycache__/utils.cpython-312.pyc,sha256=
|
501
|
+
plexflow/core/torrents/providers/tpb/__pycache__/utils.cpython-312.pyc,sha256=cJSN6zMizHkzh3_WWJ2uF4bZ6_svJSQnN296iP8YJv4,6378
|
498
502
|
plexflow/core/torrents/providers/tpb/tpb.py,sha256=YB-a3kZ4DUzXkI4TJJszVvoJiX4L0QUJuCo-9iqC6JQ,681
|
499
503
|
plexflow/core/torrents/providers/tpb/utils.py,sha256=xZEU9tbRnG8nR2lspPenIA0UqmqxMIH_uv1sMtW79qM,3621
|
500
504
|
plexflow/core/torrents/providers/yts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -511,10 +515,10 @@ plexflow/core/torrents/results/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
511
515
|
plexflow/core/torrents/results/__pycache__/__init__.cpython-311.pyc,sha256=FJHx4wYMLA-6GPhdMPY5TUfw7JicV0HMgxCwlpbba54,180
|
512
516
|
plexflow/core/torrents/results/__pycache__/__init__.cpython-312.pyc,sha256=ZUXrXdVtbKDOsGXTY2h9h1GTk4atgBsFSsm-ffcVUUc,168
|
513
517
|
plexflow/core/torrents/results/__pycache__/torrent.cpython-311.pyc,sha256=SxfylbSxF9gpzXvNey4Fv9XdKLjwm0a0LYlGFhg7zAY,7655
|
514
|
-
plexflow/core/torrents/results/__pycache__/torrent.cpython-312.pyc,sha256=
|
515
|
-
plexflow/core/torrents/results/__pycache__/universal.cpython-312.pyc,sha256=
|
518
|
+
plexflow/core/torrents/results/__pycache__/torrent.cpython-312.pyc,sha256=gVBo7bTDY_6m9MmdgYy6fcnnoVQkXZiRI2iDANyG5RA,7776
|
519
|
+
plexflow/core/torrents/results/__pycache__/universal.cpython-312.pyc,sha256=fWAmvqL76rp3K0_ydGNEHFJe-05duOvvo76ZpYjZQYE,14162
|
516
520
|
plexflow/core/torrents/results/__pycache__/utils.cpython-312.pyc,sha256=vqEt3jQLzZ-K_E9WV0kKz4K79AScvcg2xyOUTlAcu70,1136
|
517
|
-
plexflow/core/torrents/results/torrent.py,sha256=
|
521
|
+
plexflow/core/torrents/results/torrent.py,sha256=vsQNeG0PBMwIiuPhnbgtgnl1q7oGiOCN64ClxQDqPz4,4928
|
518
522
|
plexflow/core/torrents/results/universal.py,sha256=ycprOMT1Px8IthmB82YhmnxeNt7P3GAcrOlEkpKoaQk,7706
|
519
523
|
plexflow/core/torrents/results/utils.py,sha256=abiiO_QQYDpA5aMyO8WFPxnGu5sL5xfACezE5bwrnJU,691
|
520
524
|
plexflow/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -535,7 +539,7 @@ plexflow/spiders/quiet_logger.py,sha256=adLBggbjrYo4VcJE61ho7TUisSRxeI5VeNCZnSzd
|
|
535
539
|
plexflow/spiders/tgx/__pycache__/settings.cpython-312.pyc,sha256=YH3GVoQ3qDQrnxpdXwfk0yxzSMqx--tEUL0thav9DV0,1181
|
536
540
|
plexflow/spiders/tgx/__pycache__/spider.cpython-312.pyc,sha256=YIHL9xFvLKZQ1UpYdTBxohij1mw_Lf0-kBTUA_kxIQE,4849
|
537
541
|
plexflow/spiders/tgx/pipelines/__pycache__/dump_json_pipeline.cpython-312.pyc,sha256=luLi4Dnm86iH0LhbojlH-C6tj9m_WDlka5LyIWuOzPA,1784
|
538
|
-
plexflow/spiders/tgx/pipelines/__pycache__/meta_pipeline.cpython-312.pyc,sha256=
|
542
|
+
plexflow/spiders/tgx/pipelines/__pycache__/meta_pipeline.cpython-312.pyc,sha256=JG9aZY6NJTGGnkcpvgsgmVTkmC6EcjtpQPrKPzTnKfQ,973
|
539
543
|
plexflow/spiders/tgx/pipelines/__pycache__/publish_pipeline.cpython-312.pyc,sha256=Z2_N2cauzcwCsN2CD4IAQBEVBV9GBlfyzxB6c1zbagU,833
|
540
544
|
plexflow/spiders/tgx/pipelines/__pycache__/torrent_info_pipeline.cpython-312.pyc,sha256=GOPgySoxsQeIerM99ybAz_fZkQy0HBe1cpZI82nuRvE,876
|
541
545
|
plexflow/spiders/tgx/pipelines/__pycache__/validation_pipeline.cpython-312.pyc,sha256=lkUxJGiBxEbapkfSiVHK11fMLme5xeDMGjIKI2SfvhU,1034
|
@@ -626,7 +630,7 @@ plexflow/utils/strings/json_extract.py,sha256=590oY1LMnbe9COm3fD6z74OtOzxeXd3Hrf
|
|
626
630
|
plexflow/utils/strings/language.py,sha256=J9-wqmCdxf9Ws5_X1tV4vX4d7AGkKci0eaBE4Lit0j0,269
|
627
631
|
plexflow/utils/strings/sanitize.py,sha256=V-58iC4-0xIb-dgK595JbPNyyB9jZbY1xHMazXnQyuI,274
|
628
632
|
plexflow/utils/subtitle/__pycache__/search.cpython-312.pyc,sha256=VFulOf14P0m9ncFRxXwENemR8wNolA8xZykpfdAq4eg,3542
|
629
|
-
plexflow/utils/subtitle/search.py,sha256=
|
633
|
+
plexflow/utils/subtitle/search.py,sha256=HW_JOrj-cpRrVnxWh56XjRWhb98E73V1V5QHCq2y7CM,2441
|
630
634
|
plexflow/utils/tasks/__pycache__/decorators.cpython-311.pyc,sha256=8zuAsEfYLEBQQ4DGKqkx-JFCjd73kGhAiPblBNFa2cQ,1675
|
631
635
|
plexflow/utils/tasks/__pycache__/tasks.cpython-311.pyc,sha256=8RRMTHAy-t6yW0rlDX9wpZyO-9Cg4SQoD-NVasL94SQ,1670
|
632
636
|
plexflow/utils/tasks/decorators.py,sha256=1pF3bVFO2YCJd2gFNVYdmaQpbV3nRP1RxJ_OhLU-g7E,3051
|
@@ -647,7 +651,7 @@ plexflow/utils/torrent/extract/__pycache__/common.cpython-312.pyc,sha256=WTgyNFy
|
|
647
651
|
plexflow/utils/torrent/extract/__pycache__/ext.cpython-312.pyc,sha256=qRVyjKJFb5P5wGETuI05oqUxUaKvNMzBpk8jB7sHk1E,272185
|
648
652
|
plexflow/utils/torrent/extract/__pycache__/extratorrent.cpython-312.pyc,sha256=a08Mno5zwRLr5VQTzF5OFskW5cHt5kKdhJbxQRqWzF4,3448
|
649
653
|
plexflow/utils/torrent/extract/__pycache__/piratesparadise.cpython-312.pyc,sha256=waiUKJht8KLl40FvbF1Sgspqx1dxckV7Sa4Ft4sQfgw,2621
|
650
|
-
plexflow/utils/torrent/extract/__pycache__/tgx.cpython-312.pyc,sha256=
|
654
|
+
plexflow/utils/torrent/extract/__pycache__/tgx.cpython-312.pyc,sha256=rH61J6FQJZ97FC8ZwEDKNwU6lYOMenU1QvDYAD-bEwM,4659
|
651
655
|
plexflow/utils/torrent/extract/__pycache__/therarbg.cpython-312.pyc,sha256=cPovyLOodqJbjr14ROsBBhRQzRjp9KT0dC_WHb3tZCU,7889
|
652
656
|
plexflow/utils/torrent/extract/__pycache__/torrentquest.cpython-312.pyc,sha256=hOpCw3fSf5GPYxZnOv9VEW1RzsnFzTfHH5wK5ubbp3Y,7880
|
653
657
|
plexflow/utils/torrent/extract/common.py,sha256=DtEe7aUfE96pwWnVl0aUOlRBq2ps36tEfealFZp70hg,1216
|
@@ -671,7 +675,7 @@ plexflow/utils/video/__pycache__/audio.cpython-312.pyc,sha256=vXBnJwWgTDFdixMBs-
|
|
671
675
|
plexflow/utils/video/__pycache__/subtitle.cpython-312.pyc,sha256=PCjpCLydGXaRsQy6cikhgsEs8WlComfOoYPiLFqfVMA,2515
|
672
676
|
plexflow/utils/video/audio.py,sha256=tJ_lNwcjVuBQYD5cYOlXpr__eh8-hnReIgNRgIYOpqo,3380
|
673
677
|
plexflow/utils/video/subtitle.py,sha256=LOGONGxs_RzmqtGP-DBKreOzS1eUFEKo75Q6AfnavW0,1290
|
674
|
-
plexflow-0.0.
|
675
|
-
plexflow-0.0.
|
676
|
-
plexflow-0.0.
|
677
|
-
plexflow-0.0.
|
678
|
+
plexflow-0.0.81.dist-info/METADATA,sha256=eZjH3OuFgLv2-r6cT50GyuM5by2PmDhrqzFI4BO5S_E,2954
|
679
|
+
plexflow-0.0.81.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
680
|
+
plexflow-0.0.81.dist-info/entry_points.txt,sha256=aEqDHlozu_zjWrl2sibtrqtQHMgU8kSJZrE782CP47g,1362
|
681
|
+
plexflow-0.0.81.dist-info/RECORD,,
|
File without changes
|
File without changes
|