Unit3Dup 0.8.18__py3-none-any.whl → 0.8.19__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.
common/settings.py CHANGED
@@ -13,7 +13,7 @@ from common.utility import ManageTitles
13
13
  from common import trackers
14
14
 
15
15
  config_file = "Unit3Dbot.json"
16
- version = "0.8.18"
16
+ version = "0.8.19"
17
17
 
18
18
  if os.name == "nt":
19
19
  PW_TORRENT_ARCHIVE_PATH: Path = Path(os.getenv("LOCALAPPDATA", ".")) / "Unit3Dup_config" / "pw_torrent_archive"
unit3dup/__main__.py CHANGED
@@ -151,7 +151,7 @@ def main():
151
151
  # Dump
152
152
  if cli.args.dump:
153
153
  print("NOT YET IMPLEMENTED")
154
- # torrent_info.view_search(" ", inkey=False)
154
+ # torrent_info.view_search(" ", inkey=False,save=True) # Fix aggiunto Save
155
155
  return
156
156
 
157
157
  if cli.args.info:
unit3dup/duplicate.py CHANGED
@@ -139,7 +139,7 @@ class Duplicate:
139
139
  return self.search(torrent=self.torrent_info.search(self.query.guessit_title))
140
140
 
141
141
 
142
- def process_dead_torrents(self, tmdb_id: int)-> list[requests] | None:
142
+ def process_dead_torrents(self, tmdb_id: int)-> list[requests.Response] | None:
143
143
  # Get the dead torrents
144
144
  torrents = self.torrent_info.get_by_tmdb_id(tmdb_id=tmdb_id)
145
145
  dead_torrents = []
@@ -90,13 +90,15 @@ class ContentManager:
90
90
  media.display_name = self.display_name
91
91
 
92
92
  # Add language to the title from the media file when it's absent
93
- for found_languages in media.audio_languages:
94
- if found_languages not in media.display_name.upper():
95
- media.display_name = f"{media.display_name} {found_languages}"
93
+ if media.category == 'tv':
94
+ for found_languages in media.audio_languages:
95
+ if found_languages not in media.display_name.upper():
96
+ media.display_name = f"{media.display_name} {found_languages}"
96
97
  return media
97
98
  else:
98
99
  return False
99
100
 
101
+
100
102
  def search_ids(self):
101
103
  _id = re.findall(r"\{(imdb-\d+|tmdb-\d+|igdb-\d+)}", self.file_name, re.IGNORECASE)
102
104
  if _id:
@@ -166,7 +166,7 @@ class UserContent:
166
166
  return False
167
167
 
168
168
  @staticmethod
