Unit3Dup 0.12.2__tar.gz → 0.13.1__tar.gz

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.
Files changed (109) hide show
  1. {unit3dup-0.12.2 → unit3dup-0.13.1}/PKG-INFO +4 -2
  2. {unit3dup-0.12.2 → unit3dup-0.13.1}/README.rst +3 -1
  3. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/PKG-INFO +4 -2
  4. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/SOURCES.txt +2 -1
  5. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/api.py +39 -3
  6. unit3dup-0.13.1/common/external_services/theMovieDB/core/models/movie/alternative.py +2 -0
  7. unit3dup-0.13.1/common/external_services/theMovieDB/core/models/movie/translations.py +33 -0
  8. unit3dup-0.13.1/common/external_services/theMovieDB/core/models/tvshow/translations.py +45 -0
  9. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/settings.py +2 -2
  10. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/torrent_clients.py +21 -12
  11. {unit3dup-0.12.2 → unit3dup-0.13.1}/pyproject.toml +1 -1
  12. unit3dup-0.12.2/common/external_services/theMovieDB/core/models/movie/alternative_titles.py +0 -53
  13. unit3dup-0.12.2/common/external_services/theMovieDB/core/models/tvshow/translations.py +0 -49
  14. {unit3dup-0.12.2 → unit3dup-0.13.1}/LICENSE +0 -0
  15. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/dependency_links.txt +0 -0
  16. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/entry_points.txt +0 -0
  17. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/requires.txt +0 -0
  18. {unit3dup-0.12.2 → unit3dup-0.13.1}/Unit3Dup.egg-info/top_level.txt +0 -0
  19. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/__init__.py +0 -0
  20. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/bdinfo_string.py +0 -0
  21. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/bittorrent.py +0 -0
  22. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/command.py +0 -0
  23. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/constants.py +0 -0
  24. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/database.py +0 -0
  25. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/__init__.py +0 -0
  26. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/__init__.py +0 -0
  27. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/client.py +0 -0
  28. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/__init__.py +0 -0
  29. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/ftpx_service.py +0 -0
  30. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/ftpx_session.py +0 -0
  31. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/menu.py +0 -0
  32. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/models/__init__.py +0 -0
  33. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/ftpx/core/models/list.py +0 -0
  34. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/__init__.py +0 -0
  35. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/client.py +0 -0
  36. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/__init__.py +0 -0
  37. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/api.py +0 -0
  38. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/models/__init__.py +0 -0
  39. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/models/search.py +0 -0
  40. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/platformid.py +0 -0
  41. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/igdb/core/tags.py +0 -0
  42. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/imageHost.py +0 -0
  43. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/mediaresult.py +0 -0
  44. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/sessions/__init__.py +0 -0
  45. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/sessions/agents.py +0 -0
  46. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/sessions/exceptions.py +0 -0
  47. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/sessions/session.py +0 -0
  48. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/__init__.py +0 -0
  49. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/__init__.py +0 -0
  50. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/keywords.py +0 -0
  51. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/__init__.py +0 -0
  52. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/movie/__init__.py +0 -0
  53. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/movie/details.py +0 -0
  54. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/movie/movie.py +0 -0
  55. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/movie/nowplaying.py +0 -0
  56. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/movie/release_info.py +0 -0
  57. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/tvshow/__init__.py +0 -0
  58. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/tvshow/alternative.py +0 -0
  59. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/tvshow/details.py +0 -0
  60. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/tvshow/on_the_air.py +0 -0
  61. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/models/tvshow/tvshow.py +0 -0
  62. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/theMovieDB/core/videos.py +0 -0
  63. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/trailers/__init__.py +0 -0
  64. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/trailers/api.py +0 -0
  65. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/trailers/response.py +0 -0
  66. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/external_services/tvdb.py +0 -0
  67. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/extractor.py +0 -0
  68. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/frames.py +0 -0
  69. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/mediainfo.py +0 -0
  70. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/mediainfo_string.py +0 -0
  71. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/tags.py +0 -0
  72. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/title.py +0 -0
  73. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/__init__.py +0 -0
  74. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/ast.py +0 -0
  75. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/ban_list.py +0 -0
  76. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/data.py +0 -0
  77. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/itt.py +0 -0
  78. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/ptt.py +0 -0
  79. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/signs_list.py +0 -0
  80. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/sis.py +0 -0
  81. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/tags_list.py +0 -0
  82. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/trackers/trackers.py +0 -0
  83. {unit3dup-0.12.2 → unit3dup-0.13.1}/common/utility.py +0 -0
  84. {unit3dup-0.12.2 → unit3dup-0.13.1}/requirements.txt +0 -0
  85. {unit3dup-0.12.2 → unit3dup-0.13.1}/setup.cfg +0 -0
  86. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/__init__.py +0 -0
  87. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/__main__.py +0 -0
  88. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/automode.py +0 -0
  89. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/bot.py +0 -0
  90. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/duplicate.py +0 -0
  91. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/exceptions.py +0 -0
  92. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media.py +0 -0
  93. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/ContentManager.py +0 -0
  94. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/DocuManager.py +0 -0
  95. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/GameManager.py +0 -0
  96. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/MediaInfoManager.py +0 -0
  97. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/SeedManager.py +0 -0
  98. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/TorrentManager.py +0 -0
  99. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/VideoManager.py +0 -0
  100. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/__init__.py +0 -0
  101. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/media_manager/common.py +0 -0
  102. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/pvtDocu.py +0 -0
  103. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/pvtTorrent.py +0 -0
  104. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/pvtTracker.py +0 -0
  105. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/pvtVideo.py +0 -0
  106. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/torrent.py +0 -0
  107. {unit3dup-0.12.2 → unit3dup-0.13.1}/unit3dup/upload.py +0 -0
  108. {unit3dup-0.12.2 → unit3dup-0.13.1}/view/__init__.py +0 -0
  109. {unit3dup-0.12.2 → unit3dup-0.13.1}/view/custom_console.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Unit3Dup
