Add DCNC tags file.
[libdcp.git] / scripts / update-language-subtags
index 979d816850eba23b43a95ebeac08ced78e9808d6..874a6dc7e44d7e5107486efba2acf66e6c4553b2 100755 (executable)
@@ -2,6 +2,7 @@
 
 import os
 import urllib.request
+import json
 
 block = {}
 lists = {}
@@ -33,3 +34,10 @@ for k, v in lists.items():
             print(e[0], file=f)
             print(e[1], file=f)
 
+
+with urllib.request.urlopen('https://registry.isdcf.com/languages') as f, open(os.path.join('tags', 'dcnc'), 'w') as g:
+    js = json.loads(f.read())
+    for d in js['data']:
+        if 'dcncTag' in d:
+            print(d['rfc5646Tag'], file=g)
+            print(d['dcncTag'], file=g)