169
- def can_ressed(content: Media, tracker_name: str, cli: argparse.Namespace, tmdb_id :int) -> list[requests]:
169
+ def can_ressed(content: Media, tracker_name: str, cli: argparse.Namespace, tmdb_id :int) -> list[requests.Response]:
170
170
  """
171
171
  Search for a duplicate and compare with the user content. Delta = config.SIZE_TH
172
172
 
unit3dup/pvtTracker.py CHANGED
@@ -97,21 +97,10 @@ class Tracker(Myhttp):
97
97
  exit(1)
98
98
 
99
99
  def _post(self, file: dict, data: dict, params: dict):
100
- with open(file['torrent'], "rb") as torrent:
101
-
102
- # // Send content and mime type
103
- file_ = {
104
- "torrent": ("filename.torrent", torrent, "application/octet-stream"),
105
- }
106
-
107
- # // Send nfo
108
- if file.get('nfo', None):
109
- file_.update({"nfo": ("filename.nfo", file['nfo'], "text/plain")})
110
-
111
100
  try:
112
101
  return requests.post(
113
102
  url=self.upload_url,
114
- files=file_,
103
+ files=file,
115
104
  data=data,
116
105
  headers=self.headers,
117
106
  params=params,
@@ -327,12 +316,24 @@ class Torrents(Tracker):
327
316
 
328
317
 
329
318
  class Uploader(Tracker):
330
- def upload_t(self, data: dict, torrent_path: str, torrent_archive_path: str, nfo_path = None) -> requests:
331
- file_torrent = {"torrent": torrent_archive_path}
332
- if nfo_path:
333
- file_torrent.update({"nfo": self.encode_utf8(file_path=nfo_path)})
319
+ def upload_t(self, data: dict, torrent_archive_path: str, nfo_path=None) -> requests.Response:
320
+ files = {}
321
+ # Binary mode
322
+ with open(torrent_archive_path, 'rb') as torrent_file:
323
+ files['torrent'] = ('upload.torrent', torrent_file, 'application/x-bittorrent')
324
+
325
+ # Add the info file
326
+ if nfo_path:
327
+ with open(nfo_path, 'rb') as nfo_file:
328
+ files['nfo'] = ('file.nfo', nfo_file, 'text/plain')
329
+ # Post both
330
+ response = self._post(file=files, data=data, params=self.params)
331
+ else:
332
+ # Post the torrent
333
+ response = self._post(file=files, data=data, params=self.params)
334
+
335
+ return response
334
336
 
335
- return self._post(file=file_torrent, data=data, params=self.params)
336
337
 
337
338
  @staticmethod
338
339
  def encode_utf8(file_path:str) -> bytes | io.BytesIO:
unit3dup/upload.py CHANGED
@@ -15,9 +15,6 @@ from view import custom_console
15
15
 
16
16
  class UploadBot:
17
17
  def __init__(self, content: Media, tracker_name: str, cli: argparse):
18
-
19
- self.API_TOKEN = config_settings.tracker_config.ITT_APIKEY
20
- self.BASE_URL = config_settings.tracker_config.ITT_URL
21
18
  self.cli = cli
22
19
  self.content = content
23
20
  self.tracker_name = tracker_name
@@ -26,7 +23,7 @@ class UploadBot:
26
23
  self.sign = (f"[url=https://github.com/31December99/Unit3Dup][code][color=#00BFFF][size=14]Uploaded with Unit3Dup"
27
24
  f" {Load.version}[/size][/color][/code][/url]")
28
25
 
29
- def message(self,tracker_response: requests.Response) -> (requests, dict):
26
+ def message(self,tracker_response: requests.Response, torrent_archive: str) -> (requests, dict):
30
27
 
31
28
  name_error = ''
32
29
  info_hash_error = ''
@@ -38,6 +35,10 @@ class UploadBot:
38
35
  tracker_response_body = json.loads(tracker_response.text)
39
36
  custom_console.bot_log(f"\n[RESPONSE]-> '{self.tracker_name}'.....{tracker_response_body['message'].upper()}\n\n")
40
37
  custom_console.rule()
38
+ # https://github.com/HDInnovations/UNIT3D/pull/4910/files
39
+ # 08/09/2025
40
+ # We have to download the torrent file to get the new random info_hash generated
41
+ self.download_file(url=tracker_response_body["data"],destination_path=torrent_archive)
41
42
  return tracker_response_body["data"],{}
42
43
 
43
44
  elif tracker_response.status_code == 401:
@@ -110,7 +111,17 @@ class UploadBot:
110
111
 
111
112
  def send(self, torrent_archive: str, nfo_path = None) -> (requests, dict):
112
113
 
113
- tracker_response=self.tracker.upload_t(data=self.tracker.data, torrent_path=self.content.torrent_path,
114
- torrent_archive_path = torrent_archive,nfo_path=nfo_path)
115
- return self.message(tracker_response)
114
+ tracker_response=self.tracker.upload_t(data=self.tracker.data,torrent_archive_path = torrent_archive,
115
+ nfo_path=nfo_path)
116
+ return self.message(tracker_response=tracker_response, torrent_archive=torrent_archive)
117
+
116
118
 
119
+ @staticmethod
120
+ def download_file(url: str, destination_path: str) -> bool:
121
+ download = requests.get(url)
122
+ if download.status_code == 200:
123
+ # File archived
124
+ with open(destination_path, "wb") as file:
125
+ file.write(download.content)
126
+ return True
127
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Unit3Dup
3
- Version: 0.8.18
3
+ Version: 0.8.19
4
4
  Summary: An uploader for the Unit3D torrent tracker
5
5
  Author: Parzival
6
6
  License-Expression: MIT
@@ -8,7 +8,7 @@ common/extractor.py,sha256=WKZwt2kQfKO2VJ1rtwE_j6Zl84zICnowZq_Ql16wmRc,4564
8
8
  common/frames.py,sha256=p_jsaXII5tZTVt5ymu-w1hk2c_UMeOn3PZeuVR-wXWY,7973
9
9
  common/mediainfo.py,sha256=U2r1jJejBsV8GP3iPk4O8_NkHO5RQ9Kkh2bKwVNUBmg,6229
10
10
  common/mediainfo_string.py,sha256=8vuWlF2bqWRKpDbn81bV2fPA7hbl7RwOnxN2i4E3zNE,3958
11
- common/settings.py,sha256=MoAZtb9SLhLERwvyLVXSF7V061gui4O-Y8DHDqxSoBY,32782
11
+ common/settings.py,sha256=Ya9o1O1A4mZyMO2vA4U9bsUr5WnWUO1BRCT_VGMKlq8,32782
12
12
  common/title.py,sha256=nFainfUBTYW9ML4Y-CB9ZFD_Es-OZXcAMPUo6D09u3k,3793
13
13
  common/torrent_clients.py,sha256=NOIpYtLG_bA19HwcH9ahGFmGNtRkoMO6nAjma-JzDfs,12040
14
14
  common/utility.py,sha256=1CJQKK7OejlX1eFo-A2dqHtDRgTbJ_7XbJYWT2oZISQ,8811
@@ -63,19 +63,19 @@ common/trackers/itt.py,sha256=cB0D5ZpMbGgEOAKloET9dS_fAFclhzwPPwRFt-LStX0,4019
63
63
  common/trackers/sis.py,sha256=AahQH-FxAqS19vgEFylOJzeY0_SHr27_Tibs7lraSdI,3480
64
64
  common/trackers/trackers.py,sha256=sts5l_x27V2Op1Y6Au5FoQujspSkWMPWyEYMfcmVYLA,1467
65
65
  unit3dup/__init__.py,sha256=seXz3lHgdrUBiOnhC6Je47npS66UZ0c62VFuoH3z5Mk,78
66
- unit3dup/__main__.py,sha256=OR0GRGEeV54TRBj3lA2aKdnHLzjLllQSzgH672QgzFg,9070
66
+ unit3dup/__main__.py,sha256=9Jd80f9JxWf6TC6uztz_Q-qgbCUXcXsqmtFxXGdTqXE,9100
67
67
  unit3dup/automode.py,sha256=JbHIvK5mHbNxpq_m5o26FEpqEUlL9XbTyUUPvKD6EqQ,4412
68
68
  unit3dup/bot.py,sha256=2P24z_8UM58binKqrM0eIXxPTiWEduyK2bdfVkmxPEQ,8759
69
- unit3dup/duplicate.py,sha256=Ji1Y9vVLmhFQ5rgkUU-s7uXl-jC8akAa8OiQOfjFa9g,10428
69
+ unit3dup/duplicate.py,sha256=0soPxYGTB6P5tb-iIUbZTdcI0-8CJntzoG5PnKNJ1vg,10437
70
70
  unit3dup/exceptions.py,sha256=DhlcbbZEuvEYk5VSZTnle8oRg5I8Pq6Y6fxXTdOOOfo,4078
71
71
  unit3dup/media.py,sha256=u0N2Wu4yt_oCUq_FPwnFq0oV8_lHDYAeXW4uhqpgJAI,13677
72
72
  unit3dup/pvtDocu.py,sha256=ZLMaal2fn6ZcFPLtET0LTmYEPjhJmLitEjkICHrm9CQ,4594
73
73
  unit3dup/pvtTorrent.py,sha256=cItlsCpcUJL23iXQHy0YzrrvV3JSl54UlBgm8_UROAs,2559
74
- unit3dup/pvtTracker.py,sha256=U4xMmhiqMNZaIOgEi3pnP-3H75e7Gagndh8GDFEP7Cs,18647
74
+ unit3dup/pvtTracker.py,sha256=HqrXq3kmkuXOPQSw-11PdY_HsmzZpc5osYswh5_3UEY,18690
75
75
  unit3dup/pvtVideo.py,sha256=w_T6wEeGrsHkuR3KObJc4mNpJgg9hhHh_9LoxFlaqjM,3900
76
76
  unit3dup/torrent.py,sha256=surV0royo_GCEvdlPIP1S9gvFvJb1u26XM11rZOGVEg,20064
77
- unit3dup/upload.py,sha256=gjB8u2oP2FPXZ8t9SMIzkUEr52hKRy_zSR8OWJlW2xc,6075
78
- unit3dup/media_manager/ContentManager.py,sha256=raLiFLWN4kpyjPup70xaa77yRdL8FkmCMMrN9hjq6A4,7435
77
+ unit3dup/upload.py,sha256=qGn9L-l2gL2K8hbU97c-fnWZFNe2vehFaPgDiQHUxfU,6612
78
+ unit3dup/media_manager/ContentManager.py,sha256=8oibia1wQGY2M1e1WYJPpEKbDIFVkoyOdzbAwtEz020,7489
79
79
  unit3dup/media_manager/DocuManager.py,sha256=oFt7jlxj-gIUty9PADBQV5a24bsv3yhjKhwI6niOhf4,3116
80
80
  unit3dup/media_manager/GameManager.py,sha256=9EmPeNrirOwaVOj-vkLr29Xo7daIA4ssqrrt0WyMl30,4090
81
81
  unit3dup/media_manager/MediaInfoManager.py,sha256=0NO9dgD7seJM67B3DRnwvRIdoy7bfquBUox-PnHInK8,1081
@@ -83,15 +83,15 @@ unit3dup/media_manager/SeedManager.py,sha256=Vqpf_xpGbxsJHg0C3-kL0_tdF4f2FRPlZH7
83
83
  unit3dup/media_manager/TorrentManager.py,sha256=qqM1d1TyfBuruXtKLRbQ8gFk3_2JNH9dOa6Yg-QnDCw,6507
84
84
  unit3dup/media_manager/VideoManager.py,sha256=O1NzGnWiWPfMgjyV6h9_b9b8M5tzFtpje9cvI2g6Nc0,5437
85
85
  unit3dup/media_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
- unit3dup/media_manager/common.py,sha256=hG2zOw7ocQfZyI1dhusbehxswpIrZK7T2aAbCNwULqA,10138
86
+ unit3dup/media_manager/common.py,sha256=EDsD1FVNiWPS9teHs5vyGkYkC92gzFdSanMyMAR5vpU,10147
87
87
  unit3dup/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  unit3dup/web/main.py,sha256=BzjKDgAjKZMnoQwx7nDDbs_64kCrFO1VYpbHmsGiFVc,1267
89
- unit3dup-0.8.18.dist-info/licenses/LICENSE,sha256=GNAZDLhU0xz8QPbIyHAOYlVnQYDvKWk2N9fZJMhqaG8,1090
89
+ unit3dup-0.8.19.dist-info/licenses/LICENSE,sha256=GNAZDLhU0xz8QPbIyHAOYlVnQYDvKWk2N9fZJMhqaG8,1090
90
90
  view/__init__.py,sha256=XIzb6rl58HmYPnksD73cYMFF88dn6FHa3u7bOHFbChk,81
91
91
  view/custom_console.py,sha256=OITmkEoQH9N_uE5ElPaSdc8XvaLzE9wcwTbOHtcMvrI,5629
92
92
  view/web_console.py,sha256=YkxutJK5GqswMKEF77EllphPYQW0eb8OIBlplucHhvM,7697
93
- unit3dup-0.8.18.dist-info/METADATA,sha256=2csisJh3MRKDo68f3R0pIBZ0i4I2ccLDtbTeKN8KsLE,4864
94
- unit3dup-0.8.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
- unit3dup-0.8.18.dist-info/entry_points.txt,sha256=fxXSyI6-r6jy9_v-C5ZHm03q1aC3tE9EvCQZxC1NQnI,52
96
- unit3dup-0.8.18.dist-info/top_level.txt,sha256=19NVMnQNkJxBUKebRNaYCRs56A5CO4U1L67GMQCPiLU,21
97
- unit3dup-0.8.18.dist-info/RECORD,,
93
+ unit3dup-0.8.19.dist-info/METADATA,sha256=8Yzq7AJKWLurRUHTMj5Jh5YE65w6BkJmoykpnLd-xS8,4864
94
+ unit3dup-0.8.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
95
+ unit3dup-0.8.19.dist-info/entry_points.txt,sha256=fxXSyI6-r6jy9_v-C5ZHm03q1aC3tE9EvCQZxC1NQnI,52
96
+ unit3dup-0.8.19.dist-info/top_level.txt,sha256=19NVMnQNkJxBUKebRNaYCRs56A5CO4U1L67GMQCPiLU,21
97
+ unit3dup-0.8.19.dist-info/RECORD,,