3
- Version: 0.12.2
3
+ Version: 0.13.1
4
4
  Summary: An uploader for the Unit3D torrent tracker
5
5
  Author: Parzival
6
6
  License-Expression: MIT
@@ -109,7 +109,9 @@ RUN
109
109
  DOC
110
110
  ===
111
111
 
112
- Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/commands/>`_
112
+ Full documentation `Unit3Dup Docs <https://31december99.github.io/Unit3Dup/>`_
113
+
114
+ Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/reference/commands/>`_
113
115
 
114
116
 
115
117
  ImageHost
@@ -78,7 +78,9 @@ RUN
78
78
  DOC
79
79
  ===
80
80
 
81
- Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/commands/>`_
81
+ Full documentation `Unit3Dup Docs <https://31december99.github.io/Unit3Dup/>`_
82
+
83
+ Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/reference/commands/>`_
82
84
 
83
85
 
84
86
  ImageHost
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Unit3Dup
3
- Version: 0.12.2
3
+ Version: 0.13.1
4
4
  Summary: An uploader for the Unit3D torrent tracker
5
5
  Author: Parzival
6
6
  License-Expression: MIT
@@ -109,7 +109,9 @@ RUN
109
109
  DOC
110
110
  ===
111
111
 
112
- Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/commands/>`_
112
+ Full documentation `Unit3Dup Docs <https://31december99.github.io/Unit3Dup/>`_
113
+
114
+ Commands list `Unit3Dup <https://31december99.github.io/Unit3Dup/reference/commands/>`_
113
115
 
114
116
 
115
117
  ImageHost
@@ -54,11 +54,12 @@ common/external_services/theMovieDB/core/keywords.py
54
54
  common/external_services/theMovieDB/core/videos.py
55
55
  common/external_services/theMovieDB/core/models/__init__.py
56
56
  common/external_services/theMovieDB/core/models/movie/__init__.py
