PyPtt 1.2.11__tar.gz → 1.2.12__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 (52) hide show
  1. {pyptt-1.2.11 → pyptt-1.2.12}/PKG-INFO +2 -1
  2. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/__init__.py +1 -1
  3. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/connect_core.py +6 -2
  4. pyptt-1.2.12/PyPtt/ssl_config.py +24 -0
  5. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt.egg-info/PKG-INFO +2 -1
  6. {pyptt-1.2.11 → pyptt-1.2.12}/README.md +2 -1
  7. pyptt-1.2.11/PyPtt/ssl_config.py +0 -25
  8. {pyptt-1.2.11 → pyptt-1.2.12}/LICENSE +0 -0
  9. {pyptt-1.2.11 → pyptt-1.2.12}/MANIFEST.in +0 -0
  10. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/PTT.py +0 -0
  11. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_bucket.py +0 -0
  12. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_call_status.py +0 -0
  13. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_change_pw.py +0 -0
  14. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_comment.py +0 -0
  15. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_del_post.py +0 -0
  16. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_board_info.py +0 -0
  17. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_board_list.py +0 -0
  18. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_bottom_post_list.py +0 -0
  19. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_favourite_board.py +0 -0
  20. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_newest_index.py +0 -0
  21. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_post.py +0 -0
  22. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_post_index.py +0 -0
  23. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_time.py +0 -0
  24. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_get_user.py +0 -0
  25. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_give_money.py +0 -0
  26. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_has_new_mail.py +0 -0
  27. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_loginout.py +0 -0
  28. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_mail.py +0 -0
  29. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_mark_post.py +0 -0
  30. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_post.py +0 -0
  31. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_reply_post.py +0 -0
  32. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_search_user.py +0 -0
  33. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_set_board_title.py +0 -0
  34. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/_api_util.py +0 -0
  35. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/check_value.py +0 -0
  36. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/command.py +0 -0
  37. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/config.py +0 -0
  38. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/data_type.py +0 -0
  39. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/exceptions.py +0 -0
  40. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/i18n.py +0 -0
  41. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/lang_en_US.py +0 -0
  42. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/lang_zh_TW.py +0 -0
  43. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/lib_util.py +0 -0
  44. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/log.py +0 -0
  45. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/screens.py +0 -0
  46. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt/service.py +0 -0
  47. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt.egg-info/SOURCES.txt +0 -0
  48. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt.egg-info/dependency_links.txt +0 -0
  49. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt.egg-info/requires.txt +0 -0
  50. {pyptt-1.2.11 → pyptt-1.2.12}/PyPtt.egg-info/top_level.txt +0 -0
  51. {pyptt-1.2.11 → pyptt-1.2.12}/setup.cfg +0 -0
  52. {pyptt-1.2.11 → pyptt-1.2.12}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPtt
3
- Version: 1.2.11
3
+ Version: 1.2.12
4
4
  Summary: PyPtt
5
5
  Home-page: https://pyptt.cc/
6
6
  Author: CodingMan
@@ -44,6 +44,7 @@ Requires-Dist: PyYAML
44
44
  #### PyPtt (PTT Library) 是一套 Pure Python PTT API 是目前支援最完整的 PTT API。具備大部分常用功能,無論推文、發文、取得文章、取得信件、寄信、發 P 幣、丟水球,你都可以在這裡找到完整的使用範例
45
45
  #### 使用帳號登入,支援使用登入之後才可以使用的功能,例如:推文、發文、寄信、發 P 幣等等
46
46
  #### 本專案意旨在提供 PTT 自動化機器人函式庫,無意違反任何 PTT 站方規範。如有牴觸,請馬上告知。
47
+ #### 由於 PTT 封鎖雲端連線,建議在雲端以外的環境使用。
47
48
  ####
48
49
  #### Pypi: https://pypi.org/project/PyPtt/
49
50
  <img src="https://raw.githubusercontent.com/PyPtt/PyPtt/master/docs/_static/login_1.0.gif" width="560">
@@ -1,4 +1,4 @@
1
- __version__ = '1.2.11'
1
+ __version__ = '1.2.12'
2
2
 
3
3
  from .PTT import API
4
4
  from .data_type import *
