abstract-webtools 0.1.6.25__tar.gz → 0.1.6.26__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 (38) hide show
  1. {abstract_webtools-0.1.6.25/src/abstract_webtools.egg-info → abstract_webtools-0.1.6.26}/PKG-INFO +1 -1
  2. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/setup.py +1 -1
  3. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/videoDownloader.py +21 -3
  4. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26/src/abstract_webtools.egg-info}/PKG-INFO +1 -1
  5. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/LICENSE +0 -0
  6. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/README.md +0 -0
  7. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/pyproject.toml +0 -0
  8. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/setup.cfg +0 -0
  9. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/__init__.py +0 -0
  10. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/abstract_webtools.py +0 -0
  11. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/big_user_agent_list.py +0 -0
  12. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/main.py +0 -0
  13. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/__init__.py +0 -0
  14. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/cipherManager.py +0 -0
  15. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/crawlManager.py +0 -0
  16. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/crawlmgr2.py +0 -0
  17. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/curlMgr.py +0 -0
  18. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/domainManager.py +0 -0
  19. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/dynamicRateLimiter.py +0 -0
  20. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/get_test.py +0 -0
  21. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/linkManager.py +0 -0
  22. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/mySocketClient.py +0 -0
  23. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/networkManager.py +0 -0
  24. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/requestManager.py +0 -0
  25. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/seleniumManager.py +0 -0
  26. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/soupManager.py +0 -0
  27. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/sslManager.py +0 -0
  28. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/tlsAdapter.py +0 -0
  29. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/urlManager.py +0 -0
  30. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/userAgentManager.py +0 -0
  31. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/managers/videoDownloader2.py +0 -0
  32. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/soup_gui.py +0 -0
  33. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/url_grabber.py +0 -0
  34. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools/url_grabber_new.py +0 -0
  35. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools.egg-info/SOURCES.txt +0 -0
  36. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools.egg-info/dependency_links.txt +0 -0
  37. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools.egg-info/requires.txt +0 -0
  38. {abstract_webtools-0.1.6.25 → abstract_webtools-0.1.6.26}/src/abstract_webtools.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: abstract_webtools
3
- Version: 0.1.6.25
3
+ Version: 0.1.6.26
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
@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
4
4
  long_description = fh.read()
5
5
  setuptools.setup(
6
6
  name='abstract_webtools',
7
- version='0.1.6.25',
7
+ version='0.1.6.26',
8
8
  author='putkoff',
9
9
  author_email='partners@abstractendeavors.com',
10
10
  description='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.',
@@ -1,12 +1,10 @@
1
1
  from abstract_webtools import requestManager, urlManager, soupManager, requests, linkManager
2
2
  import threading,os,re,yt_dlp,urllib.request,m3u8_To_MP4,subprocess
3
3
  from abstract_utilities import get_logFile,safe_dump_to_file
4
-
5
4
  from m3u8 import M3U8 # Install: pip install m3u8
6
5
  from urllib.parse import urljoin
7
6
  from yt_dlp.postprocessor.ffmpeg import FFmpegFixupPostProcessor
8
7
  from abstract_math import divide_it,add_it,multiply_it,subtract_it
9
- from abstract_webtools import *
10
8
  logger = get_logFile('video_bp')
11
9
  class VideoDownloader:
12
10
  def __init__(self, url, title=None, download_directory=os.getcwd(), user_agent=None, video_extention='mp4',
@@ -200,7 +198,7 @@ def get_thumbnails(directory,info):
200
198
  info['thumbnails'][i]['path']=thumbnail_path
201
199
  download_image(thumbnail_url, save_path=thumbnail_path)
202
200
  return info
203
- def downloadvideo(url,directory=False,thumbnails=True):
201
+ def downloadvideo(url,directory=False,rename_display=True,thumbnails=True,audio=False):
204
202
  directory = directory or os.getcwd()
205
203
  temp_id = re.sub(r'[^\w\d.-]', '_', url)[-20:]
206
204
  temp_filename = f"temp_{temp_id}.mp4"
@@ -212,7 +210,27 @@ def downloadvideo(url,directory=False,thumbnails=True):
212
210
  output_filename=temp_filename
213
211
  )
214
212
  info = video_mgr.info
213
+ display_id= info.get('display_id') or info.get('id')
214
+ directory =os.path.join(directory,display_id)
215
+ os.makedirs(directory, exist_ok=True)
216
+ if rename_display and info and 'file_path' in info:
217
+ # Rename using metadata
218
+ video_id = info.get('id', temp_id)
219
+ title = info.get('title', 'video')[:30] # Limit to 30 chars
220
+ safe_title = re.sub(r'[^\w\d.-]', '_', title)
221
+ final_filename = f"{safe_title}_{video_id}.mp4"
222
+ new_path = os.path.join(directory, final_filename)
223
+ if os.path.exists(info['file_path']):
224
+ os.rename(info['file_path'], new_path)
225
+ info['file_path'] = new_path
226
+ info_path = os.path.join(directory,'info.json')
215
227
  if thumbnails:
216
228
  info = get_thumbnails(directory,info)
229
+ if audio:
230
+ try:
231
+ info = download_audio(directory, info)
232
+ except:
233
+ info['audio_path'] = audio_path
234
+ safe_dump_to_file(info,info_path)
217
235
  return info
218
236
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: abstract_webtools
3
- Version: 0.1.6.25
3
+ Version: 0.1.6.26
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