filepreviews / filepreviews-python Goto Github PK
View Code? Open in Web Editor NEWPython client library and CLI tool for FilePreviews.io
Home Page: http://filepreviews.io
License: MIT License
Python client library and CLI tool for FilePreviews.io
Home Page: http://filepreviews.io
License: MIT License
Hi,
I look forward to using file previews, but I'm currently having some trouble posting the preview to my S3 bucket.
I'm getting the debug messages below with the last line repeating hundreds of times. While it could be a permissions issue on the S3 bucket, I've tried giving permission to everyone to list and upload objects.
DEBUG:filepreviews:Generating preview for http://www.rawsamples.ch/raws/canon/d30/RAW_CANON_D30_SRGB.CRW
DEBUG:filepreviews:Polling https://s3.amazonaws.com/post-great-pics-test-file-uploads/1d3aebcbd37ceb5a8f74bb2c10caa3b9a3d39001814baedbd50ab4de3bb1badf/metadata.json
DEBUG:filepreviews:Polling https://s3.amazonaws.com/post-great-pics-test-file-uploads/1d3aebcbd37ceb5a8f74bb2c10caa3b9a3d39001814baedbd50ab4de3bb1badf/metadata.json
....
Thank you for looking into this. Please let me know if I can be of assistance.
~Victor
Hi,
I'm trying to follow the example, albeit with my API Key and Secret and I get the following error:
Traceback (most recent call last):
File "/Users/Victor/Documents/Python/Post_Great_Pics/src/scripts/filepreviews_v2_test", line 6, in <module>
response = fp.generate('http://www.getblimp.com/images/screenshot1.png')
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/filepreviews/api.py", line 49, in generate
response = self.client.post('previews', data=params)
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/filepreviews/client.py", line 77, in post
return self.request('POST', *args, json=data)
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/filepreviews/client.py", line 18, in request
session_response = self.session.request(method, url, **kwargs)
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/Victor/Documents/Python/Post_Great_Pics/pgp_venv/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(60, 'Operation timed out'))
Here is my code:
from filepreviews import FilePreviews
fp = FilePreviews(api_key='X', api_secret='Y')
response = fp.generate('http://www.getblimp.com/images/screenshot1.png')
print response
On Feb 22 I was testing File Previews with the Following Code, and getting a successful response:
fp = FilePreviews()
sample_result = fp.generate('http://www.getblimp.com/images/screenshot1.png')
print 'sample_result'
print sample_result
raw_result_1 = fp.generate('http://www.rawsamples.ch/raws/canon/d30/RAW_CANON_D30_SRGB.CRW') # 3mb
print 'raw_result_1'
print raw_result_1`
However, when I am running this today (APril 22) the screenshot is successfull, but the .CRW is failing. My output is below:
sample_result
{'preview_url': u'https://s3.amazonaws.com/demo.filepreviews.io/f7ce58c6f27c15a793b6df228c0c5b42ec067f57cd691a90e85d47d92306f4cd/screenshot1_original_1.png', 'metadata': {u'data': None, u'results': {u'mimetype': u'image/png', u'name': u'screenshot1', u'extension': u'png', u'encoding': u'binary', u'thumbnails': [{u'url': u'https://s3.amazonaws.com/demo.filepreviews.io/f7ce58c6f27c15a793b6df228c0c5b42ec067f57cd691a90e85d47d92306f4cd/screenshot1_original_1.png', u'requested_size': u'original', u'resized': False, u'total_pages': 1, u'original_size': {u'width': u'560', u'height': u'397'}, u'page': 1, u'size': {u'width': u'560', u'height': u'397'}}], u'metadata': {}, u'type': u'image', u'size': 92602}}}
raw_result_1
{'preview_url': u'https://s3.amazonaws.com/demo.filepreviews.io/9dbd9fd7e1e0fe1df2ccdd322fcf3d7f27a57fb17bb95e4961d0f9bb389908ca/RAW_CANON_D30_SRGB_original_1.png', 'metadata': {u'error': u'FrameExtractionException'}}
I'd be happy to provide more info, just let me know :)
~Victor
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.