astrikos / wetransfer-python-sdk Goto Github PK
View Code? Open in Web Editor NEW:snake: A Python SDK for WeTransfer's Public API
License: GNU General Public License v3.0
:snake: A Python SDK for WeTransfer's Public API
License: GNU General Public License v3.0
I have a valid API key, however when I try to create an empty transfer I get the following error
>>> T = wt_client.create_transfer()
DEBUG:wetransfer-python-sdk:POST request to <https://dev.wetransfer.com/v1/trans fers> with headers:<{'Content-Length': '23', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'User-Agent': 'WT python SDK v0.2.0', 'Connection': 'keep-aliv e', 'x-api-key': 'EqQpdRGyba5wIqniN29K771troLgjoHn89C4AjHr', 'Content-Type': 'ap plication/json'}> and body:<{"name": "WT Transfer"}>
DEBUG:wetransfer-python-sdk: POST <401> response from <https://dev.wetransfer.co m/v1/transfers> with headers:<{'x-amzn-RequestId': 'a1e1c65e-46d4-11e9-9c0d-01b5 f9dadaff', 'Content-Length': '40', 'Via': '1.1 efdf33ba79ee3aadbfdf7e2b6e838d71. cloudfront.net (CloudFront)', 'X-Cache': 'Error from cloudfront', 'X-Content-Typ e-Options': 'nosniff', 'x-amzn-Remapped-Connection': 'keep-alive', 'Strict-Trans port-Security': 'max-age=31536000; includeSubDomains;', 'x-amz-apigw-id': 'WkHgS E_DDoEFx4w=', 'x-amzn-Remapped-Content-Length': '40', 'Connection': 'keep-alive' , 'X-Amz-Cf-Id': 'Xpw1InyHef0Bsv1aqIv1lPy9I36tut7w_EXFtbXACyJ6M-yKDdqCYQ==', 'x- amzn-Remapped-Date': 'Fri, 15 Mar 2019 03:44:27 GMT', 'Date': 'Fri, 15 Mar 2019 03:44:27 GMT', 'Content-Type': 'application/json'}> and body:<{"error":"Missing Authorization header"}>
ERROR:wetransfer-python-sdk:Failed creating new transfer
https://chrisyeh96.github.io/2017/08/08/definitive-guide-python-imports.html
Therefore, statements like:
from logger import LOGGER
lead to ImportError
when using Python 3, that can be troublesome for many people
pypi version 0.2.0
In [146]: transfer.add_files(['deduped.pickle', 'merged.pickle'])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-168-182f4abb61a0> in <module>
----> 1 transfer.add_files(['deduped.pickle', 'merged.pickle'])
~/anaconda3/lib/python3.7/site-packages/wetransfer/transfer.py in add_files(self, file_paths)
122 self.transfer_items.append(File(path))
123
--> 124 return self.add_items()
125
126 def add_links(self, urls):
TypeError: add_items() missing 1 required positional argument: 'items'
Hello,
Using wetransfer-0.0.1, in the implementation of Transfer.add_links
it is written:
self.transfer_items.append(File(url))
I guess you would have wanted to write
self.transfer_items.append(Link(url))
instead?
I'm using this code and trying to upload file, but this resulting in WeTrasfer link to empty board - "This board is empty" - no files.
kwargs = {"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}
wt_client = WTApiClient(**kwargs)
wt_client.authorize()
transfer = wt_client.create_transfer(transfer_name="New upload")
f1 = File("setup-lightshot.exe")
transfer.add_items([f1])
I'm getting this error messages only in debug mode:
ERROR:wetransfer-python-sdk:Failed closing upload for item id: XXXXXXXXXXXXXX
Transfer with id: XXXXXXXXXXXXXXXXXXXXXX, can be found in short url: https://we.tl/XXXXXXXXXXX, with following items: ['Transfer item, file type, with size 2784344, name setup-lightshot.exe, and local path C:\\Users\\XXXXXXXXXXXXXX\\Desktop\\setup-lightshot.exe, has 1 multi parts']
ERROR:wetransfer-python-sdk:Failed to upload item Transfer item, file type, with size 2784344, name setup-lightshot.exe, and local path C:\Users\XXXXXXXXXX\Desktop\setup-lightshot.exe, has 1 multi parts
In normal mode I got only this part:
Transfer with id: XXXXXXXXXXXXXXXXXXXXXX, can be found in short url: https://we.tl/XXXXXXXXXXX, with following items: ['Transfer item, file type, with size 2784344, name setup-lightshot.exe, and local path C:\\Users\\XXXXXXXXXXXXXX\\Desktop\\setup-lightshot.exe, has 1 multi parts']
But link has no files in it.
I have files stored in a database, well they are not actually on the db, but i have no direct access to the files so i have them in b64, is there any way to transfer them? should i store them in another path in the file system just to send them with add_items?
Hello,
Thank you for your library.
It would be nice to be able to name a transfer/a board differently from "Andreas' very first transfer from python!"
, which is hardcoded in the CreateTransfer
class.
It appears in large print in the board when sharing the transfer.shortened_url
:
Can you modify it? Would you accept a PR?
Thanks
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.