lightpdf-aipdf-mcp 0.1.41__py3-none-any.whl → 0.1.42__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.
@@ -60,9 +60,9 @@ class FileHandler:
60
60
  return path.startswith(("http://", "https://"))
61
61
 
62
62
  @staticmethod
63
- def is_oss_path(path: str) -> bool:
64
- """检查路径是否为OSS路径"""
65
- return path.startswith("oss://")
63
+ def is_oss_id(path: str) -> bool:
64
+ """检查路径是否为OSS ID"""
65
+ return path.startswith("oss_id://")
66
66
 
67
67
  @staticmethod
68
68
  def get_file_extension(file_path: str) -> str:
@@ -101,7 +101,7 @@ class FileHandler:
101
101
  bool: 文件是否存在
102
102
  """
103
103
  is_url = self.is_url(file_path)
104
- is_oss = self.is_oss_path(file_path)
104
+ is_oss = self.is_oss_id(file_path)
105
105
 
106
106
  # 对于URL或OSS路径,假设它们是有效的
107
107
  if is_url or is_oss:
@@ -172,7 +172,7 @@ class Converter(BaseApiClient):
172
172
  actual_output_format = "pdf" if is_special_operation else format
173
173
 
174
174
  # 检查是否为URL或OSS路径,如果是则跳过文件格式检查
175
- is_remote_path = self.file_handler.is_url(file_path) or self.file_handler.is_oss_path(file_path)
175
+ is_remote_path = self.file_handler.is_url(file_path) or self.file_handler.is_oss_id(file_path)
176
176
 
177
177
  if not is_remote_path:
178
178
  # 只对本地文件进行格式验证
@@ -295,9 +295,9 @@ class Converter(BaseApiClient):
295
295
  data.update(extra_params)
296
296
 
297
297
  # 检查是否为OSS路径
298
- if self.file_handler.is_oss_path(file_path):
298
+ if self.file_handler.is_oss_id(file_path):
299
299
  # OSS路径处理方式,与URL类似,但提取resource_id
300
- data["resource_id"] = file_path.split("oss://")[1]
300
+ data["resource_id"] = file_path.split("oss_id://")[1]
301
301
  # 使用JSON方式时添加Content-Type
302
302
  headers["Content-Type"] = "application/json"
303
303
  response = await client.post(
@@ -41,7 +41,7 @@ class Editor(BaseApiClient):
41
41
  bool: 如果是PDF文件则返回True,否则返回False
42
42
  """
43
43
  # 对于URL或OSS路径,跳过文件格式检查
44
- if self.file_handler.is_url(file_path) or self.file_handler.is_oss_path(file_path):
44
+ if self.file_handler.is_url(file_path) or self.file_handler.is_oss_id(file_path):
45
45
  return True
46
46
 
47
47
  input_format = self.file_handler.get_input_format(file_path)
@@ -433,9 +433,9 @@ class Editor(BaseApiClient):
433
433
  data.update(extra_params)
434
434
 
435
435
  # 检查是否为OSS路径
436
- if self.file_handler.is_oss_path(file_path):
436
+ if self.file_handler.is_oss_id(file_path):
437
437
  # OSS路径处理方式,与URL类似,但提取resource_id
438
- data["resource_id"] = file_path.split("oss://")[1]
438
+ data["resource_id"] = file_path.split("oss_id://")[1]
439
439
  # 使用JSON方式时添加Content-Type
440
440
  headers["Content-Type"] = "application/json"
441
441
  response = await client.post(
@@ -498,9 +498,9 @@ class Editor(BaseApiClient):
498
498
  if password:
499
499
  input_item["password"] = password
500
500
  url_inputs.append(input_item)
501
- elif self.file_handler.is_oss_path(file_path):
501
+ elif self.file_handler.is_oss_id(file_path):
502
502
  # 对于OSS路径,添加到inputs数组
503
- input_item = {"resource_id": file_path.split("oss://")[1]}
503
+ input_item = {"resource_id": file_path.split("oss_id://")[1]}
504
504
  if password:
505
505
  input_item["password"] = password
506
506
  url_inputs.append(input_item)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lightpdf-aipdf-mcp
3
- Version: 0.1.41
3
+ Version: 0.1.42
4
4
  Summary: MCP Server for LightPDF AI-PDF
5
5
  Author: LightPDF Team
6
6
  License: Proprietary
@@ -0,0 +1,9 @@
1
+ lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
2
+ lightpdf_aipdf_mcp/common.py,sha256=JbKSAknOVvtDIQ7QG4fxj5H1FtCMRMF8PEJw10vyN_k,6564
3
+ lightpdf_aipdf_mcp/converter.py,sha256=MxjO1yqMqfOQ9B696IyjRbtB3oZpemtD7x8arz52zoc,13312
4
+ lightpdf_aipdf_mcp/editor.py,sha256=4hU_GogU1sgZbrrJFhz8106qG18T2OixXNTQHsJTtvE,22802
5
+ lightpdf_aipdf_mcp/server.py,sha256=jXAcfLWhef5E3cle28bytDTTuMiwTMYAglbAFVF6Wlw,35737
6
+ lightpdf_aipdf_mcp-0.1.42.dist-info/METADATA,sha256=WXRb8FSntMMTz-erOUdm3fLFIbOwFIp-1bEURQqJQzI,7879
7
+ lightpdf_aipdf_mcp-0.1.42.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ lightpdf_aipdf_mcp-0.1.42.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
9
+ lightpdf_aipdf_mcp-0.1.42.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- lightpdf_aipdf_mcp/__init__.py,sha256=PPnAgpvJLYLVOTxnHDmJAulFnHJD6wuTwS6tRGjqq6s,141
2
- lightpdf_aipdf_mcp/common.py,sha256=zhd_XxO7cBiQ7A6fc1JJjcpJfRWCQBi3pfBSsrBRusg,6568
3
- lightpdf_aipdf_mcp/converter.py,sha256=SbP5CpDn1suoq9QSApw6kgqJXEc4gwF7Po3oLo5namg,13313
4
- lightpdf_aipdf_mcp/editor.py,sha256=6ELqub8uOW6kwkVz52YdFUyDmkMsN1BkTApSw6Bi-lg,22802
5
- lightpdf_aipdf_mcp/server.py,sha256=jXAcfLWhef5E3cle28bytDTTuMiwTMYAglbAFVF6Wlw,35737
6
- lightpdf_aipdf_mcp-0.1.41.dist-info/METADATA,sha256=EsB0LkJG393OYqZbfO-DzcOC0JGBujmuAx2C6sWbxGk,7879
7
- lightpdf_aipdf_mcp-0.1.41.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- lightpdf_aipdf_mcp-0.1.41.dist-info/entry_points.txt,sha256=X7TGUe52N4sYH-tYt0YUGApeJgw-efQlZA6uAZmlmr4,63
9
- lightpdf_aipdf_mcp-0.1.41.dist-info/RECORD,,