@@ -26,10 +26,11 @@ from . import ssl_config
26
26
 
27
27
  websockets.http.USER_AGENT += f' PyPtt/{PyPtt.__version__}'
28
28
 
29
- ssl_context = ssl.create_default_context()
29
+ ssl_context = None
30
30
 
31
31
 
32
32
  def ssl_init():
33
+ global ssl_context
33
34
 
34
35
  cert_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pem')
35
36
  cert_file.write(ssl_config.cert.encode('utf-8'))
@@ -40,14 +41,17 @@ def ssl_init():
40
41
  cert_file.close()
41
42
  key_file.close()
42
43
 
44
+ ssl_context = ssl.create_default_context()
45
+ ssl_context.check_hostname = False
43
46
  ssl_context.load_cert_chain(certfile=cert_file.name, keyfile=key_file.name)
47
+ ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
48
+ ssl_context.verify_mode = ssl.CERT_NONE
44
49
 
45
50
  os.unlink(cert_file.name)
46
51
  os.unlink(key_file.name)
47
52
 
48
53
 
49
54
  ssl_init()
50
- ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
51
55
 
52
56
 
53
57
  class TargetUnit:
@@ -0,0 +1,24 @@
1
+ key = """-----BEGIN EC PARAMETERS-----
2
+ BggqhkjOPQMBBw==
3
+ -----END EC PARAMETERS-----
4
+ -----BEGIN EC PRIVATE KEY-----
5
+ MHcCAQEEIO+xEROY5c66+lghuzon4+QSQjNMjYOsIcZTGu9kvdUooAoGCCqGSM49
6
+ AwEHoUQDQgAEpjnp/z3Dr9rh+vP35MvZAUdgVo9cr4JBYXGbYlxtc0WyNuSz0NyS
7
+ dM6vy7SZ5wSM3jhqd1//7MzGZ3bQquANuw==
8
+ -----END EC PRIVATE KEY-----
9
+ """
10
+
11
+ cert = """-----BEGIN CERTIFICATE-----
12
+ MIIB6jCCAY8CFGuxNOT4MXnzlELPVff39pImhwuBMAoGCCqGSM49BAMCMHcxCzAJ
13
+ BgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0eTEVMBMGA1UE
14
+ CgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25hbCBVbml0MRQw
15
+ EgYDVQQDDAtDb21tb24gTmFtZTAeFw0yNDA1MDUwNTU2NTVaFw0zNDA1MDMwNTU2
16
+ NTVaMHcxCzAJBgNVBAYTAlRXMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0
17
+ eTEVMBMGA1UECgwMT3JnYW5pemF0aW9uMRwwGgYDVQQLDBNPcmdhbml6YXRpb25h
18
+ bCBVbml0MRQwEgYDVQQDDAtDb21tb24gTmFtZTBZMBMGByqGSM49AgEGCCqGSM49
19
+ AwEHA0IABKY56f89w6/a4frz9+TL2QFHYFaPXK+CQWFxm2JcbXNFsjbks9DcknTO
20
+ r8u0mecEjN44andf/+zMxmd20KrgDbswCgYIKoZIzj0EAwIDSQAwRgIhAOeKSR2I
21
+ Ru+Ois0V+G6ab3Hwu7E182D+pBHvjQHEouW9AiEApcJFk95BQU2R4KCup1wnUnxw
22
+ bnffr8eMeWFiqo74EX0=
23
+ -----END CERTIFICATE-----
24
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPtt
3
- Version: 1.2.11
3
+ Version: 1.2.12
4
4
  Summary: PyPtt
5
5
  Home-page: https://pyptt.cc/
6
6
  Author: CodingMan
@@ -44,6 +44,7 @@ Requires-Dist: PyYAML
44
44
  #### PyPtt (PTT Library) 是一套 Pure Python PTT API 是目前支援最完整的 PTT API。具備大部分常用功能,無論推文、發文、取得文章、取得信件、寄信、發 P 幣、丟水球,你都可以在這裡找到完整的使用範例
45
45
  #### 使用帳號登入,支援使用登入之後才可以使用的功能,例如:推文、發文、寄信、發 P 幣等等
46
46
  #### 本專案意旨在提供 PTT 自動化機器人函式庫,無意違反任何 PTT 站方規範。如有牴觸,請馬上告知。
47
+ #### 由於 PTT 封鎖雲端連線,建議在雲端以外的環境使用。
47
48
  ####
48
49
  #### Pypi: https://pypi.org/project/PyPtt/
49
50
  <img src="https://raw.githubusercontent.com/PyPtt/PyPtt/master/docs/_static/login_1.0.gif" width="560">
@@ -11,6 +11,7 @@
11
11
  #### PyPtt (PTT Library) 是一套 Pure Python PTT API 是目前支援最完整的 PTT API。具備大部分常用功能,無論推文、發文、取得文章、取得信件、寄信、發 P 幣、丟水球,你都可以在這裡找到完整的使用範例
12
12
  #### 使用帳號登入,支援使用登入之後才可以使用的功能,例如:推文、發文、寄信、發 P 幣等等
13
13
  #### 本專案意旨在提供 PTT 自動化機器人函式庫,無意違反任何 PTT 站方規範。如有牴觸,請馬上告知。
14
+ #### 由於 PTT 封鎖雲端連線,建議在雲端以外的環境使用。
14
15
  ####
15
16
  #### Pypi: https://pypi.org/project/PyPtt/
16
17
  <img src="https://raw.githubusercontent.com/PyPtt/PyPtt/master/docs/_static/login_1.0.gif" width="560">
@@ -33,4 +34,4 @@ pip install PyPtt
33
34
 
34
35
  ## 贊助清單
35
36
 
36
- #### leftc
37
+ #### leftc
@@ -1,25 +0,0 @@
1
- key = """-----BEGIN EC PARAMETERS-----
2
- BggqhkjOPQMBBw==
3
- -----END EC PARAMETERS-----
4
- -----BEGIN EC PRIVATE KEY-----
5
- MHcCAQEEIPxohnK+7ol1VI18vCxwWWWLNmxifkx+S+24j+ECvtrIoAoGCCqGSM49
6
- AwEHoUQDQgAEtI001t4IcID4JF/LoVUNrZqIaGIRB4IdN5FK8umkXZiHMoQBjSLN
7
- mWZBF8YNj7nTJsE4mnaEagAi9hniZG8Jdg==
8
- -----END EC PRIVATE KEY-----
9
- """
10
-
11
- cert = """-----BEGIN CERTIFICATE-----
12
- MIICEjCCAbegAwIBAgIUTd2xAuhGMpBTofRPR0iFQhFrjG4wCgYIKoZIzj0EAwIw
13
- dzELMAkGA1UEBhMCVFcxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQHDARDaXR5MRUw
14
- EwYDVQQKDAxPcmdhbml6YXRpb24xHDAaBgNVBAsME09yZ2FuaXphdGlvbmFsIFVu
15
- aXQxFDASBgNVBAMMC0NvbW1vbiBOYW1lMB4XDTI0MDUwMTA3NDc0OFoXDTM0MDQy
16
- OTA3NDc0OFowdzELMAkGA1UEBhMCVFcxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQH
17
- DARDaXR5MRUwEwYDVQQKDAxPcmdhbml6YXRpb24xHDAaBgNVBAsME09yZ2FuaXph
18
- dGlvbmFsIFVuaXQxFDASBgNVBAMMC0NvbW1vbiBOYW1lMFkwEwYHKoZIzj0CAQYI
19
- KoZIzj0DAQcDQgAEtI001t4IcID4JF/LoVUNrZqIaGIRB4IdN5FK8umkXZiHMoQB
20
- jSLNmWZBF8YNj7nTJsE4mnaEagAi9hniZG8JdqMhMB8wHQYDVR0OBBYEFDi7xJKZ
21
- nUEBB2/j1pWVLJ8+ut4gMAoGCCqGSM49BAMCA0kAMEYCIQCTAENmnDhhG9ECHh7M
22
- sY8qH+kA4fH6yDNwOIaozhmXuQIhAO5HR40oCn2+uKKM8HapRa9OUj12vmSTuLpO
23
- UnFFlYXg
24
- -----END CERTIFICATE-----
25
- """
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
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