import requests
import time
import json


def syncPeers(peers, selfURL):
    while True:
        time.sleep(1 / 2)
        for url in peers:
            try:
                r = requests.get(url + '/peers/' + packURL(selfURL))
                mergePeers(peers, r.json(), selfURL)
            except requests.exceptions.ConnectionError as e:
                time.sleep(1)
                continue


def mergePeers(peers, new, selfURL):
    for peer in new:
        if not peer in peers and peer != selfURL:
            peers.append(peer)


def packURL(url):
    new = str(url)
    new = new.replace('://', '___').replace(':', '-').replace('.', '_')
    return new


def unpackURL(url):
    new = str(url)
    new = new.replace('___', '://').replace('-', ':').replace('_', '.')
    return new

10441ded4a4c2150cf7f2d6f2206330d8b1edb17
<mask token>


def mergePeers(peers, new, selfURL):
    for peer in new:
        if not peer in peers and peer != selfURL:
            peers.append(peer)


<mask token>


def unpackURL(url):
    new = str(url)
    new = new.replace('___', '://').replace('-', ':').replace('_', '.')
    return new

<mask token>


def mergePeers(peers, new, selfURL):
    for peer in new:
        if not peer in peers and peer != selfURL:
            peers.append(peer)


def packURL(url):
    new = str(url)
    new = new.replace('://', '___').replace(':', '-').replace('.', '_')
    return new


def unpackURL(url):
    new = str(url)
    new = new.replace('___', '://').replace('-', ':').replace('_', '.')
    return new

<mask token>


def syncPeers(peers, selfURL):
    while True:
        time.sleep(1 / 2)
        for url in peers:
            try:
                r = requests.get(url + '/peers/' + packURL(selfURL))
                mergePeers(peers, r.json(), selfURL)
            except requests.exceptions.ConnectionError as e:
                time.sleep(1)
                continue


def mergePeers(peers, new, selfURL):
    for peer in new:
        if not peer in peers and peer != selfURL:
            peers.append(peer)


def packURL(url):
    new = str(url)
    new = new.replace('://', '___').replace(':', '-').replace('.', '_')
    return new


def unpackURL(url):
    new = str(url)
    new = new.replace('___', '://').replace('-', ':').replace('_', '.')
    return new

import requests
import time
import json


def syncPeers(peers, selfURL):
    while True:
        time.sleep(1 / 2)
        for url in peers:
            try:
                r = requests.get(url + '/peers/' + packURL(selfURL))
                mergePeers(peers, r.json(), selfURL)
            except requests.exceptions.ConnectionError as e:
                time.sleep(1)
                continue


def mergePeers(peers, new, selfURL):
    for peer in new:
        if not peer in peers and peer != selfURL:
            peers.append(peer)


def packURL(url):
    new = str(url)
    new = new.replace('://', '___').replace(':', '-').replace('.', '_')
    return new


def unpackURL(url):
    new = str(url)
    new = new.replace('___', '://').replace('-', ':').replace('_', '.')
    return new
