diff options
author | Melody Horn <melody@boringcactus.com> | 2020-06-03 13:35:09 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-06-03 13:35:09 -0600 |
commit | 1fb51437daf96f89546e084fdebec6b534108cc3 (patch) | |
tree | 0b28320933f683940f64266b3653217d5c4cb6a7 /dev/georgia/convert.py | |
parent | 46d6de9803c5de1427c75c9d2c6c9b7a7bdc667b (diff) | |
download | pig.observer-1fb51437daf96f89546e084fdebec6b534108cc3.tar.gz pig.observer-1fb51437daf96f89546e084fdebec6b534108cc3.zip |
work even further around weird georgia stuff
Diffstat (limited to 'dev/georgia/convert.py')
-rw-r--r-- | dev/georgia/convert.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/dev/georgia/convert.py b/dev/georgia/convert.py index 6bae48c..10633e1 100644 --- a/dev/georgia/convert.py +++ b/dev/georgia/convert.py @@ -13,12 +13,20 @@ for camera in cameras: result = dict() result['id'] = camera['properties']['cctv_id'] if 'HLS' in camera['properties']: - result['stream'] = camera['properties']['HLS'] + url = camera['properties']['HLS'] + url = url.replace('http://vss1live.dot.ga.gov:80/lo', '/georgiavss1') + url = url.replace('http://vss2live.dot.ga.gov:80/lo', '/georgiavss2') + url = url.replace('http://vss3live.dot.ga.gov:80/lo', '/georgiavss3') + url = url.replace('http://vss4live.dot.ga.gov:80/lo', '/georgiavss4') + url = url.replace('http://vss5live.dot.ga.gov:80/lo', '/georgiavss5') + result['stream'] = url elif camera['properties']['url'] is not None: - result['url'] = camera['properties']['url'].replace('http://navigator-c2c.dot.ga.gov/snapshots', '/georgiasnapshots') + url = camera['properties']['url'] + url = url.replace('http://navigator-c2c.dot.ga.gov/snapshots', '/georgiasnapshots') + result['url'] = url else: continue result['name'] = camera['properties']['location_description'] sources[subdiv].append(result) -with open('sources.js', 'w') as f: +with open('sources.json', 'w') as f: json.dump(dict(sources), f) |