lou5

Members
  • Content Count

    31
  • Joined

  • Last visited

  • Days Won

    2

About lou5

  • Rank
    BitTorrent Sync Staff

Profile Information

  • Gender
    Not Telling
  1. Hi klytus, Tried sending you a PM but wasn't able to. Would love to chat with you to learn more about how you used Sync for the show (we're huge fans btw). Would you have a few minutes next week to chat? Thanks! lou@bittorrent.com
  2. Hope everyone is doing well! The BitTorrent team will be at Empire Garage (at SXSW) talking about Sync. Come down to hang out, learn more about the awesome stuff you can do with the app, and demo the API. Stay for the free drinks and live music. (Of course.) Join the group here --> http://www.meetup.com/BitTorrent-Sync-User-Group/ Event --> http://www.meetup.com/BitTorrent-Sync-User-Group/events/168108862/
  3. Hi, the keys are sent in a batch and are sent fairly regularly. You might want to check you spam folder and if nothing, PM me your email and I'll check for you.
  4. Under "Folder Properties" try enabling "Search DHT network"
  5. Hi, We have some spots open for anyone interested in testing our new Sync version for windows phones. If you are interested, we need to know Windows Live ID that associated with a phone. (This if for WP8 only.) Fill this quick form and we'll have you added to the list. https://docs.google.com/a/bittorrent.com/forms/d/1zj1FvqNYoZ4WBeXkGM8hLIb_r9Ft18dcii8YfnWmCfQ/viewform Thanks, Lou
  6. Not sure why you did not receive them - they are in the system. I've sent you a PM with more info.
  7. lou5

    Sync Dev Ideas

    I'm curious about what people are working on - anyone care to share?
  8. Hi sunylat - the keys are going out in batches - you should have received yours by now.
  9. lou5

    Sample code (py)

    Hey everyone, We have some sample code in case anyone finds this helpful. filename: api_sample.py import httplibimport urllibimport jsonimport osimport subprocessimport base64import shutilimport timeimport platformAPI_KEY = 'XXX' # INSERT YOUR API KEY HERE!btsyncbin_mac = 'BitTorrent Sync.app/Contents/MacOS/BitTorrent Sync'btsyncbin_win = 'BTSync.exe'btsyncbin_linux = 'btsync'config_param_posix = '--config'config_param_win = '/config'class SyncInstance: def __init__(self, configName, storagePath, port): self.port = port self.configPath = os.path.join(os.getcwd(), configName) self.storagePath = os.path.join(os.getcwd(), storagePath) shutil.rmtree(self.storagePath, True) os.mkdir(self.storagePath) config = {} config['storage_path'] = self.storagePath config['use_gui'] = False webuiConfig = {} webuiConfig['login'] = 'apitest' webuiConfig['password'] = 'apipass' webuiConfig['listen'] = '127.0.0.1:%d' % port webuiConfig['api_key'] = API_KEY config['webui'] = webuiConfig configFile = open(self.configPath, 'w') json.dump(config, configFile) configFile.close() def launch(self): if platform.system() == 'Windows': btsyncbin = btsyncbin_win configParam = config_param_win elif platform.system() == 'Darwin': btsyncbin = btsyncbin_mac configParam = config_param_posix else: btsyncbin = btsyncbin_linux configParam = config_param_posix binaryPath = os.path.join(os.getcwd(), btsyncbin) subprocess.Popen([binaryPath, configParam, self.configPath]) def request(self, request): try: conn = httplib.HTTPConnection('localhost:%d' % self.port) headers = {'Authorization': 'Basic ' + base64.b64encode('apitest:apipass')} params = urllib.urlencode(request) conn.request('GET', '/api?' + params, '', headers) resp = conn.getresponse() if resp.status == 200: return json.load(resp) else: return None except: return Nonedef writeFile(folder, filename, count): f = open(os.path.join(folder, filename), 'w+') for i in range(1, count): f.write('%d' % i ) f.close()def main(): if API_KEY == 'XXX': print 'In order to run this sample code please insert a valid API key!' return 1 instance1 = SyncInstance('sync1.conf', 'storagepath1', 8888) instance2 = SyncInstance('sync2.conf', 'storagepath2', 8889) instance1.launch() instance2.launch() print 'Waiting for the BitTorrent Sync instances to start...' while True: version1 = instance1.request({'method' : 'get_version'}) version2 = instance2.request({'method' : 'get_version'}) if version1 is not None and version2 is not None: break time.sleep(0.2) print 'Generating secrets on the first instance...' secret = instance1.request({'method' : 'get_secrets', 'type' : 'encryption'}) print secret syncFolderPath1 = os.path.join(os.getcwd(), 'path1') shutil.rmtree(syncFolderPath1, True) os.mkdir(syncFolderPath1) writeFile(syncFolderPath1, 'file1', 300) writeFile(syncFolderPath1, 'file2', 500) print 'Adding a folder on the first instance via read-write secret...' addFolderRes = instance1.request({'method' : 'add_folder', 'dir' : syncFolderPath1, 'secret' : secret['read_write']}) if 'error' in addFolderRes and addFolderRes['error'] != 0: print 'Error %d while adding folder' % addFolderRes['error'] folders = instance1.request({'method' : 'get_folders', 'secret' : secret['read_write']}) print folders print 'Waiting while the files are being indexed...' while True: folders = instance1.request({'method' : 'get_folders', 'secret' : secret['read_write']}) if folders and folders[0]['indexing'] == 0 and folders[0]['files'] == 2: break time.sleep(0.2) print folders print 'Getting a file list on the first instance...' files = instance1.request({'method' : 'get_files', 'secret' : secret['read_write']}) print files syncFolderPath2 = os.path.join(os.getcwd(), 'path2') shutil.rmtree(syncFolderPath2, True) os.mkdir(syncFolderPath2) print 'Adding a folder to the second instance via read-only secret...' addFolderRes = instance2.request({'method' : 'add_folder', 'dir' : syncFolderPath2, 'secret' : secret['read_only'], 'selective_sync' : 1}) if 'error' in addFolderRes and addFolderRes['error'] != 0: print 'Error %d while adding folder' % addFolderRes['error'] print 'Receiving the file list on the second instance...' while True: files = instance2.request({'method' : 'get_files', 'secret' : secret['read_only']}) if files: break time.sleep(0.2) print 'Selecting "file2" for download on the second instance...' fileRes = instance2.request({'method' : 'set_file_prefs', 'secret' : secret['read_only'], 'path' : 'file2', 'download' : 1}) print fileRes print 'Downloading "file2"...' while True: fileRes = instance2.request({'method' : 'get_files', 'secret' : secret['read_only'], 'path' : 'file2'}) if fileRes and fileRes[0]['have_pieces'] == fileRes[0]['total_pieces']: break time.sleep(0.2) print fileRes print 'Download finished' print 'Shutting down the BitTorrent Sync instances...' instance1.request({'method' : 'shutdown'}) instance2.request({'method' : 'shutdown'})main()
  10. lou5

    Showcase

    Hi everyone, We're pretty excited about the API and what everyone can potentially create using it. If you have something you want to share and showcase, let us know by posting here. This would probably be the best place to get feedback also. Lou
  11. We did this for a few reasons actually. First, we wanted to try to keep the user experience as simple as possible and we thought that adding this might be confusing for many new users. Second, there was a technical reason also. When we update our releases, we typically add all the features across platforms (for feature consistency) - we found that adding Encrypted Peers to the mobile apps didn't produce the best experience so until we find a better way to do it, we elected to leave it out... for now. Its definitely something we plan to add but we're trying to do it in a effective way. Hope that answers your question.
  12. Hi everyone, Wanted to let you know that we set up a dedicated section for Dev/API questions and feedback here: http://forum.bittorrent.com/forum/106-developers/ Thanks!
  13. Hi ismail, we'll be sending them out in batches - you should receive it later today.
  14. nils and noiime, here you go: http://www.bittorrent.com/sync/developers/api