nneonneo / ffsend Goto Github PK
View Code? Open in Web Editor NEWPython client for Firefox Send
License: Mozilla Public License 2.0
Python client for Firefox Send
License: Mozilla Public License 2.0
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!
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:
24h
or 7d
would be possible?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.
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
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}
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.
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.
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
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?
Hello! Thanks for creating this package. I think it could be really cool to package this up a bit and publish it on PYPI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.