cobweb-launcher 3.1.31__py3-none-any.whl → 3.1.32__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.
cobweb/base/request.py CHANGED
@@ -520,14 +520,23 @@ class Request:
520
520
  url=self.url,
521
521
  **test_range_settings
522
522
  )
523
+ head_data = test_response.content
524
+ content_type = test_response.headers.get("Content-Type")
525
+
523
526
  if test_response.status_code == 206:
524
- actual_length = len(test_response.content)
525
- if actual_length != 64:
526
- logging.debug(f"⚠️ Range请求返回长度不匹配: 期望64, 实际{actual_length}")
527
+ if len(head_data) != 64:
528
+ logging.debug(f"⚠️ Range请求返回长度不匹配: 期望64, 实际{len(head_data)}")
527
529
  supports_range = False
530
+ else:
531
+ detector = FileTypeDetector()
532
+ self.detector_info = detector.get_detailed_info(
533
+ url=self.url, content_type=content_type, data=head_data
534
+ )
528
535
  else:
529
536
  supports_range = False
530
537
 
538
+ test_response.close()
539
+
531
540
  return supports_range
532
541
 
533
542
  def detect_file_type(self) -> Dict[str, Any]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cobweb-launcher
3
- Version: 3.1.31
3
+ Version: 3.1.32
4
4
  Summary: spider_hole
5
5
  Home-page: https://github.com/Juannie-PP/cobweb
6
6
  Author: Juannie-PP
@@ -5,7 +5,7 @@ cobweb/base/__init__.py,sha256=NanSxJr0WsqjqCNOQAlxlkt-vQEsERHYBzacFC057oI,222
5
5
  cobweb/base/common_queue.py,sha256=hYdaM70KrWjvACuLKaGhkI2VqFCnd87NVvWzmnfIg8Q,1423
6
6
  cobweb/base/item.py,sha256=1bS4U_3vzI2jzSSeoEbLoLT_5CfgLPopWiEYtaahbvw,1674
7
7
  cobweb/base/logger.py,sha256=Vsg1bD4LXW91VgY-ANsmaUu-mD88hU_WS83f7jX3qF8,2011
8
- cobweb/base/request.py,sha256=WQq35IjRlUO_3bBBvgyuFb_9vyy7WjK-CJBkcYbEFwg,20597
8
+ cobweb/base/request.py,sha256=_NRqwZJGwlWgxSzSQjuDEilT0_ckPPRrxpUKUReKTq4,20934
9
9
  cobweb/base/response.py,sha256=L3sX2PskV744uz3BJ8xMuAoAfGCeh20w8h0Cnd9vLo0,11377
10
10
  cobweb/base/seed.py,sha256=ddaWCq_KaWwpmPl1CToJlfCxEEnoJ16kjo6azJs9uls,5000
11
11
  cobweb/base/task_queue.py,sha256=2MqGpHGNmK5B-kqv7z420RWyihzB9zgDHJUiLsmtzOI,6402
@@ -34,8 +34,8 @@ cobweb/utils/decorators.py,sha256=ZwVQlz-lYHgXgKf9KRCp15EWPzTDdhoikYUNUCIqNeM,11
34
34
  cobweb/utils/dotting.py,sha256=L-jGSApdnFIP4jUWH6p5qIme0aJ1vyDrxAx8wOJWvcs,1960
35
35
  cobweb/utils/oss.py,sha256=wmToIIVNO8nCQVRmreVaZejk01aCWS35e1NV6cr0yGI,4192
36
36
  cobweb/utils/tools.py,sha256=14TCedqt07m4z6bCnFAsITOFixeGr8V3aOKk--L7Cr0,879
37
- cobweb_launcher-3.1.31.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
38
- cobweb_launcher-3.1.31.dist-info/METADATA,sha256=m15hyIjwAYFJyAOKXrmTEuWlVPvAySayjWjNHwVO4CY,6051
39
- cobweb_launcher-3.1.31.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
40
- cobweb_launcher-3.1.31.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
41
- cobweb_launcher-3.1.31.dist-info/RECORD,,
37
+ cobweb_launcher-3.1.32.dist-info/LICENSE,sha256=z1rxSIGOyzcSb3orZxFPxzx-0C1vTocmswqBNxpKfEk,1063
38
+ cobweb_launcher-3.1.32.dist-info/METADATA,sha256=8SmVQDWc48GUGuhEUx8cjOtjD4LtgNG9-2_n0UeJgGc,6051
39
+ cobweb_launcher-3.1.32.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
40
+ cobweb_launcher-3.1.32.dist-info/top_level.txt,sha256=4GETBGNsKqiCUezmT-mJn7tjhcDlu7nLIV5gGgHBW4I,7
41
+ cobweb_launcher-3.1.32.dist-info/RECORD,,