richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

Pushing file failes #100

Closed maltesa closed 7 years ago

maltesa commented 7 years ago

I tried the following:

[...]
with open(fp, "rb") as file:
                    file_data = self.pb.upload_file(file, os.path.basename(fp),
                                                    os.path.splitext(fp)[1])
                    self.pb.push_file(**file_data)

and receive:

pushbullet.errors.PushError: {"error":{"code":"invalid_param","type":"invalid_request","message":"The param 'file_url' has an invalid value.","param":"file_url","cat":"\u003e:3"},"error_code":"invalid_param"}

running with python 3.5.2

The uploading seems to work but the actual push_file doesnt. I took the code from the example, so i thought is should run.

kovacsbalu commented 7 years ago

Hi @maltesa, what was the file_url value?

maltesa commented 7 years ago

Hi, this is the result I receive from the upload_file method:

{'file_url': 'https://dl2.pushbulletusercontent.com/sldkjf237489234789sf/results_px.yml', 'file_type': '.yml', 'file_name': 'results_px.yml'}

I think I figured the problem. The filesize to upload is limited. The .yml file is quite big, with smaller files it does work. Thanks for your help :)