57
- common/external_services/theMovieDB/core/models/movie/alternative_titles.py
57
+ common/external_services/theMovieDB/core/models/movie/alternative.py
58
58
  common/external_services/theMovieDB/core/models/movie/details.py
59
59
  common/external_services/theMovieDB/core/models/movie/movie.py
60
60
  common/external_services/theMovieDB/core/models/movie/nowplaying.py
61
61
  common/external_services/theMovieDB/core/models/movie/release_info.py
62
+ common/external_services/theMovieDB/core/models/movie/translations.py
62
63
  common/external_services/theMovieDB/core/models/tvshow/__init__.py
63
64
  common/external_services/theMovieDB/core/models/tvshow/alternative.py
64
65
  common/external_services/theMovieDB/core/models/tvshow/details.py
@@ -7,6 +7,9 @@ import diskcache
7
7
  from typing import TypeVar
8
8
 
9
9
  from common.external_services.theMovieDB.core.models.tvshow.alternative import Alternative
10
+
11
+ from common.external_services.theMovieDB.core.models.tvshow.translations import Translation
12
+ from common.external_services.theMovieDB.core.models.movie.translations import Translation
10
13
  from common.external_services.theMovieDB.core.models.tvshow.details import TVShowDetails
11
14
  from common.external_services.theMovieDB.core.models.movie.details import MovieDetails
12
15
  from common.external_services.theMovieDB.core.models.movie.nowplaying import NowPlaying
@@ -26,7 +29,6 @@ from common.utility import ManageTitles
26
29
  from unit3dup.media import Media
27
30
  from view import custom_console
28
31
 
29
-
30
32
  from unit3dup import config_settings
31
33
 
32
34
  base_url = "https://api.themoviedb.org/3"
@@ -47,6 +49,11 @@ class MovieEndpoint:
47
49
  return {'url': f'{base_url}/movie/{movie_id}/alternative_titles', 'datatype': Alternative, 'query': '',
48
50
  'results': 'titles'}
49
51
 
52
+ @staticmethod
53
+ def translations(movie_id: int) -> dict:
54
+ return {'url': f'{base_url}/movie/{movie_id}/translations', 'datatype': Translation, 'query': '',
55
+ 'results': 'translations'}
56
+
50
57
  @staticmethod
51
58
  def videos(movie_id: int) -> dict:
