abstract-webtools 0.1.6.100__py3-none-any.whl → 0.1.6.102__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.
@@ -12,9 +12,10 @@ from selenium.webdriver.support import expected_conditions as EC
12
12
  from abstract_security import *
13
13
  from abstract_webtools import *
14
14
  DOWNLOAD_DIR = os.path.abspath("./downloads")
15
- os.makedirs(DOWNLOAD_DIR, exist_ok=True)
16
15
  class K2SDownloader:
17
- def __init__(self,env_path=None):
16
+ def __init__(self,env_path=None,download_dir=None):
17
+ self.download_dir = download_dir or DOWNLOAD_DIR
18
+ os.makedirs(self.download_dir, exist_ok=True)
18
19
  self.env_path = env_path
19
20
  self.session = requests.Session()
20
21
  self.session.headers.update({
@@ -75,7 +76,7 @@ class K2SDownloader:
75
76
  if download_url:
76
77
  response = self.session.get(download_url, stream=True)
77
78
  file_name = self._extract_filename(response, download_url)
78
- file_path = os.path.join(DOWNLOAD_DIR, file_name)
79
+ file_path = os.path.join(self.download_dir, file_name)
79
80
 
80
81
  with open(file_path, 'wb') as f:
81
82
  for chunk in response.iter_content(chunk_size=8192):
@@ -128,12 +129,11 @@ def get_k2s_link(soup):
128
129
  match = re.search(r'https://k2s\.cc/file/[^"<]+', str(soup))
129
130
  return match.group(0) if match else None
130
131
 
131
- def get_content(content,get_post_attributes,dls_mgr):
132
- results=[]
132
+ def get_sections_content(content,get_post_attribute,dls_mgr):
133
133
  if not content:
134
- return results
134
+ return []
135
135
  for section in content:
136
- data = get_post_attributes(section)
136
+ data = get_section_link(section)
137
137
  if data and data.get('k2s') and not dls_mgr.is_prev_dl(data):
138
138
  dls_mgr.dl_k2s_link(data['k2s'])
139
139
  results.append(data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: abstract_webtools
3
- Version: 0.1.6.100
3
+ Version: 0.1.6.102
4
4
  Summary: Abstract Web Tools is a Python package that provides various utility functions for web scraping tasks. It is built on top of popular libraries such as `requests`, `BeautifulSoup`, and `urllib3` to simplify the process of fetching and parsing web content.
5
5
  Home-page: https://github.com/AbstractEndeavors/abstract_essentials/tree/main/abstract_webtools
6
6
  Author: putkoff
@@ -6,7 +6,7 @@ abstract_webtools/big_user_agent_list.py,sha256=5ZkrUWmfzYL5yaULREslh9ZiRQeITbSj
6
6
  abstract_webtools/domain_identifier.py,sha256=AvWlGD7C19rySa_J_Brxi3kz43LMWvGsshuuZNg7MvI,3320
7
7
  abstract_webtools/extention_list.py,sha256=gRSO4nMbuuXDYzd-ss4s64sS80ZHmUoazMCpgoKG5vE,4884
8
8
  abstract_webtools/find_dirs.py,sha256=BlE4ruzMABqmv03NcutZ1j5N3pCc-Q4uNEAMpNolZCQ,2609
9
- abstract_webtools/k2s_downloader.py,sha256=E1OPig1mIBBjSNP6HpkRkSgckGmi5LZ_dRCtyP_UvkI,5029
9
+ abstract_webtools/k2s_downloader.py,sha256=Y6vibnRCifk7k3tXeCUIiD7fjDFD6KF-EDto8HEadgc,5107
10
10
  abstract_webtools/main.py,sha256=_I7pPXPkoLZOoYGLQDrSLGhGuQt6-PVyXEHZSmglk2g,1329
11
11
  abstract_webtools/soup_gui.py,sha256=n95YAps1R6DpMwR4UbthSqQby0C5WHUa9tsW-f2qpLg,5184
12
12
  abstract_webtools/url_grabber.py,sha256=pnCCev7ZIuM-6cAGTLmK5HfzZg_AX-fLcRpB6ZE70B8,10441
@@ -42,7 +42,7 @@ abstract_webtools/managers/soupManager/soupManager.py,sha256=U3_o189-OWoBRaSCe2s
42
42
  abstract_webtools/managers/urlManager/__init__.py,sha256=gaJCHeK91Z-eYsBnxgdhbIUten1-gbx-zqx70R6ag-Y,26
43
43
  abstract_webtools/managers/urlManager/urlManager.py,sha256=vCFuLADmv3h7icaaoAsImGqb_49VizPY_ZvMl-C7PYk,7756
44
44
  abstract_webtools/managers/videos/Heather brooke swallo from condom.mp4,sha256=h-bKFLAHt7pGLGu4EcMvSSox7BPRK0Nga3u813iMVKQ,8335544
45
- abstract_webtools-0.1.6.100.dist-info/METADATA,sha256=oPxRtQ-SpZC-7xDWeyV3iGytTq7vVdUMwgyus2N-zRQ,7289
46
- abstract_webtools-0.1.6.100.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
47
- abstract_webtools-0.1.6.100.dist-info/top_level.txt,sha256=2DMJ7RmjTcjCsa-uwAV0K6eXXlIIkFDEjBLg_uyCmCI,18
48
- abstract_webtools-0.1.6.100.dist-info/RECORD,,
45
+ abstract_webtools-0.1.6.102.dist-info/METADATA,sha256=Qhs3_i-ziCRPPE_6KZXim9M9GI16CV1IP5qWIRdsrvc,7289
46
+ abstract_webtools-0.1.6.102.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
47
+ abstract_webtools-0.1.6.102.dist-info/top_level.txt,sha256=2DMJ7RmjTcjCsa-uwAV0K6eXXlIIkFDEjBLg_uyCmCI,18
48
+ abstract_webtools-0.1.6.102.dist-info/RECORD,,