Coder Social home page Coder Social logo

ffsend's People

Contributors

chungy avatar energizer avatar idrassi avatar kcchouette avatar ktibow avatar nneonneo 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

ffsend's Issues

Feature Request: Support new websocket interface for uploading

Although closed by Mozilla, Send server has already been forked by Tim Visée at https://gitlab.com/timvisee/send and https://github.com/timvisee/send , with the new websocket interface for uploading.

Now, many new instances have disabled the old http-based upload interface, making this client of yours unable to perform uploading to these instances, while Tim's own client supports the new way. (though downloading protocol remain unchanged)

I personally love this client of yours, because as a python program, it is easy to make it use proxies by setting environment variables like ALL_PROXY or HTTP_PROXY. Would you like to continue improving it?

Library readiness

This is a great project! Does anybody know how to use this with another piece of code?
I was thinking of making a Python script that uploads to Firefox Send, and then makes a QR code from that.
I may or may not be able to solve this on my own, but things go faster with more people. Thanks!

Error with owner_set_params

Hello, I am trying to use ffsend inside a python script. This is the error that I got when I am trying to modify params:

In [40]: ff = ffsend.FFSend('https://send.firefox.com/')

In [41]: service, fid, secret = ffsend.parse_url('https://send.firefox.com/download/XXXXXX/#TTTTTTTT')

In [42]: print(params)
{'dlimit': 3, 'ttl': 60000}

In [43]: ff.owner_set_params(fid, 'CCCCCCCCC', params)

HTTPError Traceback (most recent call last)
in
----> 1 ff.owner_set_params(fid, 'CCCCCCCCCC', params)

~/progetti/alloggiati/lib/python3.5/site-packages/ffsend.py in owner_set_params(self, fid, owner_token, new_params)
405 '''
406 resp = self.api.post_params(fid, owner_token, new_params)
--> 407 resp.raise_for_status()
408
409 def single_file_metadata(filename, filesize, mimetype='application/octet-stream'):

~/progetti/alloggiati/lib/python3.5/site-packages/requests/models.py in raise_for_status(self)
938
939 if http_error_msg:
--> 940 raise HTTPError(http_error_msg, response=self)
941
942 def close(self):

HTTPError: 400 Client Error: Bad Request for url: https://send.firefox.com/api/params/QQQQQQQ

I just masked all the sensible parameters.

ffsend apt package

Hey there! I've completed the packaging process for ffsend. My apt repository is here: https://apt.starbeamrainbowlabs.com/

Once you've setup the apt repository according to the instructions in the header, you can install it with sudo apt install ffsend (though I'm considering changing the package name to python3-ffsend - though I'm unsure).

I've scripted the process too. Every time a new GitHub release is made, I'll get a notification that will let me know that I need to re-run the script - as I do not currently have automation on it yet (though I'm working on this).

I do note a few things however now that I've explored it:

  • It doesn't have an environment variable for the password, which is insecure
  • The TTL is in seconds, which isn't very intuitive. Perhaps supporting things like 24h or 7d would be possible?
  • Do you have to upload a file first before setting the TTL with a separate call?
  • How do I login with a Mozilla account? At send.firefox.com it limits you to 1GiB + 24h if you don't login, and raises this limit to 2.5GiB + 7d if you're logged in

Error downloading file

I've been using ffsend with Python 3 lately. When I try to download a file, I get this:

Traceback (most recent call last):
  File "ffsend.py", line 374, in <module>
    exit(main(sys.argv[1:]))
  File "ffsend.py", line 329, in main
    service, fid, secret = parse_url(args.target)
  File "ffsend.py", line 71, in parse_url
    return service, fid, secret
UnboundLocalError: local variable 'service' referenced before assignment

Does anybody know the source of this?
Reminder: Python 2 is now phasing out.

413 Client Error: Request Entity Too Large for url

I know Firefox dropped this, but there are still a few sites hosting their own instance.

One of those instances is https://drop.chapril.org

But when trying to upload a slightly larger files to that host it will return a 413 Error.

It looks like the current version of ffsend tries to upload the whole file at once. So the way to fix this issue is probably by splitting the upload into multiple segments.

  File "c:\users\oyedeng\appdata\local\programs\python\python37\lib\site-packages\ffsend.py", line 573, in main
    url, args.token = upload(args.service, args.target, password=args.password)
  File "c:\users\oyedeng\appdata\local\programs\python\python37\lib\site-packages\ffsend.py", line 475, in upload
    return _upload(service, filename, file, password)
  File "c:\users\oyedeng\appdata\local\programs\python\python37\lib\site-packages\ffsend.py", line 448, in _upload
    res, secret = send.upload(metadata, FakeFile())
  File "c:\users\oyedeng\appdata\local\programs\python\python37\lib\site-packages\ffsend.py", line 324, in upload
    resp.raise_for_status()
  File "c:\users\oyedeng\appdata\local\programs\python\python37\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 413 Client Error: Request Entity Too Large for url: https://drop.chapril.org/api/upload

Is the set download limit invalid?

root@debian:~# ffsend --set-dlimit 100 -t 1b90f82d35d7c7666de7 'https://send.firefox.com/download/90b68b8a24cc749e'
Traceback (most recent call last):
File "/usr/local/bin/ffsend", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/ffsend.py", line 613, in main
if do_set_params():
File "/usr/local/lib/python3.8/site-packages/ffsend.py", line 562, in do_set_params
set_params(service, fid, args.token, **params)
File "/usr/local/lib/python3.8/site-packages/ffsend.py", line 483, in set_params
FFSend(service).owner_set_params(fid, token, params)
File "/usr/local/lib/python3.8/site-packages/ffsend.py", line 407, in owner_set_params
resp.raise_for_status()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://send.firefox.com/api/params/90b68b8a24cc749e

Upload not working

When i upload a file with ffsend i can't download and in console i get "TypeError: a.manifest is undefined" but, if i upload directly from the site it works.

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.