52
59
  return {'url': f'{base_url}/movie/{movie_id}/videos', 'datatype': Videos, 'query': '',
@@ -76,6 +83,11 @@ class TvEndpoint:
76
83
  return {'url': f'{base_url}/tv/{serie_id}/alternative_titles', 'datatype': Alternative, 'query': '',
77
84
  'results': 'results'}
78
85
 
86
+ @staticmethod
87
+ def translations(serie_id: int) -> dict:
88
+ return {'url': f'{base_url}/tv/{serie_id}/translations', 'datatype': Translation, 'query': '',
89
+ 'results': 'translations'}
90
+
79
91
  @staticmethod
80
92
  def videos(serie_id: int) -> dict:
81
93
  return {'url': f'{base_url}/tv/{serie_id}/videos', 'datatype': Videos, 'query': '',
@@ -119,7 +131,7 @@ class TmdbAPI(MyHttp):
119
131
 
120
132
  def _search(self, query: str, category: str) -> list[T] | None:
121
133
  """
122
- Searches for data based on a query and category.
134
+ Searches for data based on a query and category
123
135
  :param query: search query
124
136
  :param category: category of the search query, e.g., 'movie' or 'tv'
125
137
  :return: list of T or None
@@ -151,7 +163,7 @@ class TmdbAPI(MyHttp):
151
163
 
152
164
  def alternative(self, media_id: int, category: str) -> list[T] | None:
153
165
  """
154
- Searches for data based on a query and category.
166
+ Searches for data based on a query and category
155
167
  :param media_id: id of the media to search for
156
168
  :param category: category of the search query, e.g., 'movie' or 'tv'
157
169
  :return: list of T or None
@@ -163,6 +175,20 @@ class TmdbAPI(MyHttp):
163
175
  print(f"Endpoint for category '{category}' not found.")
164
176
  return []
165
177
 
178
+ def translations(self, media_id: int, category: str) -> list[T] | None:
179
+ """
180
+ Searches for data based on a query and category
181
+ :param media_id: id of the media to search for
182
+ :param category: category of the search query, e.g., 'movie' or 'tv'
183
+ :return: list of T or None
184
+ """
185
+ if endpoint_class := self.ENDPOINTS.get(category):
186
+ request = endpoint_class.translations(media_id)
187
+ return self.request(endpoint=request)
188
+ else:
189
+ print(f"Endpoint for category '{category}' not found.")
190
+ return []
191
+
166
192
  def _videos(self, video_id: int, category: str) -> list[T] | None:
167
193
  if endpoint_class := self.ENDPOINTS.get(category):
168
194
  request = endpoint_class.videos(video_id)
@@ -262,6 +288,16 @@ class DbOnline(TmdbAPI):
262
288
  for alt in alternative:
263
289
  if ManageTitles.fuzzyit(str1=self.query, str2=alt.title) > 95:
264
290
  return result
291
+
292
+ for result in results:
293
+ translations = self.translations(media_id=result.id, category=self.category)
294
+ if translations:
295
+ for tr in translations:
296
+ if tr.data:
297
+ title = tr.data.name or tr.data.title
298
+ if title:
299
+ if ManageTitles.fuzzyit(self.query, title) > 95:
300
+ return result
265
301
  return False
266
302
 
267
303
  def results_in_string(self, tmdb_id: int, imdb_id: int, tvdb_id: int) -> MediaResult:
@@ -0,0 +1,2 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Same dataclass used for TV
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from dataclasses import dataclass
4
+ from typing import List
5
+
6
+ #Movie
7
+ @dataclass
8
+ class TranslationData:
9
+ homepage: str | None = None
10
+ overview: str | None = None
11
+ runtime: int | None = None
12
+ tagline: str | None = None
13
+ title: str | None = None
14
+ name: str | None = None
15
+
16
+
17
+ @dataclass
18
+ class Translation:
19
+ iso_3166_1: str
20
+ iso_639_1: str
21
+ name: str
22
+ english_name: str
23
+ data: TranslationData | dict
24
+
25
+ def __post_init__(self):
26
+ if isinstance(self.data, dict):
27
+ self.data = TranslationData(**self.data)
28
+
29
+
30
+ @dataclass
31
+ class TranslationsResponse:
32
+ id: int
33
+ translations: List[Translation]
@@ -0,0 +1,45 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Any
5
+
6
+
7
+ @dataclass
8
+ class TvTranslationData:
9
+ homepage: str | None = None
10
+ overview: str | None = None
11
+ tagline: str | None = None
12
+ name: str | None = None
13
+
14
+ @staticmethod
15
+ def from_data(data: dict[str, Any]) -> "TvTranslationData":
16
+ return TvTranslationData(
17
+ homepage=data.get("homepage"),
18
+ overview=data.get("overview"),
19
+ tagline=data.get("tagline"),
20
+ name=data.get("name"),
21
+ )
22
+
23
+
24
+ @dataclass
25
+ class TvTranslation:
26
+ iso_3166_1: str
27
+ iso_639_1: str
28
+ name: str
29
+ english_name: str
30
+ data: TvTranslationData | None = None
31
+
32
+ @staticmethod
33
+ def from_data(data: dict[str, Any]) -> "TvTranslation":
34
+ return TvTranslation(
35
+ iso_3166_1=data["iso_3166_1"],
36
+ iso_639_1=data["iso_639_1"],
37
+ name=data["name"],
38
+ english_name=data["english_name"],
39
+ data=TvTranslationData.from_data(data.get("data", {})) if data.get("data") else None,
40
+ )
41
+
42
+ @dataclass
43
+ class Translation:
44
+ id: int
45
+ translations: list[TvTranslation]
@@ -24,7 +24,7 @@ user_tags_file = "tags_list.json"
24
24
  user_sign_file = "sign_list.json"
25
25
  bane_file = "ban_list.json"
26
26
 
27
- version = "0.12.2"
27
+ version = "0.13.1"
28
28
 
29
29
  if os.name == "nt":
30
30
  WATCHER_DESTINATION_PATH: Path = Path(
@@ -454,7 +454,7 @@ class Config(BaseModel):
454
454
  section[field] = Validate.integer(value=section[field], field_name=field)
455
455
 
456
456
  if field in ['QBIT_PASS', 'TRASM_PASS', 'RTORR_PASS', 'QBIT_USER', 'TRASM_USER', 'RTORR_USER',
457
- 'TORRENT_CLIENT', 'TAG', 'CATEGORY_MOVIE','CATEGORY_TV', 'RTORR_HOST']:
457
+ 'TORRENT_CLIENT', 'TAG', 'RTORR_HOST']:
458
458
  section[field] = Validate.string(value=section[field], field_name=field)
459
459
 
460
460
  if field in ['SHARED_TRASM_PATH', 'SHARED_QBIT_PATH', 'SHARED_RTORR_PATH']:
@@ -150,9 +150,9 @@ class QbittorrentClient(TorrClient):
150
150
  f"{self.__class__.__name__} Please verify your configuration"
151
151
  )
152
152
 
153
- def _add_torrent_and_tag(self, torrent_bytes: bytes, save_path: str, info_hash: str,category: str) -> None:
153
+ def _add_torrent_and_tag(self, torrent_bytes: bytes, save_path: str, info_hash: str, category: str) -> None:
154
154
 
155
- self.client.torrents_add(torrent_files=torrent_bytes,save_path=save_path)
155
+ self.client.torrents_add(torrent_files=torrent_bytes, save_path=save_path)
156
156
 
157
157
  # wait for torrent to be registered
158
158
  for _ in range(20):
@@ -164,9 +164,9 @@ class QbittorrentClient(TorrClient):
164
164
  pass
165
165
  time.sleep(0.25)
166
166
 
167
- if category=='movie':
167
+ if category == 'movie':
168
168
  category = config_settings.torrent_client_config.CATEGORY_MOVIE
169
- if category=='tv':
169
+ if category == 'tv':
170
170
  category = config_settings.torrent_client_config.CATEGORY_MOVIE
171
171
 
172
172
  try:
@@ -176,13 +176,22 @@ class QbittorrentClient(TorrClient):
176
176
 
177
177
  self.client.torrents_add_tags(tags=config_settings.torrent_client_config.TAG, torrent_hashes=info_hash)
178
178
 
179
- def send_to_client(self, tracker_data_response: str, torrent: Mytorrent, content: Media,archive_path: str):
179
+ def send_to_client(self, tracker_data_response: str, torrent: Mytorrent, content: Media, archive_path: str):
180
180
 
181
+ # Check if shared path exists
181
182
  if config_settings.torrent_client_config.SHARED_QBIT_PATH:
182
- torr_location = (
183
- config_settings.torrent_client_config.SHARED_QBIT_PATH
184
- )
183
+ torr_location = config_settings.torrent_client_config.SHARED_QBIT_PATH
184
+
185
+ # append the category Serie to the shared path
186
+ if 'tv' in content.category.lower():
187
+ torr_location = os.path.join(torr_location, config_settings.torrent_client_config.CATEGORY_TV)
188
+
189
+ # append the category Movie to the shared path
190
+ if 'movie' in content.category.lower():
191
+ torr_location = os.path.join(torr_location, config_settings.torrent_client_config.CATEGORY_MOVIE)
192
+
185
193
  else:
194
+ # otherwise set torr_location using the cli path
186
195
  torr_location = os.path.dirname(content.torrent_path)
187
196
 
188
197
  if not torrent:
@@ -192,16 +201,16 @@ class QbittorrentClient(TorrClient):
192
201
  info = bencode2.bdecode(torrent_data)[b"info"]
193
202
  info_hash = hashlib.sha1(bencode2.bencode(info)).hexdigest()
194
203
  file_buffer.seek(0)
195
- self._add_torrent_and_tag(torrent_bytes=file_buffer.read(),save_path=str(torr_location),
196
- info_hash=info_hash, category = content.category)
204
+ self._add_torrent_and_tag(torrent_bytes=file_buffer.read(), save_path=str(torr_location),
205
+ info_hash=info_hash, category=content.category)
197
206
  else:
198
207
  info = torrent.mytorr.metainfo["info"]
199
208
  info_hash = hashlib.sha1(
200
209
  bencode2.bencode(info)
201
210
  ).hexdigest()
202
211
  with open(archive_path, "rb") as file_buffer:
203
- self._add_torrent_and_tag(torrent_bytes=file_buffer.read(),save_path=str(torr_location),
204
- info_hash=info_hash, category = content.category)
212
+ self._add_torrent_and_tag(torrent_bytes=file_buffer.read(), save_path=str(torr_location),
213
+ info_hash=info_hash, category=content.category)
205
214
 
206
215
 
207
216
  class RTorrentClient(TorrClient):
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  dynamic = ["dependencies"]
7
7
  name = "Unit3Dup"
8
- version = "0.12.2"
8
+ version = "0.13.1"
9
9
  description = "An uploader for the Unit3D torrent tracker"
10
10
  readme = "README.rst"
11
11
  requires-python = ">=3.10"
@@ -1,53 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from dataclasses import dataclass, field
4
- from common.external_services import logger
5
- from typing import Any
6
- import json
7
-
8
-
9
- @dataclass
10
- class Title:
11
- iso_3166_1: str
12
- title: str
13
- type: str | None = None
14
- logger: logger = field(init=False, repr=False)
15
-
16
- def __post_init__(self):
17
- """
18
- method invoked right after the __init__ method !
19
- """
20
- self.logger = logger.getChild(self.__class__.__name__)
21
-
22
- @staticmethod
23
- def from_data(data: dict[str, Any]) -> "Title | None":
24
- try:
25
- return Title(
26
- iso_3166_1=data["iso_3166_1"],
27
- title=data["title"],
28
- type=data.get("type"),
29
- )
30
- except KeyError as e:
31
- logger.debug(f"Missing key in Title data: {e}")
32
- return None
33
- except TypeError as e:
34
- logger.debug(f"Type error in Title data: {e}")
35
- return None
36
-
37
-
38
- @dataclass
39
- class AltTitle:
40
- id: int
41
- titles: list[Title]
42
-
43
- @classmethod
44
- def validate(cls, json_str: str) -> "AltTitle":
45
- data = json.loads(json_str)
46
- id_ = data.get("id", 0)
47
- titles_data = data.get("titles", [])
48
- titles = [
49
- Title.from_data(title_data)
50
- for title_data in titles_data
51
- if Title.from_data(title_data) is not None
52
- ]
53
- return cls(id=id_, titles=titles)
@@ -1,49 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- from dataclasses import dataclass
4
-
5
-
6
- @dataclass
7
- class Translation:
8
- """
9
- Represents a TV show translation
10
- """
11
- iso_639_1: str
12
- """
13
- Language code of the translation
14
- """
15
- english_name: str
16
- """
17
- English name of the language
18
- """
19
- name: str
20
- """
21
- Name of the translation
22
- """
23
- url: str | None
24
- """
25
- Optional URL associated with the translation
26
- """
27
- tagline: str | None
28
- """
29
- Optional tagline for the translation
30
- """
31
- description: str | None
32
- """
33
- Optional description for the translation
34
- """
35
- country: str | None
36
- """
37
- Optional country code related to the translation
38
- """
39
-
40
-
41
- @dataclass
42
- class TranslationsResponse:
43
- """
44
- Contains a list of TV show translations
45
- """
46
- translations: list[Translation]
47
- """
48
- List of Translation objects
49
- """
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes