Giter Site home page Giter Site logo

curldrop's Introduction

Hi there ๐Ÿ‘‹

curldrop's People

Contributors

kennell avatar kevvvvv avatar subcrew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

curldrop's Issues

BaseURL should work with missing trailing slash

Hi, and thank you for maintaining curldrop. I just found out about it and it's a real pleasure to use <3

An issue i stumbled upon when setting it up is that the / between the baseURL and the file uuid was missing in the generated URLs, because i forgot to put a trailing slash in my baseURL.

Although in the example provided in the README there is a trailing slash, i feel like it's a silly issue that could be addressed with a single line patch so i figured i'd open an issue here to let you know about it :)

Timeout on large files

I just tried to transfer a large file using curldrop. After exactly 30 seconds, the upload is interrupted, the server complains about a [CRITICAL] WORKER TIMEOUT.

flask: GET error (exception)

Tried it again today, but got an error, when trying to download the file locally. (I'm on macOS, even though it says Firefox on Windows.) Two tests, one with "localhost", one using the local IP address.

Could it be that my installed version of flask (2.2.2) doesn't work anymore with curldrop (requirements says: 1.0.2)?

[2022-11-27 15:29:02 +0100] [70735] [INFO] Starting gunicorn 20.1.0
[2022-11-27 15:29:02 +0100] [70735] [INFO] Listening at: http://0.0.0.0:8000 (70735)
[2022-11-27 15:29:02 +0100] [70735] [INFO] Using worker: sync
[2022-11-27 15:29:02 +0100] [70745] [INFO] Booting worker with pid: 70745
[2022-11-27 15:29:02 +0100] [70746] [INFO] Booting worker with pid: 70746
[2022-11-27 15:29:02 +0100] [70747] [INFO] Booting worker with pid: 70747
[2022-11-27 15:29:02 +0100] [70752] [INFO] Booting worker with pid: 70752
127.0.0.1 - - [27/Nov/2022:15:30:50 +0100] "PUT /TEST.txt HTTP/1.1" 200 30 "-" "curl/7.79.1"
[2022-11-27 15:31:14,119] ERROR in app: Exception on /85598c5 [GET]
Traceback (most recent call last):
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/curldrop/app.py", line 31, in download
    return send_file(
TypeError: send_file() got an unexpected keyword argument 'attachment_filename'
127.0.0.1 - - [27/Nov/2022:15:31:14 +0100] "GET /85598c5 HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0"
127.0.0.1 - - [27/Nov/2022:15:31:14 +0100] "GET /favicon.ico HTTP/1.1" 404 207 "http://localhost:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0"
[2022-11-27 15:32:03,799] ERROR in app: Exception on /85598c5 [GET]
Traceback (most recent call last):
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/*/Library/Python/3.8/lib/python/site-packages/curldrop/app.py", line 31, in download
    return send_file(
TypeError: send_file() got an unexpected keyword argument 'attachment_filename'
1**.1**.1**.*** - - [27/Nov/2022:15:32:03 +0100] "GET /85598c5 HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0"
1***.1**.1**.*** - - [27/Nov/2022:15:32:04 +0100] "GET /favicon.ico HTTP/1.1" 404 207 "http://1**.1**.1**.***:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0"
^C[2022-11-27 15:32:48 +0100] [70735] [INFO] Handling signal: int
[2022-11-27 15:32:48 +0100] [70752] [INFO] Worker exiting (pid: 70752)
[2022-11-27 15:32:48 +0100] [70746] [INFO] Worker exiting (pid: 70746)
[2022-11-27 15:32:48 +0100] [70747] [INFO] Worker exiting (pid: 70747)
[2022-11-27 15:32:48 +0100] [70745] [INFO] Worker exiting (pid: 70745)
[2022-11-27 15:32:48 +0100] [70735] [INFO] Shutting down: Master

Installation failure

Hey, am trying to install this tool, but am running into some some read error. Here's the error

sudo pip install curldrop
[sudo] password for dokwii:
Downloading/unpacking curldrop
Downloading curldrop-1.0.2.tar.gz
Running setup.py (path:/tmp/pip_build_root/curldrop/setup.py) egg_info for package curldrop

Requirement already satisfied (use --upgrade to upgrade): flask in /usr/local/lib/python2.7/dist-packages (from curldrop)
Requirement already satisfied (use --upgrade to upgrade): click in /usr/local/lib/python2.7/dist-packages (from curldrop)
Downloading/unpacking gunicorn (from curldrop)
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 194, in find_requirement
page = self._get_page(main_index_url, req)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 568, in _get_page
session=self.session,
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 670, in get_page
resp = session.get(url, headers={"Accept": "text/html"})
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 467, in get
return self.request('GET', url, *_kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 237, in request
return super(PipSession, self).request(method, url, *args, *_kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 455, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/sessions.py", line 558, in send
r = adapter.send(request, *_kwargs)
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/adapters.py", line 394, in send
r.content
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/models.py", line 679, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "/usr/share/python-wheels/requests-2.2.1-py2.py3-none-any.whl/requests/models.py", line 616, in generate
decode_content=True):
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read
data = self._fp.read(amt)
File "/usr/lib/python2.7/httplib.py", line 573, in read
s = self.fp.read(amt)
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: The read operation timed out

Storing debug log for failure in /home/dokwii/.pip/pip.log

[INFO] Quit server on macOS

Fantastic program, thank you!

It seems that curldrop doesn't come with an --exit option, but I successfully used the following small script on macOS Big Sur. (In my case I'm running the standard python3 program installed with Xcode, which is why I need to grep for the path to the Python app bundle.)

#!/bin/zsh
while read -r pid
do
	if ! kill -n 3 "$pid" 2>/dev/null ; then
		if ! kill -n 9 "$pid" 2>/dev/null ; then
			echo "Error killing PID $pid" >&2
			continue
		else
			echo "Successfully killed PID $pid (9)"	
		fi
	else
		echo "Successfully killed PID $pid (3)"	
	fi
done < <(ps aux | grep "/Python.app/Contents/MacOS/Python " | grep "/curldrop " | awk '{print $2}' | sort -nr)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.