jvavruska Posted March 24, 2014 Report Share Posted March 24, 2014 Hello, I needed to establish identical structure of synced folders on several NAS units, so I wrote a small app to read list of folders and secrets from a file, call get_folders, then add_folder for each folder from the list not yet in BTSync setup. Interestingly, only 5 api calls complete (1 get_folders and 4x add_folder), then it fails on HTTP 401 - Not Authorized. At this moment the utility exits. After restart, it skips already existing folders and adds 4 more, etc. It is running on QNAP TS-269Pro (QTS 4.0.5), btsync is 1.2.91 original i386 from BitTorrent download (not the broken binary distributed by QNAP). Utility is written in python, using python 2.7, urllib and urrlib2. Password authentication is handled by creating urllib2.HTTPBasicAuthHandler() and using it in urllib2.build_opener(handler). Does anybody have similar experience of API "getting tired" after few calls shortly following each other? Thanks, Jindra Quote Link to comment Share on other sites More sharing options...
tuxpoldo Posted March 24, 2014 Report Share Posted March 24, 2014 I use the requests library with python and never experienced such problems. If you want to look at the code: https://github.com/tuxpoldo/btsync-deb/blob/master/btsync-gui/btsyncapi.py Quote Link to comment Share on other sites More sharing options...
RomanZ Posted April 3, 2014 Report Share Posted April 3, 2014 jvavruska, Could you please send me your requests (including request #6 which fails) and the time interval between them? I'll try to repro it in my lab. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.