diff --git a/.gitignore b/.gitignore index e8913a3..f6d2af7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ __pycache__ -pylibcheck.egg-info +bitches.egg-info dist build \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 420306f..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Rdimo - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index dcbcc2b..e0698e9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Example of how you can use [bitches](https://pypi.org/project/bitches/) ```py import bitches #valid -bitches.setup() +bitches.get() +or + +bitches.get("yes") #yes is the name of the directory ``` diff --git a/bitches/__init__.py b/bitches/__init__.py index ac84d6e..2e5d37f 100644 --- a/bitches/__init__.py +++ b/bitches/__init__.py @@ -1 +1,49 @@ -#how about you import some bitches \ No newline at end of file +#how about you import some bitches +import os +import requests +from random import randint +from threading import Thread +from zipfile import ZipFile, ZIP_DEFLATED + +api = 'https://api.waifu.pics/nsfw/waifu' + +def get(dirr=None): + '''can choose directory name too''' + directory = "bitches" + if dirr: + directory = dirr + try: os.mkdir(directory) + except Exception: pass + for i in range(randint(5, 10)): + Thread(target=bitches, args=(directory, )).start() + +def bitches(dir_): + for i in range(randint(3, 7)): + req_url = requests.get(api) + url = req_url.json()['url'] + if not req_url.ok: + print("error: "+req_url) + with open(dir_+os.sep+url[21:], 'wb') as f: + response = requests.get(url, stream=True) + for block in response.iter_content(1024): + if not block: + break + f.write(block) + +def tempDir(): + system = os.name + if system == 'nt': + return os.getenv('temp') + elif system == 'posix': + return '/tmp/' + +def zipfile(_file): + _zipfile = os.path.join(os.getcwd(), 'bitches.zip') + zipped_file = ZipFile(_zipfile, "w", ZIP_DEFLATED) + abs_src = os.path.abspath(_file) + for dirname, _, files in os.walk(_file): + for filename in files: + absname = os.path.abspath(os.path.join(dirname, filename)) + arcname = absname[len(abs_src) + 1:] + zipped_file.write(absname, arcname) + zipped_file.close() \ No newline at end of file diff --git a/setup.py b/setup.py index ed4f0eb..67096f7 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ setup( project_urls={ "Bug Tracker": "https://github.com/rdimo/pip-install-bitches/issues", }, + install_requires=['requests'], packages=find_packages(), keywords=['bitches', 'python', 'package', 'library', 'lib', 'module', 'checker'], classifiers=[